Linux Setup System ulimit

Source: Internet
Author: User


When using Linux as a service runtime environment, there are some performance bottlenecks, because the system defaults to a lower value, typically 1024, it is easy to cause insufficient resources, cannot create a process, or cannot open a file.


First, use Ulimit-a to view system Ulimit settings

ulimit -acore file size           (blocks,  -C)  0data seg size            ( kbytes, -d)  unlimitedscheduling priority               (-E)  0file size                 (blocks, -f)  unlimitedpending signals                   (-i)  127438max locked  memory        (kbytes, -l)  unlimitedmax memory  size          (kbytes, -m)  unlimitedopen files                         (-N)  1048576pipe size             (512 bytes,  -P)  8POSIX message queues      (bytes, -q)   819200real-time priority                (-R)  0stack size                (kbytes, -s)  10240cpu time                 (SECONDS, -T)  unlimitedmax user processes                (-u)  10240virtual memory            (KBYTES, -V)  unlimitedfile locks                         (-X)  unlimited


Second, the parameter meaning

-N is the number of file handles, representing the number of files that the program can open, by default 1024

-u user maximum number of threads, default is 1024


Third, modify the configuration

Method One: Ulimit-n 102400

This method is valid only for the current terminal and will be restored after re-login or reboot


Method Two: Write the configuration to the configuration file ~/.BASHRC or/etc/profile


Method Three: Modify the configuration (recommended)

1, modify the Ulimit-n

vi/etc/security/limits.conf* soft nofile 1048576* hard Nofile 10485 76


2, modify the Ulimit-u

vi/etc/security/limits.d/90-nproc.conf# Default limit for number of user ' s processes to prevent# accidental fork bombs.# See Rhbz #432903 for reasoning.* soft nproc 40960root Soft Nproc Unlimited





This article is from the "Talent" blog, make sure to keep this source http://4988084.blog.51cto.com/4978084/1863734

Linux Setup System ulimit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.