>-----Original Message----- >From: [email protected] [mailto:[email protected]] >On Behalf Of Ralf Hildebrandt >Sent: Monday, November 08, 2010 1:16 PM >To: [email protected] >Subject: fatal: socket: Too many open files
>Using
>% ulimit -n 8192
>% postfix start
>Postfix is working flawlessliy, but how can I set the OS limits
>"automagically"?
>I already edited /etc/security/limits.conf to contain:
>* hard nofile 8192
>* soft nofile 8192
>but that results in the aforementioned "fatal: socket: Too many open
>files" error.
>Postfix is running on kernel 2.6.x, Debian/GNU Linux.
This is for RedHat but I guess it will work for other flavours too…
6.9. The file-max parameter
The file-max file /proc/sys/fs/file-max sets the maximum number of file-handles
that the Linux kernel will allocate. We generally tune this file to improve the
number of open files by increasing the value of /proc/sys/fs/file-max to
something reasonable like 256 for every 4M of RAM we have: i.e. for a machine
with 128 MB of RAM, set it to 8192 - 128/4=32 32*256=8192.
The default setup for the file-max parameter under Red Hat Linux is: "4096" To
adjust the value of file-max to 128 MB of RAM, type the following on your
terminal:
[r...@deep] /# echo "8192" >/proc/sys/fs/file-max
Add the above commands to the /etc/rc.d/rc.local script file and you'll not
have to type it again the next time your server reboots.
Edit the /etc/sysctl.conf file and add the following line:
# Improve the number of open files
fs.file-max = 8192
You must restart your network for the change to take effect. The command to
manually restart the network is the following:
[r...@deep] /# /etc/rc.d/init.d/network restart
<<image001.gif>>
<<image002.gif>>
