directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Burmester <>
Subject Re: Suggestions on implementing timeouts?
Date Tue, 19 Jul 2005 16:40:58 GMT
My server has to keep incomming connections open to a third party
and route multiple messages over the same channel using transaction ids 
to keep track of which messages are outstanding.  I need a way to time out 
these transactions.  Currently every half second I scan my outstanding 
message queues and remove any messages that are older than the timeout. My 
issue with this is that the cleanup method has to lock the whole complex 
datastructure of connections and outstanding messages during the scan.  
Doesn't seem to be a problem yet but I'm concerned that under higher load it 
will become the main bottleneck.  I was thinking about putting in an event 
queue and firing timeout events for each message but I'm not sure if the overhead 
of registering and deregistering each timeout event for each successful 
message is worth it.  Just wondering if there is a pattern that I'm not 
thinking of that gets around these issues.



On Tue, 19 Jul 2005, Trustin Lee wrote:

> Hi Alex,
> MINA supports reader/writer idleness detection and write timeout out of the 
> box. Please take a look at IoSessionConfig and SocketSessionConfig and let 
> us know if those configuration parameters are not sufficient.
> Trustin

View raw message