Thomas Harning wrote:
Hi,
Is there a way to tell the read-side of a Mina-session to slow down?
Example setup:
Socket ===> Speed Reducer -> Protocol Handler -> (Handler) Message
Processor
Message Processor may take a short while to finish processing messages
and sending responses and I want to be able to slow down the socket to
avoid pulling in too much data... depending on the data amount for
request/response, the data queue could get quite large... a 128-byte
request may end up prompting a multi-megabyte transfer... not quite
the thing I want many many to show up...
The way I see it could work out is that the Message Processor could
detect that there are too many outstanding messages (per session /
globally) and flag the speed reducer to slow down the read side.
Perhaps extra handling would go in to detect if some outstanding
responses are huge and wait until even more are completed before
resuming operation. Semaphores w/ counts being associated w/ x-amt of
resources seem to make sense... except that it would involve
blocking... not quite the way Mina works.
We had a ReadThrottleFilter, which was doing exactly that. It has been
removed, due to some problems . Here is the thread where we discussed
the reason why we had to removed it :
http://www.nabble.com/Dropping-traffic-throttling-from-2.0-td16092085.html
This thread also discuss about some alternatives.
Hope it helps
PS : This assumes that you are using MINA 2.0
I've looked at the executor-filter and its throttling mechanism, but I
cannot really understand /how/ it is slowing things down......
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org