From: <do...@us...> - 2004-11-15 16:14:20
|
Update of /cvsroot/aolserver/aolserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27943/nsd Modified Files: nsmain.c Log Message: AOLserver will now allow setting the fd limit (via "ulimit -Hn", etc.) and only log a warning if it exceeds FD_SETSIZE. Do this at your own risk, as things which still use select(), i.e., Tcl, are likely to break. Index: nsmain.c =================================================================== RCS file: /cvsroot/aolserver/aolserver/nsd/nsmain.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** nsmain.c 6 Oct 2004 18:50:29 -0000 1.59 --- nsmain.c 15 Nov 2004 16:14:10 -0000 1.60 *************** *** 300,310 **** /* ! * AOLserver uses select() extensively so adjust the open file ! * limit to be no greater than FD_SETSIZE on Unix. It's possible ! * you could define FD_SETSIZE to a larger value and recompile but ! * this has not been verified. Note also that on some platforms ! * (e.g., Solaris, SGI o32) you're still left with the hardcoded ! * limit of 255 open streams due to the definition of the FILE ! * structure with an unsigned char member for the file descriptor. * Note this limit must be set now to ensure it's inherited by * all future threads on certain platforms such as Linux. --- 300,308 ---- /* ! * AOLserver now uses poll() but Tcl and other components may ! * still use select() which will likely break when fd's exceed ! * FD_SETSIZE. We now allow setting the fd limit above FD_SETSIZE, ! * but do so at your own risk. ! * * Note this limit must be set now to ensure it's inherited by * all future threads on certain platforms such as Linux. *************** *** 315,321 **** strerror(errno)); } else { - if (rl.rlim_max > FD_SETSIZE) { - rl.rlim_max = FD_SETSIZE; - } if (rl.rlim_cur != rl.rlim_max) { rl.rlim_cur = rl.rlim_max; --- 313,316 ---- *************** *** 558,566 **** if (getrlimit(RLIMIT_NOFILE, &rl) != 0) { Ns_Log(Warning, "nsmain: " ! "getrlimit(RLIMIT_NOFILE) failed: '%s'", strerror(errno)); } else { Ns_Log(Notice, "nsmain: " "max files: FD_SETSIZE = %d, rl_cur = %d, rl_max = %d", FD_SETSIZE, rl.rlim_cur, rl.rlim_max); } --- 553,564 ---- if (getrlimit(RLIMIT_NOFILE, &rl) != 0) { Ns_Log(Warning, "nsmain: " ! "getrlimit(RLIMIT_NOFILE) failed: '%s'", strerror(errno)); } else { Ns_Log(Notice, "nsmain: " "max files: FD_SETSIZE = %d, rl_cur = %d, rl_max = %d", FD_SETSIZE, rl.rlim_cur, rl.rlim_max); + if (rl.rlim_max > FD_SETSIZE) { + Ns_Log(Warning, "nsmain: rl_max > FD_SETSIZE"); + } } |