Scaling up worker_connections of the apps pushed with nginx buildpack
search cancel

Scaling up worker_connections of the apps pushed with nginx buildpack

book

Article ID: 406666

calendar_today

Updated On:

Products

VMware Tanzu Platform - Cloud Foundry

Issue/Introduction

Apps pushed with nginx buildpack might report this error message — “4096 worker_connections are not enough”. This means NGINX has hit the limit on how many simultaneous connections it can handle per worker process. 

Cause

What it means

  • worker_connections defines the maximum number of simultaneous connections each worker process can handle.

  • If your app is under heavy load (e.g. many clients, keep-alive connections, WebSocket sessions), you may exceed this limit.

 

Resolution

The worker_connections value can be increased in the NGINX configuration nginx.conf, which is inside the root directory of your source code.

da##dz@Y####QK % tree
.
├── manifest.yml
├── nginx.conf
└── public
    └── index.html

2 directories, 3 files

Find the events block and increase the value of worker_connections:

events {
    worker_connections 8192;
}

Once it is done, restage the updated source code by "cf push".