Securing and Optimizing Linux:RedHat Edition | All about OS

The “bdflush” parameters

Категория: Securing and Optimizing

The “file-max” parameter
The file-max file 7proc/sys/fs/file-max” set 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 7proc/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:
Under Red Hat Linux 6.1
[root@deep /]# echo “8192″ >/proc/sys/fs/file-max
Add the above commands to the 7etc/rc.d/rc.local” script file and you’ll not have to type it again the next time your server reboots.
Under Red Hat Linux 6.2
Edit the “/etc/sysdl.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 restart the network is the following:
• To restart all network devices manually on your system, use the following command: [root@deep /]# /etc/rc.d/init.d/network restart
Setting network parameters [ OK ]
Bringing up interface lo [ OK ]
Bringing up interface ethO [ OK ]
Bringing up interface eth1 [ OK ]
NOTE: When you regularly receive from your server a lot of messages with errors about running out of open files, you might want to raise this limit. The default value is 4096. A file server or web server needs a lot of open files.
The “inode-max” parameter
The inode-max file 7proc/sys/fs/inode-max” set the maximum number of inodes handlers. We generally tune this file to improve the number of inodes opened by increasing the 7proc/sys/fs/inode-max” to a value roughly 3 to 4 times (8192*4=32768) the number of opened
files we have set to the “file-max” parameter above. This is because the number of opened inodes is at least one per open file, and often much larger for large files.
The default setup for the “file-max” parameter under Red Hat Linux is: 1116376″
• To adjust the value of inode-max to 128 MB of RAM, type the following on your terminal:
Under Red Hat Linux 6.1

Страниц: 1 2 3 4 5

« General System Optimization
Increases the system limit on open files »