Working of worker process

183 views
Skip to first unread message

vidurmal...@gmail.com

unread,
Nov 28, 2017, 4:01:08 AM11/28/17
to Kong
I want to understand how exactly the worker process works. In Kong, we have no of worker processes set to auto. But we are getting the below error in the logs. We are sending not very high load. We are just firing 5000 requests in 5 min

512 worker_connections are not enough

As far as I understand, nginx works on event driven model. How come that 512 worker connections are not enough. Also, is there an upper limit on no of connections that can be opened in auto mode? Can I tweak the configuration and configure the no of worker processes to be 1000 or more?


Thibault Charbonnier

unread,
Nov 28, 2017, 1:28:05 PM11/28/17
to kong...@googlegroups.com
Hi,

worker_connections isn't related to worker_processes. worker_connections
is the number of allowed opened connections _per_ worker process.

As per the NGINX docs
(https://nginx.org/en/docs/ngx_core_module.html#worker_connections):

> Sets the maximum number of simultaneous connections that can be
opened by a worker process.

And also from this document, note:

> It should be kept in mind that this number includes all connections
(e.g. connections with proxied servers, among others), not only
connections with clients. Another consideration is that the actual
number of simultaneous connections cannot exceed the current limit on
the maximum number of open files, which can be changed by
worker_rlimit_nofile.

Kong will inject the result of 'ulimit -n' in both worker_connections
and worker_rlimit_nofile. If you want to allow your worker processes to
open more connections, we recommend that you increase your system
resource limits with 'ulimit -n N' where N is the number of file
descriptor you are allowing your user's processes to open.

> Can I tweak the configuration and configure the no of worker
processes to be 1000 or more?

I would definitely not recommend doing that.

--
Thibault
> --
> You received this message because you are subscribed to the Google
> Groups "Kong" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to konglayer+...@googlegroups.com
> <mailto:konglayer+...@googlegroups.com>.
> To post to this group, send email to kong...@googlegroups.com
> <mailto:kong...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/konglayer.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/konglayer/9de81b8b-e44d-41a4-bebe-2d3033e56f05%40googlegroups.com
> <https://groups.google.com/d/msgid/konglayer/9de81b8b-e44d-41a4-bebe-2d3033e56f05%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages