- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- select and maxfiles e maxfiles_lim
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
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
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
04-18-2007 10:30 PM
04-18-2007 10:30 PM
select and maxfiles e maxfiles_lim
in the HP-UX 11i OS, I've a process that perform a select routine that make an error.
The errno is EBADF.
This error happens with the change of kernel parameter maxfiles e maxfiles_lim from 2048 to 5500.
The select is:
select(max_fd, &fdProcSet, NULL, NULL, &poll_time)
where max_fd is value from getlimit:
struct rlimit rl;
rl.rlim_max = 0;
getrlimit(RLIMIT_NOFILE, &rl);
max_fd = rl.rlim_max;
and fdProcSet is:
fd_set fdProcSet
Can You help me?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 11:11 PM
04-18-2007 11:11 PM
Re: select and maxfiles e maxfiles_lim
Several parameters may require adjustment.
maxfiles 256 - 256
maxfiles_lim 2048 Y 2048
nfile 4096 - 4096
maxuprc
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 12:17 AM
04-19-2007 12:17 AM
Re: select and maxfiles e maxfiles_lim
the kernel parameter is:
maxfiles 5500 - 5500
maxfiles_lim 5500 Y 5500
nfile 63488 - (15*NPROC+2048)
maxuprc 3686 Y ((NPROC*9)/10)
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 01:05 PM
04-19-2007 01:05 PM
Re: select and maxfiles e maxfiles_lim
Manpages can be your friend - from the 11.11 (11iv1) manpage:
[EBADF] One or more of the file descriptor sets specified a file descriptor that is not a valid open file descriptor. This could happen either if the file descriptor sets are not initialized or nfds argument is greater than FD_SETSIZE.
So, either the FD you passed isn't open, or you went beyond FD_SETSIZE. I would suggest printing FD_SETSIZE from your program and also running it under a verbose tusc trace to see exactly what FDs are being set in the fd_sets for the call. That may require havint tusc show both syscall entry and exit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 10:37 PM
04-19-2007 10:37 PM
Re: select and maxfiles e maxfiles_lim
This is the problem!
Therefore, increasing the parameter of the kernel, is necessary to remember itself of set the FD_SETSIZE value.
It's right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2007 01:54 AM
04-20-2007 01:54 AM
Re: select and maxfiles e maxfiles_lim
But doesn't the manpage demonstrate how the user is supposed to raise the upper bound for file descriptor sets in the given sample snippet and its comments?
The FD_SETSIZE is used in the definition of fd_set structure. It is
set to a value of 2048 to accommodate 2048 file descriptors. Any user
code that uses FD_SETSIZE or the structure fd_set should redefine
FD_SETSIZE to a smaller value (greater than or equal to the number of
open files the process will have) in order to save space. Similarly,
any user code that wants to test more than 2048 file descriptors
should redefine FD_SETSIZE to the required higher value.
The user can also allocate the space for fd_set structure dynamically,
depending upon the number of file descriptors to be tested. The
following code segment illustrates the basic concepts.
int num_of_fds,s;
struct fd_set *f;
/*
* Set num_of_fds to the required value.
* User can set it to the maximum possible value the kernel is
* configured for, by using sysconf(_SC_OPEN_MAX).
* Note that, if you are not using these many files, you are
* wasting too much space.
*/
num_of_fds = sysconf(_SC_OPEN_MAX);
s = sizeof(long);
/*
* howmany is a macro defined in sys/types.h
*/
f = (struct fd_set *)malloc(s*howmany(num_of_fds, s*8);
/*
* Use f wherever struct fd_set * is used.
* It can be used to test num_of_fds file descriptors.
*/
Maybe this comment in /usr/include/sys/_fd_macros.h
also may help?
/*
* FD_SETSIZE may be defined by the user, but must be >= u.u_highestfd + 1.
* Since we know the absolute limit for the number of per process open files is
* MAXFUPLIM, we need to define FD_SETSIZE to be large enough to accomodate
* this many file descriptors. Unless the user has this many files opened, he
* should redefine FD_SETSIZE to a smaller number.
*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2007 02:07 AM
04-20-2007 02:07 AM
Re: select and maxfiles e maxfiles_lim
~thanks