Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

open file descriptors

Posted on 2006-11-05
13
Medium Priority
?
1,904 Views
Last Modified: 2013-12-16
on Linux server how do I find what is the maximum number of open file descriptors per JVM process and how do I change it and what is the recommended number? so its 3 questions :)
0
Comment
Question by:Buffon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
13 Comments
 
LVL 24

Expert Comment

by:slyong
ID: 17878082
Hi,

I am not sure how to find the maximum number of open file descriptors per JVM.  On Linux, the system wide file descriptor can be found:

# cat /proc/sys/fs/file-max

to change it
# echo "65535" > /proc/sys/fs/file-max

to check how many file descriptor being used:
# cat /proc/sys/fs/file-nr
1400    119     65535
   |           |          |__ maximum number of file descriptors allowed on the system
   |           |    
   |           |__ total free allocated file descriptors
   |
   |__  total allocated file descriptors

to show the open file descriptor for processes:
# lsof
0
 
LVL 11

Author Comment

by:Buffon
ID: 17879279
thanks for reply, but I already know about max for wide system, I really need it per process (I think its the same for jvm process) and not wide system :(
by the way what is "total free allocated file descriptors"?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17879409
The default fd limit for any process in linux is 1024
You can verify it: ulimit -n
You can change: ulimit -n 10240 # but increasing the limit is allowed only to root user.
If You want increase it system wide - You would have to do two things
- put the command in some early init script (like /etc/rc.d/rc)
- increase it for each user that logs into the system, it's /etc/security/limits.conf - add line like
*              -       nofile          10240
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Author Comment

by:Buffon
ID: 17879418
is it recommended to increase it? what is the impact on system?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17879432
The limit there is mainly for security reason(as You already know there is limited number of FDs in whole system), but it also helps debugging leaking applications(the other question ;).
It's not recommended to increase this limit globally (as I suggested above) - but if application needs more than 1024 or leaks(then it's temporarty sollution) I would advise to increase the limit for this application only.
In the latter case the application(daemon) have to be initially run as root.
0
 
LVL 11

Author Comment

by:Buffon
ID: 17879452
ok it runs as root and I have root access, so its not a problem. how do I increase this number only for this application?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17879461
How the application is started?
0
 
LVL 11

Author Comment

by:Buffon
ID: 17879470
through ssh, as root, java Server......
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17879477
Then simply create a script which will run the app (or maybe it's already script), and before running the app/java add
ulimit -n 10240
0
 
LVL 11

Author Comment

by:Buffon
ID: 17879483
bash script? so it applies only for current session application? I run it with & parameter and then I close the ssh, will it work?
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 2000 total points
ID: 17879501
the ulimit works for current process and all childs(but each process has it's own limit).
> I run it with & parameter
Yes. But of course the application has to be capable of running in background. Otherwise use nohup command in addition
nohup command parameters &
0
 
LVL 11

Author Comment

by:Buffon
ID: 17879528
yes, of course it continues to run in background, so no need for nohup?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

618 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