Ulimit Tuning | Setting the Ulimit value for a normal user

Source: Internet
Author: User

Personal Summary:How to set the Ulimit value for a normal user1, Vim/etc/profileAdd ulimit-n 10240This command does not need to be run Source/etc/profile reboot. 2, modify the/etc/security/limits.confIncrease* Hard Nofile 10240\ \ Limit the number of open files 102403, test, new normal user, switch to ordinary users to use ULIT-A to see if the modification was successful. Description: Ulimit-a is used to display the current user process limits.
Linux for each user, the system limits its maximum number of processes. To improve performance, you can set the maximum number of processes per Linux user according to the device resource situation, I set the maximum number of processes for a Linux user to 10,000:
Ulimit-u 10000
For Java applications that need to do many socket connections and leave them open, it is best to modify the number of files each process can open by using Ulimit-n xx, which is the default value of 1024.
Ulimit-n 4096 increase the number of files that can be opened by each process to 4096, with a default of 1024
Some of the important settings that other recommendations are set to unrestricted (unlimited) are:
Data segment Length: ulimit-d Unlimited
Maximum memory size: Ulimit-m Unlimited
Stack size: Ulimit-s Unlimited
CPU Time: Ulimit-t Unlimited
Virtual Memory: Ulimit-v Unlimited
The company server needs to adjust the Ulimit stack size parameter to unlimited infinity, using Ulimit-s unlimited only at the time of the shell effect, re-open a shell is invalid. So you have to add Ulimit-s unlimited on the last side of the/etc/profile, Source/etc/profile make the modified file effective.
If you encounter a similar error message Ulimit:max user Processes:cannot Modify limit: Operation not allowed Ulimit:open files:cannot Modify limit: Operation not allowed
Why is the root user possible? What kind of problems do ordinary users encounter?
Look at/etc/security/limits.conf and you'll probably understand.
Linux has a default ulimit limit for users, and this file can be configured with the user's hard and soft configuration, and the hard configuration is an upper limit.
Changes exceeding the upper limit will cause an "Operation not allowed" error.
In Limits.conf Plus
* Soft Noproc 10240
* Hard Noproc 10240
* Soft Nofile 10240
* Hard Nofile 10240
is to limit the maximum number of threads and the number of files to 10240 for any user.

Ulimit Tuning | Setting the Ulimit value for a normal user

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.