fooinha/nginx-json-log

New socket create per request ?

Monkey-D-Groot opened this issue · 1 comments

Does new socket connect to kafka broker create per request ?

No, each nginx worker keeps a persistent connection with kafka broker

/usr/local/nginx/conf # ps auxfwww | grep nginx
    1 root      0:00 nginx: master process /usr/local/nginx/sbin/nginx
    6 nobody    0:00 nginx: worker process
    7 nobody    0:00 nginx: worker process
    8 nobody    0:00 nginx: worker process
    9 nobody    0:00 nginx: worker process
   38 root      0:00 grep nginx

/usr/local/nginx/conf # netstat -t
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 nginx:49746             nginx-json-kafka:9092   ESTABLISHED
tcp        0      0 nginx:49744             nginx-json-kafka:9092   ESTABLISHED
tcp        0      0 nginx:49742             nginx-json-kafka:9092   ESTABLISHED
tcp        0      0 nginx:49748             nginx-json-kafka:9092   ESTABLISHED