David Schweikert wrote:

> On Fri, Jul 27, 2007 at 17:52:58 +0200, Mark Martinec wrote:
> > >    The problem is that even though I properly limited the number of
> > >    amavisd connections in amavisd-milter, amavisd does have a listen
> > >    backlog (queuing of connecting clients) of maximum 5 clients. That
> > >    is, if I have configured to use at most 10 amavisd processes and by
> > >    chance 6 amavisd-milter processes try to establish a connection
> > >    simultaneously, it will fail.
> >
> > I don't see why it would be 5. The program flow goes like:
> >
> > amavisd leaves Net::Server's option 'listen' at a default.
> >
> > Net::Server.pm turns undef into 128:
> >   $prop->{listen} = Socket::SOMAXCONN()
> >     unless defined($prop->{listen}) && $prop->{listen} =~ /^\d{1,3}$/;
>
> Funnily enough, Socket::SOMAXCONN() returns 5 on Solaris, but I am
> pretty sure that it is not the real limit. It probably comes from
> SOMAXCONN in /usr/include/sys/socket.h, but I don't think that it is the
> real limit. I have:
>
> [EMAIL PROTECTED]:~$ ndd /dev/tcp tcp_conn_req_max_q
> 1024
>
> Maybe Net::Server should be fixed instead? It probably would be even
> better to fix Socket::SOMAXCONN... I don't know if there is a faster way
> to find out the real SOMAXCONN than running ndd though. In the mean
> time, it would be nice however to have a $listen_queue_size option in
> Amavisd-new :-)

One catch there, which I'd call a Net::Server bug:

If one sets the $listen_queue_size to 1024 (as you say is a default on
Solaris), the Net::Server tests the value of a 'listen' option and sees
the number has more than three digits, and will silently give you the 
Socket::SOMAXCONN default, which is a 5 on Solaris!  Without a warning!

I think that Net::Server should:
- log a warning or call 'die' if the 'listen' option is invalid and
  is not a 0 or undef (or an empty string);
- allow values of up to 1024 at least;
- maybe even provide a more sensible default on Solaris, instead of
  a problematic Socket::SOMAXCONN;

I'm CCing this to Paul Seamons. I'd ask at least for a logged warning.
Btw, this thread is archived at: http://marc.info/?t=118553883800013&r=1

  Mark

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to