High CPU usage while uploading

Think you've found a bug? Post a description here.

Moderator: Serin

Post Reply
mdj
Moderator
Posts: 656
Joined: Mon Aug 18, 2003 4:00 am
Location: Denmark
Contact:

High CPU usage while uploading

Post by mdj » Sat Jun 10, 2006 6:43 am

Hi Serin,

I have noticed a problem with the usage of the CPU, I think a bit different than the other errors reported, but I have not studied all reports in details, so here is mine:

I have a "small" connection, 256Kbs down, 128Kbs up, and the other day a friend of mine wanted to upload a 700MB thing to me. It took until the next morning, but in the meantime, I had the opportunity to study the behaviour of Cerberus (2.32, W2Ksp4, P3-900, 384MB, Use optimized file sending, passive connection) while being uploaded to. (I haven't examined if the same thing happens while downloading, I can, if you want me to?)

While uploading, the CPU usage for Cerberus went to 100%. During that time, I used procexp from sysinternals.com to take a look at the stack for the thread using the CPU. A typical snapshot of the stack would look like this:

ntoskrnl.exe+0x68e6b
ntdll.dll+0x8403
WS2_32.dll+0xa19a
Cerberus.exe+0x21266
Cerberus.exe+0x3ee04
Cerberus.exe+0x217be

and most of the CPU usage would indeed be in kernel mode, not surprisingly, since ntoskrnl.exe is at the top most of the times.

I have a SETI-like background process, running at low priority, using the CPU that no other process wants, and at this time, that process is getting close to 0% CPU, it is being starved completely. If I raise the priority of that process to "normal" (8), the same that the Cerberus thread is running on, I would have expected the CPU to be distributed 50-50 among the two, but instead, my background process now gets 98+ of the CPU, Cerberus is getting almost nothing, BUT UPLOAD SPEED IS NOT AFFECTED BY THIS, and now the typical stack dump of the same thread would look like this:

ntoskrnl.exe+0x68ca3
ntoskrnl.exe+0x4fc4c
ntoskrnl.exe+0x64f84
ntoskrnl.exe+0x54ba3
ntdll.dll+0x8f03
Cerberus.exe+0x216f9

Still in the kernel, but a different place now not requesting all CPU available.

Note that these snapshots of the stack are only "typical", I made the snapshots several times, and chose a snapshot for each situation that appeared the most times, as this is most likely showing the correct picture of what is going on.

Any chance you can figure out what is going on? It is probably a tough one to disect, as it is Windows code that takes the CPU, but perhaps the stack dumps can give you a hint at what to change so that it stops this behaviour?
Morten Due Jørgensen
http://www.mdjnet.dk

Post Reply