followup on my testings and some of my observations
in Avalon's ServerSocketAcceptor.run() method, when a
socket is returned from accept(), run() calls
handler.parseRequest(s). In James, the handler, James'
SMTPServer, will then create an SMTPHandler and let
the SMTPHandler does the actual dirty job of smtp
interaction. The SMTPHandler is excuted as a thread
from SMTPServer. This kind of design should perform
under decent load, but when I send 50
emails(concurrently) during a 10 second period to
James, James always loses some emails, and the loss is
around 20%-40%. What my test client got is a
connection refused error. i changed the ServerSocket's
backlog to 500, and still got similar results.
I then modified Avalon's ServerSocketAcceptor such
that whenever a socket is returned from accept(), i
will assign the socket and the handler (SMTPServer) to
a thread, and let the thread invoke
handler.parseRequest(). This way, the
ServerSocketAcceptor can quickly regain control and go
back to accept(). With such modifications, i am able
to make James to serve 50 emails within 10 seconds for
100% of the tests, and serve 50 emails within 5
seconds without loss for about 70% of the tests.
The comparison seems to tell me that the loss is at
least partly because the ServerSocketAcceptor cannot
return to accept() timely and thus client's connection
request is refused (but why doesn't the backlog
work?).
for james to be used in a day to day environment, it
may well encounter some peak load, and 50 emails
within 5 seconds do not seem to be a terribly heavy
one.
So is there any suggestion as how to improve the
performance/reliability or maybe it's simply that I am
missing something? Thanks.
--Y
--- Federico Barbieri <[EMAIL PROTECTED]> wrote:
> >
> > Dear gurus
> >
> > I was load testing James, and it choked when i
> have
> > 20 concurrent threads sending emails to James. I
> did a
> > little research, and the cause seems can be traced
> > back to the java.net.ServerSocket as by default it
> > only allows 50 sockets in the queue. ServerSocket
> > actually offers a couple of alternative
> constructors
> > that allows to change this number. Howerver, the
> > Avalon SocketServer implementation does not use
> the
> > other constructors. It would be nice if this
> number
> > can be configured thru the same james xml conf
> file.
> > Other than the code change, I am stuck with this
> > default value 50 (and btw, i havent figured out
> why
> > James fails at mere 20 concurrent threads).
> >
> > Any good suggestions? How can I make James able to
> > serve a decent amount of concurrent traffic?
> >
> > thanks
> >
> > --Ye
> >
>
> Actually right now it's quite a mess... the
> SocketServer is a block
> provided in the avalon dist but since the avalon cvs
> is under maior
> changes to patch it is quite a mess.
>
> Can you be patient for a week or so? :-)
>
> --
> Federico
> [EMAIL PROTECTED]
>
>
__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]