Web Hosting Talk







View Full Version : cpu use


BenH
10-28-2001, 11:31 AM
Hey,
is there any way i can know how much cpu im using ?
my webhost just kick me out saying im using all the cpu and stuck the server ( maybe ...) .
how can i know if its true .

and 2nd qustion
when i looked in the access log, i saw about 50 hits per second , can it help to calculate how many cpu is being used ?

(i need the answer to tell my new hoster )

Thank you

Synergy
10-28-2001, 07:09 PM
Its very hard to say on this situation.....

Webdude
10-29-2001, 02:28 AM
Geez, tell them to simply limit how much cpu your account can use. This is easily done if they are using Apache...

In your virtual host, just set these(or similar) settings:

<VirtualHost xxx.xxx.xxx.x>
ServerAlias www.domain.com domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/domain/public_html
RLimitMEM 15728640
(Prevents your account from using more than 15 megs ram.)
RLimitCPU 3
(Prevents any script from operating more than 3 seconds at a time. 3-5 seconds should be sufficeint and prevents script looping. It also kills off bad scripts that continue to run after they should have already stopped of their own accord.)
RLimitNPROC 5
(This prevents your scripts from being run more than 5 times at the exact same time. I have noticed that some scripts actually run multiple instances of themselves although it's not needed. If a site is a busy one, scripts doing this can cause probs for the server. It shouldnt interefere with your site as the odds of more than 5 people hitting the submit button at the EXACT same time is extremely remote.)
BytesLog domlogs/domain.com-bytes_log
User domain
Group domain
ServerName www.domain.com
CustomLog domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/domain/public_html/cgi-bin/
</VirtualHost>

Any of those 3 options can be changed to whatever the host feels is correct for them. Those are just numbers I pulled out of the hat. The numbers I gave should be safe for both you and the host.

microsol
11-09-2001, 08:43 AM
Originally posted by Webdude
Geez, tell them to simply limit how much cpu your account can use. This is easily done if they are using Apache...

In your virtual host, just set these(or similar) settings:

<VirtualHost xxx.xxx.xxx.x>
ServerAlias www.domain.com domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/domain/public_html
RLimitMEM 15728640
(Prevents your account from using more than 15 megs ram.)
RLimitCPU 3
(Prevents any script from operating more than 3 seconds at a time. 3-5 seconds should be sufficeint and prevents script looping. It also kills off bad scripts that continue to run after they should have already stopped of their own accord.)
RLimitNPROC 5
(This prevents your scripts from being run more than 5 times at the exact same time. I have noticed that some scripts actually run multiple instances of themselves although it's not needed. If a site is a busy one, scripts doing this can cause probs for the server. It shouldnt interefere with your site as the odds of more than 5 people hitting the submit button at the EXACT same time is extremely remote.)
BytesLog domlogs/domain.com-bytes_log
User domain
Group domain
ServerName www.domain.com
CustomLog domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/domain/public_html/cgi-bin/
</VirtualHost>

Any of those 3 options can be changed to whatever the host feels is correct for them. Those are just numbers I pulled out of the hat. The numbers I gave should be safe for both you and the host.

How would
RLimitMEM 15728640
RLimitCPU 3
affect the server performance if put in as a main server directive.
Would this work and automatically apply to ALL accounts on the server?
I am asking this because i observed that http processes at our server start at around 12MB and within a week later sometimes they're up to 41MB. Would these directives prevent this problem?