High CPU usage while uploading

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

Moderator: Serin

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

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:


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:


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

Post Reply