[hunchentoot-devel] turning off logging, and socket backlogs (patches included)

JTK jetmonk at gmail.com
Mon Mar 14 20:53:06 UTC 2011


[This is all in a recent bknr svn hunchentoot running on opencml and sbcl on
a mac 10.6]


1.  Logging:

I've been playing with running hunchentoot under heavy loads using
easy-acceptor,
and running against apache-bench (ab)

I noticed that logging to *error-output* often causes socket failures under
heavy
load, at least in SLIME.  Is there a reason why with-open-file-or-console in
log.lisp
couldn't use a NIL pathname to simply not log, and pathname=T would log
to *error-output*, which is what NIL presently means?   Now, there seems to
be no
way to turn off logging (besides subclassing acceptor).



2.  Backlog in listener:

I found that in the start-listening method in acceptor.lisp, there is no
BACKLOG
set for usocket:socket-listen.  I think that others have pointed this out as
well.
The default apache backlog seems to be 100 to 512
[1,2,3] though the default on a macintosh seems silently limited to 128 [4].
In the usocket
routines used by hunchentoot backlog seems to be only 5.    This seems
two orders of magnitude smaller than what is standard for web servers.

I tried putting in :BACKLOG 50 into the start-listening method in
acceptor.lisp
and it eliminated most failures of ab.  Is there any reason why acceptor
objects
shouldn't have a  new backlog slot default value in them much larger than
5,
which should be used in the  start-listening method?

The appended patches implement both changes, if these suggestions are judged
useful.
The backlog is 50.  I hope they're done correctly; I'm not experienced in
submitting patches.

John


[1]
http://groups.google.com/group/modwsgi/browse_thread/thread/b6d66d3fe5a53d2c
[2]
http://weblog.pigfoot.org/pigfoot/2007/07/05/whats-the-maximum-value-of-backlog-argument-in-listen2-system-call/
[3] /usr/include/apache2/mpm_common.h:#define DEFAULT_LISTENBACKLOG 511
[4]
http://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man2/listen.2.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20110314/8aff4a4d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acceptor.lisp.diff
Type: application/octet-stream
Size: 2539 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20110314/8aff4a4d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.lisp.diff
Type: application/octet-stream
Size: 2715 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20110314/8aff4a4d/attachment-0001.obj>


More information about the Tbnl-devel mailing list