Think about Netty backpressure #37

Open
opened 4 years ago by gpe · 0 comments
gpe commented 4 years ago
Owner

I've got the following ideas:

  • Disable auto-read - only call read() when the size of the message queue has decreased or upon channelReadComplete() (if the message queue has space).
    • We can do this even on the ServerChannel, where read really means accept. Of course, this would be based on the number of clients rather than message queue size.
  • Configure low/high write watermark to sensible values and check if isWritable() is false before doing a write.
    • For game clients we'd need to disconnect the player (as the client can't cope with lost packets).
    • Use FileRegion and ChunkedWriteHandler/ChunkedInput for JAGGRAB and ondemand respectively, which automatically handle backpressure. (Does this allow parallel ondemand requests? Do we need to support those?)

Obviously we should also think about limiting number of connections per IP, throttling bandwidth usage, etc.

I've got the following ideas: * Disable auto-read - only call `read()` when the size of the message queue has decreased or upon `channelReadComplete()` (if the message queue has space). * We can do this even on the `ServerChannel`, where read really means accept. Of course, this would be based on the number of clients rather than message queue size. * Configure low/high write watermark to sensible values and check if `isWritable()` is `false` before doing a write. * For game clients we'd need to disconnect the player (as the client can't cope with lost packets). * Use `FileRegion` and `ChunkedWriteHandler`/`ChunkedInput` for JAGGRAB and ondemand respectively, which automatically handle backpressure. (Does this allow parallel ondemand requests? Do we need to support those?) Obviously we should also think about limiting number of connections per IP, throttling bandwidth usage, etc.
gpe added the
research
label 4 years ago
Sign in to join this conversation.
Loading…
There is no content yet.