For Programmers: Free Programming Magazines  


Home > Archive > PERL POE > June 2005 > Re: How to make as much childs as possible, but not more than 50% of CPU









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How to make as much childs as possible, but not more than 50% of CPU
Rocco Caputo

2005-06-09, 4:00 am

On Tue, May 03, 2005 at 11:47:19AM +0400, Alex wrote:
> How to make as much childs as possible, but not more than
> (for example 50%) of CPU.


I don't know. How does one portably determine their machine's idle
CPU percent?

--
Rocco Caputo - http://poe.perl.org/
Matt S Trout

2005-06-09, 4:00 am

On Tue, May 03, 2005 at 11:03:10AM -0400, Rocco Caputo wrote:
> On Tue, May 03, 2005 at 11:47:19AM +0400, Alex wrote:
>
> I don't know. How does one portably determine their machine's idle
> CPU percent?


ln -s /dev/random /dev/idle_percent

is probably going to be as close to reliable as anything else :)

--
Matt S Trout Brag sheet: http://trout.me.uk/services.html
LAMP, Infrastructure Contact: services@trout.me.uk
and Automation
specialist Do it once. Do it right.
philip@awale.qc.ca

2005-06-09, 4:00 am


On 03-May-2005 Rocco Caputo wrote:
> On Tue, May 03, 2005 at 11:47:19AM +0400, Alex wrote:
>
> I don't know. How does one portably determine their machine's idle
> CPU percent?


Proc::ProcessTable supports a suprising number of OSes. Dunno if it
returns the info needed, though.

http://search.cpan.org/~durist/Proc-ProcessTable-0.39/

-Philip

Lance Braswell

2005-06-09, 4:00 am





Also, and I'm not saying this is a solution, you can run:

'UNIX95=1 /usr/bin/ps -e -o
pid,ppid,pgid,user,uid,vsz,time,etime,co
mm,args'

which goes a long way towards being able to parse ps portably on most major
Unix platforms. I can't tell you how much mileage we have gotten out of
this simple step. Just thought it was worth a mention. ;)

You might be able to derive %busy using time, etime, and the load average
though. But the problem you are going to run into is what if your child is
CPU bound? Can't do much about that unless you use something proprietary I
think.
-
Lance Braswell - + 1 469 357 6112



philip@awale.qc.c
a
To
05/03/2005 12:55 Rocco Caputo <rcaputo@pobox.com>
PM cc
poe@perl.org
Subject
Re: How to make as much childs as
possible, but not more than 50% of
CPU











On 03-May-2005 Rocco Caputo wrote:
> On Tue, May 03, 2005 at 11:47:19AM +0400, Alex wrote:
>
> I don't know. How does one portably determine their machine's idle
> CPU percent?


Proc::ProcessTable supports a suprising number of OSes. Dunno if it
returns the info needed, though.

http://search.cpan.org/~durist/Proc-ProcessTable-0.39/

-Philip



Rocco Caputo

2005-06-09, 4:00 am

On Tue, May 03, 2005 at 08:43:10PM +0400, Alex wrote:
>
> Can you suggest how much sessions can i use ?(KIDMAX)
>
> system:
> - Dual Intel Xeon 2.4 Ghz processors
> - 1 GB Registered ECC PC2100 266 Mhz DDR RAM
> - Redhat Linux 9
> - PostgreSQL 8.0


It's impossible to tell how many sessions your environment and
application can stand before performance is too poor to continue.

Sessions don't use a constant amount of resources (CPU cycles, file
descriptors, bytes of memory, etc.).

--
Rocco Caputo - http://poe.perl.org/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com