I have recently learnt that to be able to increase the amount of virtualhosts that we can serve via apache depends on file-descriptors.
they say the value should be added to /etc/sysctl.conf as fs.file-max = 65536
What is the correlation between amount of RAM I have with the number above ?
Could you tell me like;
"You should have X GB RAM and Y GHz CPU to be able to set fs.file-max to Z"
I basically want to know X - Y - Z relationship to be able to make the setting.
Server is an Ubuntu 8.04 and I can increase the RAM or CPU to virtually any number through my cloud server provider.
ps: or why should i care about this, is there a way that i can set up my system that it will serve as my memory permits it to serve ?
this is the tutorial (official plesk doc)
1) Add the following line to /etc/sysctl.conf:
$ fs.file-max = 65536
2) Run the following shell command:
$ /sbin/sysctl -w fs.file-max=65536
Note that the value fs.file-max can be equal up to 220=1048576).
3) Add the following line to beginning of /etc/init.d/apache2 and /usr/sbin/apache2ctl:
$ ulimit -n `cat /proc/sys/fs/file-max`
4) Change __FD_SETSIZE value in /usr/include/bits/typesizes.h and /usr/include/nptl/bits/typesizes.h files. It should be like:
$ define __FD_SETSIZE 65536
5) Download and rebuild packages:
$ apt-get install apt-src $ apt-src --build install openssl $ dpkg -i libssl*.deb openssl*.deb $ apt-src --build install apache2 $ dpkg -i libapr*.deb apache2_*.deb apache2-common*.deb apache2-mpm- prefork*.deb apache2-utils*.deb $ cp /opt/psa/suexec/psa-suexec2 /usr/lib/apache2/suexec2 /etc/init.d/apache2 restart $ apt-src --build install libc-client2002edebian $ dpkg -i libc-client-dev_2002edebian1-*.deb libc-client2002edebian*.deb mlock*.deb $ apt-src --build install php4 $ dpkg -i `ls *deb|grep php4|grep -v apache-mod`