|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
My server has been experiencing proglems due to too many CGI's running at the same time, I've often seen the load jump to well above 150, and I've had to hit the switch on the box a few times becuase I wasn't able to work in the shell to fix the problem. Does anyone know how I could set a maximum number of CGI's simultaneously executing, for the whole server? For each virtual host?
Also, I have been experiencing problems with some sites on my machine taking the server to it's maxclients limit, there are a few sites in particular, when this happens, everyone is locked out of the server until the traffic goes down, of course I could increase maxclients, but I was wondering if there is a way to set a maximum for each vhost, so if one site goes over it's limit, the others wont' be affected. Any help is MUCH appreciated. Marc |
|
#2
|
|||
|
|||
|
Start here -> http://httpd.apache.org/docs/mod/core.html#rlimitcpu and also check out RLimitMEM and RLimitNPROC. All of them can be configured globally or per vhost. You probably don't need to set RLimitNPROC, try to set rlimitcpu like so:
RLimitCPU 30 30 # 30 seconds and rlimitmem: RLimitMEM 10000000 10000000 # 10 mb |
|
#3
|
|||
|
|||
|
I have tried, and am using all three of those. From what I understand, these resource limitations you are speaking of refer to a single child process. Say i only wanted foo.com to only be aloud to run as many as 5 CGI scripts simultaneously, but from different children of course. The limit on the number of processes basically limits how many times a single CGI can fork. No matter how small I set these limits, if the site has enough traffic, and enough CGI's are spawned, it all adds up. When one of my customers CGI's got into an infinite loops and ran all during the night, I was able to fix that with the RLimitCPU, but now the site must be running close to 150 simultaneous CGI's, which is no better.
Also I am looking for something like the MaxClients directive, this directive limits the maximum number of simulataneous connections by limiting the number of httpd's spawned. This directive is not for vhosts, but for the whole server, it is very important to keep this limit for the whole server, but I want to also be able to make it per vhost, say for exampel I allow 100 simulataneous connections, and one of my sites are very big and are using 97 connections, and I have 30 other sites going, these other sites are not going to have service until the traffic on the bigger site slows down. Maybe I am wrong on my analogy, but I have been working on this for weeks, and no luck! |
|
#4
|
|||
|
|||
|
>> but I want to also be able to make it per vhost, say for exampel I allow 100 simulataneous connections
Maybe you should try mod_simultaneous: limits the number of simultaneous accesses to particular directories -> http://www.apacheweek.com/features/modulesoup Note the particular dir, so you should be able to configure it per vhost. In addition, maybe you should provide the following for me to take a look: HostnameLookups xx KeepAliveTimeout xx StartServers xx MinSpareServers xx MaxSpareServers xx MaxClients xx MaxRequestsPerChild xx RLimitCPU xx xx RLimitMEM xx xx and some hardware specification. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > setting apache resource limits |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|