It is good practice to change in the /etc/security/limits.conf instead of setting it in the .bashrc or /etc/profile
To increase the limit for a specific user.
<username> soft nofile 100000
<username> hard nofile 100000
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "></span><b>
Soft limit Vs Hard Limit:</b>
<b>
Summary:</b>
Hard limits are a kernel-configurable item, and users
can't exceed them. Soft limits are the user
defaults, and users can change that using the ulimit
program or the limit/unlimit builtins.
<p>man setrlimit(2)
</p><p>Basically, soft limits can be changed to anything up
to the hard limit.
</p><p>Think of soft limits as the warning barrier. When a
user reaches the soft limit they will get an warning
message but are still allowed to use more space up to
the hard limit. Also, you can configure the system
to set expiration times for users who have exceeded
thier soft limit.
</p><p>Just remember that the max file descriptors is 1024.
</p><p>As for file descriptors, one good way to conserve
them is to use mmap(2) for file access. You can
close the file descriptor after you establish the
mapping. Much faster, uses less resources, and it
saves on fds.</p>
Comments
Post a Comment