Hey guys,

 

We would like to be able to stop reading traffic for ALL sessions when
the server is under heavy load. Instead of counting traffic of each
single session and stop reads for that session we need to do it in a
global way. That means that we are not interested in throttling a single
session but all of them.

 

I was checking the ReadThrottleFilterBuilder class to see how throttling
works and figure out ways to implement the "global throttling". I found
that the ReadThrottleFilterBuilder class sets a specific TrafficMask to
the session to stop or allow reading based on the amount of traffic for
that session.

 

I was planning to create something like a
GlobalReadThrottleFilterBuilder that would 1) consider traffic of all
active IoSessions and 2) change the TrafficMask to all sessions based on
#1. I then realized that accomplishing #2 in a highly concurrent
environment with a good performance is not possible by doing an
iteration on the IoSessions. Instead it would be nice if we could set
the *same TrafficMask instance* to all IoSessions and *change the
TrafficMask* to allow or disallow traffic. However, TrafficMask is not
meant to be modified but to be used as singletons. Therefore, the ideal
solution (IMHO) is not feasible unless we modify MINA to 1) use a
TrafficMask interface where you can have your own implementation or 2)
change the current TrafficMask class from using singletons to be
modifiable.

 

What do you think? Is there any other alternative that I missed? Would
you be fine if I make any of the above changes to MINA?

 

Thanks,

 

  -- Gato

Reply via email to