-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch multiple updates into single UDP packet #15
Comments
I agree, this does deserve its own issue. I'm not sure whether it is sensible to implement multiple-message-sending without examining the consequences quite carefully. At present, the java-statsd-client pays no attention to the MTU and assumes that each individual message falls well within it. Enhancing the library to support sending multiple messages at once would definitely require it to consider the MTU. Arguably it should do this anyway. Furthermore, I'm not sure what the best API to support multiple updates would be -- should it automatically batch up messages and send them in frequent bursts, or should that decision be pushed to the callers, by changing the API to allow multiple messages of the same type to be sent in a single call (e.g. Perhaps you have some examples of situations in which matching multiple updates would be appropriate? |
"automatically batch up messages" sounds a good option. It will reduce the traffic and communication overhead between application and the server. |
The trouble with batching up messages is that it introduces complexity and immediately poses a number of questions:
Answering these, and working out how batching might work generally, is going to take some careful consideration. I'd be delighted to hear your thoughts. |
this has been implemented in finn-no@5d34f15#diff-d41d8cd98f00b204e9800998ecf8427e (as well as also upgrading to NIO). we've been using this in production at Norway's busiest website for 5 months now. Addressing your questions:
In finn-no@5d34f15 In finn-no@5b0e893#diff-d41d8cd98f00b204e9800998ecf8427e
The sending of messages is not delayed. In fact arrival time will be sooner rather than later.
We don't use sampling so i can't say for sure. But i can't see how sampling rates are effected.
There is no "batch" in-memory. When we put this into production we saw the UDP packet loss drop dramatically. |
Thanks for your comment @michaelsembwever -- I can see how this would work now, which brings me a step closer to implementing something. |
…tching implementations for issue #15
any plan to move even closer to do multiple metrics sending? |
This was briefly mentioned in #5 but deserves its own issue, I think.
The text was updated successfully, but these errors were encountered: