cpu-usage

How to limit CPU resources / Shockwave Flash

Can I set a maximum percentage of CPU resources a specific program or process can use? I want to use the executable name instead of its pid, because I would like certain executables to always run with constrained resources. The reason I ask for that is that I am bored of the way Shockwave Flash behaves. It is not possible that to draw a...

How is CPU usage calculated?

I hope this is the right place to ask this question, as I think it is related to algorithms and performance. On my desktop, I have a little widget that tells me my current CPU usage. It also shows the usage for each of my two cores. I always wondered, how does the CPU calculate how much of its processing power is being used? Also, if ...

Why is there a switch in the CPU core usage when I run this C code?

When I ran this code using gcc, $ cat eatup.c #include<stdio.h> #include<stdlib.h> int main() { int i = 0; while(1) { i++; } } $ the CPU graph went like this : I am not sure why there is a cross in the CPU core usage. I started the run at the rise to the left of the 40 mark, then initially core2 usage rose to...

Boost C++ Libraries: Unit Test Assertion on % Processor Usage

I'm writing a unit test with Boost.Unit, and the code I'm testing must not exceed 50% of a single CPU during a portion of the unit test. How could I make this assertion from within the source code? ...

Can I throttle the max CPU usage of a php script?

I have some scripts that use a ton of cpu is it possible to cap the amount of cpu a process is allowed to use? I am running on CentOs 5.5 by the way. ...

CPU usage different?

Hi. I have a basic question. If I run an executable file (Release, Visual Studio 2010) on two computers with the same CPU speed run two different Windows operating systems, eg. Windws7 vs XP, shall I expect to see different CPU usages when I measure it using the task manager? Is the CPU speed the only factor to measuring the CPU usage?...

Django request impossibly slow, can't find why

I have an Apache2 + mod_python setup which has begun responding impossibly slow since some days - two seconds of processor time for any request of my app. Some interesting points: Debugbar says it's ~15ms of query time. DB is not the main suspect Logging with datetime.now() shows 0.1s is spent inside the view, and 40ms more are spent i...

CPU Cycle count based profiling in C/C++ Linux x86_64

I am using the following code to profile my operations to optimize on cpu cycles taken in my functions. static __inline__ unsigned long GetCC(void) { unsigned a, d; asm volatile("rdtsc" : "=a" (a), "=d" (d)); return ((unsigned long)a) | (((unsigned long)d) << 32); } I don't think it is the best since even two consecutive call...

Browser behavior with huge doms

Can anyone speak to how the different browsers handle the following: Picture an HTML document essentially rendering content of a static app with lots of data. <div class="abundant_class"> <div class="abundant_class"> <div class="abundant_class"></div> <div class="abundant_class"></div> ... </div> ...

Explorer 7 is stuck on 100% CPU / got stack trace

I surf to a web page (the web page belong to my company...) and my explorer is stuck on 100% (desktop, windows XP, 1.5G, IE7, SP3) I'm not sure I have all the pdb and the information needed but the call stack from analyzed dmp file in dbg is below - does it look familiar msls31!InitGroupChunkExt+0x11a msls31!InitGroupChunkExt+0x25e ...

Reading on a NetworkStream = 100% CPU usage

I am reading from a NetworkStream that is in a while loop. The issue is I am seeing 100% CPU usage. Is there any way to stop this from happening? Here is what I have so far: while (client != null && client.Connected) { NetworkStream stream = client.GetStream(); data = null; ...

How to get CPU and RAM usage for each process in C# using WMI

How to get CPU and RAM usage for each process in C# using WMI ? I want to do something like windows Task Manager just simpler. Best regards. EDIT: OK, after some testing I found few isues: 1. Process class from System.Diagnostic has to many limitations when dealing with remote system 2. WMI to remote computer is very slow, about 15 s...

Using Server CPU for Desktop Applications

Though Its a n00bish question I'vent found any clear answer anywhere even after long days of googling. Recently I am Planning to Use a AMD Opteron Quad Core 2350 for my Home Lab. I'll not run it as a Pro Server. rather I'll use it for Development Only. It will have the following things 2 Instances of Apache Server (I'll Need this) 1...

Find out which Zend Framework module loads CPU up to 200%

In my Cpanel account in Daily Process Log I can see that my zend framework application load CPU very much Top Process %CPU 182 /usr/bin/php /home/*******/public_html/index.php But any requests to ZF application goes by index.php (with rewrite rule for Apache) Is it possible to find out what request (url) load CPU? ...