Traffic throttling has been created by Julien Vermillard (Aug 22, 2008).

Content:

One of point of failure of massive asynchronous server is out of memory on growing read or write queues.
The problem is separated in two case :

  • slow processing of incoming bytes (Read throttling)
  • too fast writing of the server, on slower clients (Write throttling)

Read

Not sure if the solution is ok, but here the way it's done in MINA 2.0 :
http://www.nabble.com/Dropping-traffic-throttling-from-2.0-td16092085.html

Write

Write is by far the hardest issue. It's occuring when you are sending too much data on slower clients (mainly slower network).

A good example is the way the problem is hitting Apache Diectory. When you do a somewhat big request (for example 2M bytes of result set), when the server write the result chunks, it can saturate the write queue and create an out-of-memory (OOM) error.

A solution could be to send the data, wait for session write queue to be depleted, than process the next result chunk, but here we go in a 1 thread blocking model for pocessing a client query.

Reply via email to