Increases the system limit on open files
A process on Red Hat 6.0 with kernel 2.2.5 could open at least 31000 file descriptors this way and a process on kernel 2.2.12 can open at least 90000 file descriptors this way. The upper bound seems to be available memory. To increases the number of open files to 90000 for the root account do the following:
Edit the .bashrc file (vi /root/.bashrc) and add the following line: ulimit -n 90000
You must exit from your terminal and re-login for the change to take effect. To verify that you are ready to go, make sure that when you type as root the command ulimit -a on your terminal, it shows “90000″ next to open files.
[root@deep /]# ulimit -a
core file size (blocks) 1000000
data seg size (kbytes) unlimited
file size (blocks) unlimited
max memory size (kbytes) unlimited
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes unlimited
pipe size (512 bytes) 8
open files 90000 «? this line.
virtual memory (kbytes) 2105343
NOTE: In older 2.2 kernels, though, the number of open files per process is still limited to 1024, even with the above changes.
The “atime” attribute
Linux records information about when files were created and last modified as well as when it was last accessed. There is a cost associated with recording the last access time. The ext2 file system of Linux has an attribute that allows the super-user to mark individual files such that their last access time is not recorded. This may lead to significant performance improvements on often accessed frequently changing files such as the contents of the 7var/spool/news” directory.
To set the attribute to a file, use:
[root@deep /]# chattr +A filename <- For a specific file
For a whole directory tree, do something like:
[root@deep /root]# chattr -R +A /var/spool/ <- For a news and mail
[root@deep /root]# chattr -R +A /cache/ <- For a proxy caches
[root@deep /root]# chattr -R +A /home/httpd/ona/ <- For a web pages