brubeck icon indicating copy to clipboard operation
brubeck copied to clipboard

why not use res but SIM_PACKETS at statsd.c?

Open wy92 opened this issue 8 years ago • 5 comments

https://github.com/github/brubeck/blob/master/src/samplers/statsd.c#L56 for (i = 0; i < SIM_PACKETS; ++i) {

wy92 avatar Apr 19 '17 06:04 wy92

+1

jeanpi avatar Jul 06 '17 22:07 jeanpi

+1

we are running brubeck on Ubuntu 14.04.

used config: "samplers" : [ { "type" : "statsd", "address" : "0.0.0.0", "port" : 8126, "workers" : 4, "multisock" : true, "multimsg" : 8 } note value for multimsg.

Had our log filled with: instance=brubeck sampler=statsd event=packet_dropped

After we changed multimsg from 8 to 1 - errors stopped

gleonid avatar Jul 06 '17 22:07 gleonid

please consider following code change as a fix to src/samplers/statsd.c:

@@ -51,9 +51,9 @@ static void statsd_run_recvmmsg(struct brubeck_statsd *statsd, int sock)
                }

                /* store stats */
-               brubeck_atomic_add(&statsd->sampler.inflow, SIM_PACKETS);
+               brubeck_atomic_add(&statsd->sampler.inflow, res);

-               for (i = 0; i < SIM_PACKETS; ++i) {
+               for (i = 0; i < res; ++i) {
                        char *buf = msgs[i].msg_hdr.msg_iov->iov_base;
                        char *end = buf + msgs[i].msg_len;
                        brubeck_statsd_packet_parse(server, buf, end);

gleonid avatar Jul 06 '17 23:07 gleonid

note that this appears to be a duplicate of #42

bascarsija avatar Dec 28 '17 19:12 bascarsija

is there plans to apply above fix?

gleonid avatar Dec 30 '17 17:12 gleonid