LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-06-2015, 04:53 AM   #1
gaurav_s
Member
 
Registered: Jul 2014
Posts: 43

Rep: Reputation: Disabled
Soft limits and hard limits of process


How to get Soft limit ( Max open files) and hard limit of process running in linux .Apart from using cat /proc/<pid>/limits .? i.e by using ulimit or any other command .
 
Old 01-06-2015, 05:05 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
ulimit

http://man7.org/linux/man-pages/man2/setrlimit.2.html

http://linux.die.net/man/5/limits.conf
 
Old 01-06-2015, 05:12 AM   #3
gaurav_s
Member
 
Registered: Jul 2014
Posts: 43

Original Poster
Rep: Reputation: Disabled
I am using shell script, getrlimit can be used in C i gues and it can't get the max open file limit for particular process.

Last edited by gaurav_s; 01-06-2015 at 05:51 AM.
 
Old 01-06-2015, 08:46 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,711
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
As far as I know from reading the man page, the limit once set applies to all processes made thereafter. You can use the command to query both the hard and the soft limits, and, as far as I know, "what you get is the right answer."
 
Old 01-06-2015, 09:57 AM   #5
gaurav_s
Member
 
Registered: Jul 2014
Posts: 43

Original Poster
Rep: Reputation: Disabled
For different process limits are different. We can fuind using /proc/<pid_of_process>/limits ,but i want another way to do this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to set open file descriptor hard and soft limits Z038 Slackware 3 06-16-2013 11:37 PM
Setting limits in /etc/security/limits.conf vaibhav.vsk Linux - Security 1 09-20-2012 08:22 AM
Time limits on a command or process? WingnutOne Linux - General 7 07-09-2008 04:22 PM
limits are not working (limits.conf) PkerC Red Hat 3 06-22-2006 10:14 AM
getrlimit is setting soft and hard limits to -1, why? FunkMeisterMaz Programming 2 03-22-2004 06:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration