Closed kroepke closed 8 years ago
@kroepke What will happen if there are more operations queueing than maxInflightSends
allows?
@joschi It will eventually block the sender code if it used the .send()
method. If the sender code doesn't care it should use trySend()
.
The GELF sender thread is single-threaded anyway, the limit mostly exists to protect against writing to the Channel
without bounds, as it is almost always writable.
Writing 2 million messages:
After change:
Before change:
The significant impact, other than memory usage, is the GC times: After:
Before:
LGTM :+1:
Without limiting netty would happily create more and more internal buffers, using large amounts of memory. That memory pressure could lead to OOM situations or very high GC times when faced with either fast producers or slow consumers (or worst case both).
The number of maximum inflight sends is configurable and by default limited to 512 operations.
fixes #22