CPU instructions per process
Hi :D
Is there a way to show or count how many CPU instructions a particular process is using or uses? In my work we develop a web application and I'm responsible of maintaining the web server. The app lets you handle data online so each client that uses the web application has a folder associated to it, where his data is stored. (/var/www/html/test) for example. The idea is to get how many CPU instructions the httpd process for that particular folder is having. Is there a way to do this? Thanks in advance, and sorry for the complicated explanation :D |
define CPU instructions?
|
Like x86 for example, instructions from the instruction set of the CPU.
Examples: goto add substract etc Like assembler... very low lvl |
who knows. some tens of thousands per second? why does that bother you? if performance is critical in your environment, consider using other webserver than apache httpd: that is too slow.
say, nginx. p.s. there are no 'goto' and 'substract' in x86 assembly. jmp and sub perhaps are the one you meant. |
Quote:
But it would be an insanely high amount. The CPU also do more than one instruction at one time depending on the amount of ALUs in the CPU. Some instructions take several cycles to perform though. Getting that kind of data would load the CPU more than running apache itself. :) I would reccomend just keeping track of the normal average CPU usage for that process. |
Quote:
Of course, the time taken will be vastly more influenced by whether the app is swapped in or out than by plus or minus a few instructions, and the time to do anything with the data will also be way more influenced by how the data write interacts with the i/o scheduler (where are you with elevator seeks?), but that may or may not be a problem to you, because you could consider that time to be transparent if its all queued up and happening in the background. Now, what did you want to know, particularly given that I have oversimplified everything in order to answer in a finite time? |
well I was expecting answers like this. A weird client wanted that specific data... I simply thought it was impossible to get that info because its way to low lvl and way too difficult to get..
Like I said there is no way around they asked for that data particulary... Anyways thanks a lot for the replies :D |
Quote:
Quote:
|
Are you sure they don't mean how much cpu time on average ( or something like that ) is each process using? Otherwise, give them an assembly language printout of your code, an instruction set manual for the cpu, a calculator and wish them a fond farewell :)
|
Quote:
Quote:
I mean, if they were to decide on the basis of false cycle counting that, in order to cope with the increase in traffic that they have predicted (and you can argue whether this is more imaginary than the cycle counting, or not) that you have to re-write your code in a different language, would you think that this was a good outcome? The other conclusion that they might come to is 'we don't need to upgrade hardware until we get to xxxxx hits per hour' and this can also be problematic if they do need a hardware upgrade at some lower hit level and they are sitting on 'proof' that they do not need to do it. |
Definitely need to ask the client what they are trying to achieve/measure, but at the higher level. Counting cpu instructions is unrealistic.
|
All times are GMT -5. The time now is 04:07 PM. |