Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

6.10. The ulimit parameter

Linux itself has a Max Processes per user limit. This feature allows us to control the number of processes an existing user on the server may be authorized to have. To improve performance, we can safely set the limit of processes for the super-user root to be unlimited. Edit the .bashrc file vi /root/.bashrc and add the following line:
          ulimit -u unlimited
          
You must exit and re-login from your terminal for the change to take effect.

          [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  (1)
          pipe size (512 bytes)	        8
          open files	                1024
          virtual memory (kbytes)	2105343
          
(1)
Make sure that when you type as root the command ulimit -a on your terminal, it shows unlimited next to max user processes.

Tip: You may also do ulimit -u unlimited at the command prompt instead of adding it to the /root/.bashrc file.

Increases the system limit on open files for instance 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.

          [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   (1)
          virtual memory (kbytes)	2105343
           

(1)
Make sure that when you type as root the command ulimit -a on your terminal, it shows 90000 next to open files.

Note: In older 2.2 kernels, though, the number of open files per process is still limited to 1024, even with the above changes.

 
 
  Published under the terms of the Open Publication License Design by Interspire