How to set the ulimit values unlimited in linux

You can put limits on certain resources to help ensure that the most important processes on your servers can keep running and competing processes but you need to anticipate where limits will make sense and where they will cause problems. Some heavy applications like SAP could fail because of the ulimit limits.

For example, sometimes applications get an error about too many files open. Increase the number of open files limit in Linux, you can change the maximum amount of open files. You may modify this number by using the ulimit command.

ulimit command for unlimited

ulimit command for unlimited

 

There are two kinds of limits:

soft limits are simply the currently enforced limits
hard limits mark the maximum value which cannot be exceeded by setting a soft limit

Each operating system has a different hard limit setup in a configuration file /etc/security/limits.conf. These limitations include how many files a process can have open, how large of a file the user can create, and how much memory can be used by the different components of the process such as the stack, data and text segments. To see the limits associated with your login, use the command ulimit -a.

ulimit values in Linux

Use below command to see the current user ulimit values in your machine.

[gopal@ssh keys]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 7279
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 4096
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

Set the ulimit values unlimited

Linux

CPU time (seconds): ulimit -t unlimited
File size (blocks): ulimit -f unlimited
Maximum memory size (kbytes): ulimit -m unlimited
Maximum user processes: ulimit -u unlimited
Open files: ulimit -n 8192 (minimum value)
Stack size (kbytes): ulimit -s unlimited
Virtual memory (kbytes): ulimit -v unlimited

IBM AIX

CPU time (seconds): ulimit -t unlimited
File size (blocks): ulimit -f unlimited
Maximum memory size (kbytes): ulimit -m unlimited
Maximum user processes: ulimit -u unlimited
Open files: ulimit -n 8192 (minimum value)
Stack size (kbytes): ulimit -s 8192 (minimum value)
Virtual memory (kbytes): ulimit -v unlimited

Sun Solaris

CPU time (seconds): ulimit -t unlimited
File size (blocks): ulimit -f unlimited
Maximum user processes: ulimit -u unlimited
Memory (kbytes): ulimit -m unlimited
Open files: ulimit -n 8192 (minimum value)
Stack size (kbytes): ulimit -s 8192 (minimum value)
Virtual memory (kbytes): ulimit -v unlimited

HP-UX

CPU time (seconds): ulimit -t unlimited
File size (blocks): ulimit -f unlimited
Memory (kbytes): ulimit -m unlimited
Nofiles (descriptors): ulimit -n 8192 (minimum value)
Stack size (kbytes): ulimit -s 8192 (minimum value)

ulimit options and usages

-a     All current limits are reported
-c     The maximum size of core files created
-d     The maximum size of a process's data segment
-e     The maximum scheduling priority ("nice")
-f     The  maximum  size  of files written by the shell and its
       children
-i     The maximum number of pending signals
-l     The maximum size that may be locked into memory
-m     The maximum resident set size (has no effect on Linux)
-n     The maximum number of open file descriptors (most systems
       do not allow this value to be set)
-p     The pipe size in 512-byte blocks (this may not be set)
-q     The maximum number of bytes in POSIX message queues
-r     The maximum real-time scheduling priority
-s     The maximum stack size
-t     The maximum amount of cpu time in seconds
-u     The  maximum  number  of  processes available to a single
       user
-v     The maximum amount of virtual  memory  available  to  the
       shell