Control Apache CPU, Memory, and Processes with httpd.conf

The following Apache HTTPD directives are for controlling processes launched by Apache children. Raising the maximum resource limit requires that the server is running as root, or in the initial startup phase. They apply to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.

Please check out the following article if you aren’t familiar with what this stuff does: Optimizing Servers and Processes for Speed with ionice, nice, ulimit.

RLimitMEM

Limits the memory consumption.
Sets the soft resource limit for all processes and the second parameter sets the maximum resource limit.
View the RLimitMEM Documentation

RLimitCPU

Limits the CPU consumption.
View the RLimitCPU Documentation

RLimitNPROC

Limits the number of processes that can be launched by processes launched by Apache children.
View the RLimitNPROC Documentation

Sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. Process limits control the number of processes per user. If CGI processes are not running under user ids other than the web server user id, this directive will limit the number of processes that the server itself can create. Evidence of this situation will be indicated by cannot fork messages in the error_log.


About these ads

About Charles Torvalds
Web Developer with a special interest in server-side technologies and especially network-level topics, security, efficiency, very obscure pr

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,241 other followers

%d bloggers like this: