Hi,
I posted the quoted message below on the tomcat-user list (along with a longer version
with a lot more details), and from the replies I received it seems like my problem is
related to the use of servlets derived from GenericServlet instead of HttpServlet.
The (game) server we are developing communicates with a number (~10-100) of clients
(applets) using raw byte-encoded messages, sent by reading/writing to
InputStreams/OutputStreams. If I understand correctly, because our servlet is not
using HttpServlet but GenericServlet, the data transmitted between the server and the
clients is not encapsulated into HTTP requests, in other words, we are not using HTTP
protocol.
Is it true that because we are using GenericServlet, the communication between server
and clients is not reliable? We are experiencing connections to clients being dropped,
but only with clients on slow connections. It seems like these clients' internal state
sometimes get mangled or something, causing the message polling threads to block/crash
or responses sent to clients are never received.
Would this communication be reliable if we were using HttpServlet instead? From
replies in the tomcat-user list I get the impression that in this case it wouldn't be
possible to use InputStreams and Outputstreams to send and receive data, and that
encapsulating everything into HTTP requests would hurt performance badly because of
the high volume of small requests to the same servlet, and that solid connection
tracking would still be difficult to implement. Would it help to set Keep-Alive on the
connection, without this having impact on the reponse times when ~50 clients are
logged in, generating up to 100 but probably ~200 requests/second to the same servlet.
For the user experience of the client applets, response times should at be around
1000ms max, but preferably below 500ms.
Is it even fair to expect this kind of performance from Tomcat? Bypassing HttpServlet
at all seems a bit like abusing the Tomcat server, considering the fact that it was
made for web applications, not for game servers.
Wouter Bijlsma
[EMAIL PROTECTED]
> -----Original Message-----
> From: Wouter Bijlsma [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 21, 2003 11:01 AM
> To: [EMAIL PROTECTED]
> Subject: Connection drops with tomcat-based game server (very short
> version)
>
>
> Is it possible that tomcat sometimes randomly kills a
> request, does not process a request or queues a request
> indefinitely, thereby blocking a client that tries to read
> back the response to its request? Could this be possible when
> a servlet communicates with the clients using only raw data
> and InputStreams/OutputStreams? And: is it a good idea to
> develop a game server for playing games like chess, chequers
> or draughts with tomcat, considering the fact that tomcats
> main purpose is to act as web application server using a
> strict request-response paradigm. Is it safe to assume that
> every request made by a client always yields a proper
> response, also when using raw data transfers? Also when
> there's a really high volume of requests to a single servlet?
>
> Don't get me wrong: I do *not* think there's something wrong
> with tomcat! As a matter of fact I have really good
> experiences with it using it for web applications!!
>
> Kind Regards,
>
> Wouter Bijlsma,
> [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]