grobian / carbon-c-relay

Enhanced C implementation of Carbon relay, aggregator and rewriter
Apache License 2.0
380 stars 107 forks source link

Number of running workers #269

Closed Farfaday closed 7 years ago

Farfaday commented 7 years ago

Hi, i am running following command line, carbon-c-relay version 3.1, on a machine with 4 CPU cores : ./relay -f /etc/carbon-c-relay-replication.conf -H 'hydrogenguest3_b2_rz1_x_com_2013' -w 3 -q 2000000 -b 1500 -T 1200 -B 8 -p 2013 -c '-_:#.|' Got following output:

[2017-05-04 13:29:09] starting carbon-c-relay v3.1 (2017-05-04), pid=31423 configuration:
    relay hostname = hydrogenguest3_b2_rz1_xxx_com_2013
    listen port = 2013
    workers = 3
    send batch size = 1500
    server queue size = 2000000
    server max stalls = 4
    listen backlog = 8
    server connection IO timeout = 1200ms
    extra allowed characters = -_:#.|
    configuration = /etc/carbon-c-relay-replication.conf
    [...]
[2017-05-04 13:29:09] listening on tcp4 0.0.0.0 port 2013
[2017-05-04 13:29:09] listening on tcp6 :: port 2013
[2017-05-04 13:29:09] listening on udp4 0.0.0.0 port 2013
[2017-05-04 13:29:09] listening on udp6 :: port 2013
[2017-05-04 13:29:09] listening on UNIX socket /tmp/.s.carbon-c-relay.2013
[2017-05-04 13:29:09] starting 3 workers
[2017-05-04 13:29:09] starting aggregator
[2017-05-04 13:29:09] starting statistics collector
[2017-05-04 13:29:09] starting servers

^C     (-> pressed "control + c")

[2017-05-04 13:31:49] caught SIGINT
[2017-05-04 13:31:49] shutting down...
[2017-05-04 13:31:49] closed listeners for port 2013
[2017-05-04 13:31:49] shutting down internal:2013: waiting for 51 metrics
[2017-05-04 13:31:49] stopped collector
[2017-05-04 13:31:50] stopped aggregator
[2017-05-04 13:31:50] stopped worker 1 2 3 4
[2017-05-04 13:31:50] stopped servers
[2017-05-04 13:31:50] stopped carbon-c-relay v3.1 (2017-05-04)

[2017-05-04 13:31:50] stopped worker 1 2 3 4 -> why four here ? 3 requested !

htop shows 11 threads for the carbon-c-relay. Running the same with 4 workers shows 12 threads in htop Running the same with 8 workers shows 16 threads in htop

Thanks for your help ! François

grobian commented 7 years ago

for the number workers + 1, this is simply the listener thread that's on top of your dispatcher threads

for the htop numbers, each server is a separate thread as well