Solved

Linux-ulimit

Posted on 2008-11-01
5
4,088 Views
Last Modified: 2013-12-24
I have tried editing the limits.conf file  to change the ulimit value for the linux box. Since i got the warning in logs "INFO | jvm 1 | 2008/10/02 19:58:49 | java.io.IOException: Too many open files"

vi /etc/security/limits.conf

# End of file
*   soft    nofile  1024
*   hard    nofile  4096

and rebooted the system.But after the reboot also the ulimit value didnt changed and its still 1024

[root@sys1 ~]# ulimit -n
1024

[root@sys1 ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals                 (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 36864
virtual memory          (kbytes, -v) unlimited


[root@sys1 ~]# uname -a
Linux sys1.domain.com 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:29:47 EST 2005 x86_64 x86_64 x86_64 GNU/Linux

[root@sys1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant)

I have to increase the ulimit value.The question is why the ulimit value did not updated after the reboot?



0
Comment
Question by:linuxraja
5 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 22856458
Hi,
for a change to take effect immediately after logon (or reboot), you must change the soft limit in limits.conf!
The hard limit is the value up to which a user may increase the limit by using the 'ulimit' command.

wmp
0
 
LVL 12

Accepted Solution

by:
ibu1 earned 500 total points
ID: 22860496
0
 

Author Comment

by:linuxraja
ID: 22873981

Ok. Now how the ulimit to the user and ulimit to the operating system are related. Actually I want to increase the ulimit value for one particular application which is running under the user name user1. As i told before currently it is

vi /etc/security/limits.conf

# End of file
*   soft    nofile  1024
*   hard    nofile  4096

[root@sys1 ~]# ulimit -n
1024

1. How to find the current opened files by the operating system and current opened files by the user?
2. Is there any limitations like user ulimit should be less than the operating system ulimit?

0
 
LVL 14

Expert Comment

by:Deepak Kosaraju
ID: 22874019
lsof -u
multiple username can be given separated by comma(no space between each user)
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 22874498
Hi,
to have the limit changed for user1 (all applications),
enter in /etc/security/limits.conf

*   soft    nofile  1024
*   hard    nofile  4096
user1 soft nofile 4096
As I said,  you must change the soft limit !
The hard limit is the value up to which a user may increase the limit by using the 'ulimit' command.
To change only for one application, you could modify  the start script of that application (if one exists) by adding
ulimit -n 4096
 
There is no operating system 'ulimit' beyond what's defined in limits.conf.
There is a system wide maximum number of open files permitted (that's not an ulimit!)
To change, add
fs.file-max = 65535  
(or the like) in /etc/sysctl.conf
Reboot, or load new values from the sysctl.conf file by issuing
sysctl -p /etc/sysctl.conf
 
 wmp
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now