Skip to content
This repository has been archived by the owner on Nov 14, 2019. It is now read-only.

why not use res but SIM_PACKETS at statsd.c? #56

Open
wy92 opened this issue Apr 19, 2017 · 5 comments
Open

why not use res but SIM_PACKETS at statsd.c? #56

wy92 opened this issue Apr 19, 2017 · 5 comments

Comments

@wy92
Copy link

wy92 commented Apr 19, 2017

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

@jeanpi
Copy link

jeanpi commented Jul 6, 2017

+1

@gleonid
Copy link

gleonid commented Jul 6, 2017

+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
Copy link

gleonid commented Jul 6, 2017

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);

@bascarsija
Copy link

note that this appears to be a duplicate of #42

@gleonid
Copy link

gleonid commented Dec 30, 2017

is there plans to apply above fix?

jentfoo pushed a commit to fullcontact/brubeck that referenced this issue Oct 17, 2018
This fixes an issue described here:
github#56

Without this change errors for lost packets are frequent, and gauge samples may be lost
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants