Re: Perfomance problem while passing large data volumes via WMI
From: Ivan Brugiolo [MSFT] (ivanbrug_at_online.microsoft.com)
Date: 08/18/04
- Next message: Anthony LaMark: "Re: W2K/WMI service (WinMgmt.exe) accessing an ODBC connection"
- Previous message: Ted: "Error Return Codes"
- In reply to: Stanislav Efremov: "Perfomance problem while passing large data volumes via WMI"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Aug 2004 10:26:36 -0700
There are inherent problems passing too much data that way.
First of all, the data is copyed at each and every marshaling boundary.
Then, the overall size of the transferred data has a quota
(exact details of the quota depends on the OS and the SKU),
that artificially slows down the operation to prevent overloads.
-- This posting is provided "AS IS" with no warranties, and confers no rights. Use of any included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Stanislav Efremov" <hell@sw.ru> wrote in message news:54b7374a.0408180734.1472506a@posting.google.com... > Greetings, > I have noticed a perfomance problem while trying to pass large data > through WMI. Suppose we have large file at server side (the size of > the file is about 300 Mb) and we want to pass it to the client side. > > Here's my code > unsigned nCount; //size of data > CComVariant varBuf; //CComVariant where we store the data > > //fill the variant, nothing of interest here > HRESULT hr; > SAFEARRAY * psaData; > SAFEARRAYBOUND saBound[1]; > saBound[0].lLbound = 0; > saBound[0].cElements = nCount; > > psaData = SafeArrayCreate(VT_UI1, 1, saBound); > if (!psaData) > { > return E_OUTOFMEMORY; > } > > byte *pVarBuf; > hr = SafeArrayAccessData(psaData, (void HUGEP**)&pVarBuf); > if (FAILED(hr)) > { > SafeArrayDestroy(psaData); > return hr; > } > > //copy stored data to safearray > memcpy(pVarBuf, pBuf, nCount); > SafeArrayUnaccessData(psaData); > > varBuf.vt = vt | VT_ARRAY; > varBuf.parray = psaData; > > //objects to fill > CComPtr<IWbemClassObject> spOutParams; > CComPtr<IWbemClassObject> spObject; > hr = GetOutParams(&spOutParams, &spObject, pCtx); //fill objects > > //put variant to the WMI out-object > //these methods are memory and time consuming. > hr = pObj->Put(L"arrBuf", 0, const_cast<CComVariant*>(&var), 0); > hr = pResponseHandler->Indicate(1, &spOutParams.p); > > > Well, I do understand that filling the variant this way is not > optimal, but nontheless if we look at my logs: > 1) we read and fill CComVariant with data from file rather fast, for > example we read 300Mb file in memory and fill the variant whithin 30 > seconds > 2) two methods are the most time-consuming, they are > pObj->Put(L"arrBuf", 0, const_cast<CComVariant*>(&var), 0); > and > pResponseHandler->Indicate(1, &spOutParams.p); > > These two methods lasts 30 minutes, so the perfomance problem really > exists. Actually there are two processes that are most CPU consuming - > my provider process and svchost.exe which is Windows Management > Instrumentation service. My provider consumes about 1,5 Gb of memory > and about 50% CPU time while passing this data to client. And svchost > also consumes large amount of memory and about 50% of CPU time while > passing data to client. The client-side is OK, there was not any > network drawback while this experiment. > Also I should mention that I can pass rather small files very fast, so > I pass 13Mb file in 1 second and I pass 25Mb file in 3 seconds. So I > think the main drawback is in memory consuming. > > My questions are: > 1) Why did the WMI process consumes CPU while passing data to client? > 2) Why did my provider consumes about 1.5 Gb of memory while passing > data to client? It doesn't use Virtual memory, it tryes to allocate > all available memory instead. > 3) What is the best way to pass large data to client. > > Thank you in advance, > Stanislav Efremov.
- Next message: Anthony LaMark: "Re: W2K/WMI service (WinMgmt.exe) accessing an ODBC connection"
- Previous message: Ted: "Error Return Codes"
- In reply to: Stanislav Efremov: "Perfomance problem while passing large data volumes via WMI"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|