Hi Scott: > I don't understand what you mean, "top" shows you what process is taking > most of the CPU time, not which piece of code is.
Yes that's correct, and was noticeable from a script I wrote. So I need to go beyond and see which portion of the code appears to consume the most CPU time ( as u put it below) which I presume is directly proportional to the CPU % I see from "top". Knowing that will then allow me to see how it can be improved to reduce CPU % . I'm not sure if it's overheads when calling 'use <package>' or loops, arrays, sql processing etc.. causing the unnecessary CPU usage. Just want to see if I can improve it. > > The above url you mentioned looks like it will give you what you want. > The time is not actually seconds taken from execution to completion > (Although it looks like it has that as well) it is cpu time it has taken > to execute. > Look at the following command: > > [EMAIL PROTECTED] scott]$ time sleep 2 > > real 0m2.011s > user 0m0.000s > sys 0m0.010s > > Notice Real took just over 2 seconds, thats because it slept it didn't use > any cpu cycles to sleep, but .010 seconds on sys, which states it took > .010 seconds of the cpu time to execute. > I believe the cpu time is user + sys time. real is the actual time it took > to run from execute to completion. Thanks for the info. I'm yet to try this module to see if I can get it to work. I'll see how I go. I do have another question. When multiple browser sessions on a script is called, does the web server control the servicing of these processes. i.e does it place them on a queue and wait until resource is available to run the process, if CPU or memory usage is high. If not how can I control these processes for browser based script ? I'm thinking along the lines if CPU is say at x% then hold the incoming processes for that script in a queue. Once CPU goes below x% then process the next one in the queue etc ... Does Perl have this kind of support or I don't really have to worry about this for browser based session scripts ? Thanks for your help. Louis -- I'm always learning something new everyday. Thanks Sluggers. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
