Loading...

Tweak Apache to handle large traffic and large process

Wed 10 Dec 2008 12:31:53 | 0 comments

If your site isbuilt from heavy php files like us, you're probably using apache's prefork model (instead of a mpm such as worker, which would be more efficient but cause stability problems with zend engine) and as your site grows, yu apache will start forking way too many threads.

 

As a result you may end up forcing hte limits of your operating system's default configurations.

 

At Linux, there are 2 important sysctl configurations that can affect the performance of your site in high-load sitatuons; they are: kernel.shmall and kernel.shmmax

 

You can use their current values by typing:

touch /proc/sys/kernel/shmall

and 

touch /proc/sys/kernel/shmmax

 

shmmaz should be around 32MB.

 

The solution is as easy as increasing it, and fortunately  that doesn't requre kernel recompilation.

 

Here is what you should type:

 

echo 134217728 >/proc/sys/kernel/shmmax

aand

echo 134217728 >/proc/sys/kernel/shmall

 

Now both are 128MB and you're all set. You may want to save these changes in /etc/sysconfig.ctl as well and to see all values, type in sysctl -a

 

Hope this helps,

  • SHARE

Comments




or
CAPTCHA Images

Twitter

Powered by

Bir Digital Turks Uyesiyim

More about me...

About My Company