- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- maxfiles and maxfiles_lim vs nofiles via ulimit -a
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 12:07 AM
тАО09-26-2005 12:07 AM
maxfiles and maxfiles_lim vs nofiles via ulimit -a
I have a question about maxfiles / maxfiles_lim kernel parameter isuse.
From man page, I know the maxfiles is soft limit and maxfiles_lim is hard limit, but, what's the time that user process will apply those two limitation ? I try to write a program and open many files and my program can allocate files more than maxfiles_lim setting, why ? and I also find in my shell environment, it depends on nofiles setting from ulimit -a command.
For example :
maxfiles 60
maxfiles_lim 1024
nofiles (ulimit -a) 1500
Then my program can allocate 1500 files simultaneously, why it not stop in 1024 ? this problem really confuse me.
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 12:15 AM
тАО09-26-2005 12:15 AM
Re: maxfiles and maxfiles_lim vs nofiles via ulimit -a
did you use a superuser account or non-superuser account to run the program?
revert
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 12:17 AM
тАО09-26-2005 12:17 AM
Re: maxfiles and maxfiles_lim vs nofiles via ulimit -a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 12:20 AM
тАО09-26-2005 12:20 AM
Re: maxfiles and maxfiles_lim vs nofiles via ulimit -a
maxfiles_lim 1024 are the kernel setting of which used to control maximum number of files.
nofiles setting with soft limit will use maximum of 60. nofiles with hard limit will use maximum of 1024 files.
You can even set nofiles to *unlimited* so that it is not meant to to use unlimited open files. It will have limit based on maxfiles and maxfiles_lim setting.
hard and soft limit setting view:
http://www.faqs.org/faqs/hp/hpux-faq/section-144.html
To monitor open files then,
# sar -v 1
use lsof tool too.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 12:26 AM
тАО09-26-2005 12:26 AM
Re: maxfiles and maxfiles_lim vs nofiles via ulimit -a
Thanks. But I really get the testing result over my hard limit, here is my testing program.
$ more create.c
#include
main()
{
FILE *f[2000];
char *filename="test";
char buffer[10];
int i;
for (i=0; i < 2000; i++) {
printf("Number of tries: %d :", i);
if ((f[i]=fopen(filename, "rt")) == NULL)
printf("Failed\n");
else
printf("Success\n");
}
gets(buffer);
for (i=0; i < 2000; i++) {
fclose(f[i]);
}
}
And, maxfiles and maxfiles_lim
maxfiles - - 60
maxfiles_lim - - 1024
nofiles(descriptors) 1500
Here is the partial output
Number of tries: 1491 :Success
Number of tries: 1492 :Success
Number of tries: 1493 :Success
Number of tries: 1494 :Success
Number of tries: 1495 :Success
Number of tries: 1496 :Success
Number of tries: 1497 :Failed
Number of tries: 1498 :Failed
Number of tries: 1499 :Failed
Number of tries: 1500 :Failed
Number of tries: 1501 :Failed
Number of tries: 1502 :Failed
Number of tries: 1503 :Failed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 08:38 PM
тАО09-26-2005 08:38 PM
Re: maxfiles and maxfiles_lim vs nofiles via ulimit -a
You're always opening the same file.
Did you try with different filenames?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2005 12:14 AM
тАО09-27-2005 12:14 AM
Re: maxfiles and maxfiles_lim vs nofiles via ulimit -a
You might want to run lsof in a separate window and let it count your open files. Perhaps some of what you are opening are closing before you get to the end of the loop.