tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: maximum number of open files in Tru64 v5.1a
@ 2006-09-20 12:05 Reed, Judith
  0 siblings, 0 replies; only message in thread
From: Reed, Judith @ 2006-09-20 12:05 UTC (permalink / raw)


I asked about the maximum number of files a process can open, since
performance tuning docs indicate that 4096 is the max you can set with
open_max_hard. I got a number of responses, thanks to all who replied. 

It seems that this is indeed the highest you can set in
/etc/sysconfigtab.
You can, however, open up to 65536 files by a single process under
program control - it just can't be set as a system-wide limit by the
admin.

Whitney Latta pointed to the "setsysinfo(2)" man page, specifically the
section covering SSI_FD_NEWMAX options. 

James Sainsbury tried writing a wrapper to transfer the higher limit to
the wrapper program, and found that the forked subprocess did inherit
the higher limit.

Jean-marc Vincent pointed out the "sysconfig -Q" option, which shows the
max_val for a parameter, useful option to know. 

#  sysconfig -Q proc open_max_hard
proc:
open_max_hard -         type=INT op=CQ min_val=0 max_val=4096

Armin Ollig pointed to the man page for "sys_attrs_proc", check out the
reference for "open_max_hard" in there - it says the maximum value for
"open_max_hard" is 65,536! That is either incredibly misleading, or
false, or I'm still missing something. We tried raising the value for
this param (and "open_max_soft") above 4096 and rebooting, but you still
couldn't raise the process limit in any normal way (ie ulimit) above
4096. 

Scott passed along a piece of code which demonstrates raising the limit.

------------------------------------------------------------------
  #include <sys/resource.h>
  #include <sys/sysinfo.h>
  #include <sys/param.h>
  
  main()
  {
      struct rlimit rlimit;
  
      /* increase the fd limit */
      rlimit.rlim_cur = rlimit.rlim_max = NEW_OPEN_MAX_SYSTEM;
      if (setsysinfo(SSI_FD_NEWMAX, NULL, 0, NULL, 1)
      || setrlimit(RLIMIT_NOFILE, &rlimit)) {
          perror("failed to increase fd limit");
          exit(1);
      }
      printf ("getdtablesize = %d\n", getdtablesize());
  }
------------------------------------------------------------------
Thanks very much to everyone who replied!

Judith Reed



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-20 12:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-20 12:05 SUMMARY: maximum number of open files in Tru64 v5.1a Reed, Judith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox