Mantis - Resin
Viewing Issue Advanced Details
2924 minor always 09-11-08 10:51 10-02-08 12:13
ferg  
ferg  
urgent  
closed 3.1.7  
fixed  
none    
none 3.2.1  
0002924: comet issues
(rep by Martin Thompson)

As a result of our soak and performance testing we have discovered a number of issues with the Resin Comet implementation. I've tried to isolate the problems and produced some example code that demonstrates the issues discovered.

1. If we use the CometServlet in a long poll fashion (http://en.wikipedia.org/wiki/Comet_(programming)#Ajax_with_long_polling) [^] even on a fast machine we can only get about 90 requests per second and very high latencies suggesting the overhead of the session setup is high.

2. If the comet is used in streaming mode and the client goes away, with or without closing the socket connection, the CometController.isClosed() always returns false so there is no way to detect that client is gone. If wake is called which schedules a resume the server can continue indefinitely sending data to a client that is no longer there. This also seems to keep the session alive wasting resources.

3. The destroy methods for webbeans or servlets are not called on a clean system shutdown which prevents us from doing an orderly shutdown.


The performance of the Long Poll can be seen benchmarked against a simple in memory async implementation and the streaming version. On my laptop I'm getting:

    In-memory: 250K ops per second
    Streaming: 18K ops per second
    Long Poll: 90 ops per second

I've tried various threading configurations and can't get the long poll version to any respectable numbers. The attached project can be unzipped and run from a simple Ant script supplied.


Notes
(0003484)
ferg   
10-02-08 12:13   
server/1l21