9. linux performance tuning: changing the default limits of the system

Source: Internet
Author: User
Talking about linux performance tuning 9: changing system default limits; talking about linux performance tuning 8: Removing unnecessary overhead http://www.2cto.com/os/201307/228393.html After reading the first two articles, we are trying to save resources for our real services. Problem: our service is actually used... talking about linux performance tuning 9: changing system default limits talking about linux performance tuning 8: Removing unnecessary overhead http://www.2cto.com/os/201307/228393.html After reading the first two articles, we are trying to save resources for our real services. Q: Is our service actually used? The answer is no, because the system has some restrictions by default, which also lead to restrictions on our applications. In this section, we will talk about the resource restrictions in linux. let's take a look at the following data: [root @ localhost Desktop] # ulimit-acore file size (blocks,-c) 0 data seg size (kbytes,-d) unlimitedscheduling priority (-e) 0 file size (blocks,-f) unlimitedpending signals (-I) 15311max locked memory (kbytes,-l) 64max memory size (kbytes,-m) unlimitedopen files (-n) 1024 note! Pipe size (512 bytes,-p) 8 POSIX message queues (bytes,-q) 819200real-time priority (-r) 0 stack size (kbytes,-s) 10240cpu time (seconds, -t) unlimitedmax user processes (-u) 1024 virtual memory (kbytes,-v) unlimitedfile locks (-x) unlimited these are the default limits on some resources or behaviors, /etc/security/limits. in the conf file, file descriptors (also called handles) are used for operations in linux. the number of times a process can open files affects the concurrency of applications, such as some library files. I have written a simple C program to prove this. For applications with high concurrency requirements such as apache, mysql, and oracle (oracle has such recommended values during installation), the default limits must be changed: modify/etc/security/limits. conf # * soft nofile NNNNN * hard nofile NNNNN # The above is just an example. you can also use ulimit to add custom restrictions (many options are also enabled by default ), different users can be restricted #-core-limits the core file size (KB) #-data-max data size (KB) #-fsize-maximum filesize (KB) #-memlock-max locked-in-memory address space (KB) #-nofile-max number of open files #-rss-max resident set size (KB) #-stack-max stack size (KB) #-cpu-max CPU time (MIN) #-nproc-max number of processes #-as-address space limit (KB) #-maxlogins-max number of logins for this user #-maxsyslogins-max number of logins on the system #-priority-the priority to run user process with #-locks-max number file locks the user can hold #-sigpending-max number of pending signals #-msgqueue-max memory used by POSIX message queues (bytes) #-nice-max nice priority allowed to raise to values: [-20, 19] #-rtprio-max realtime priority #

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.