Increasing the number of nginx worker connections
By default, each nginx worker process can open a maximum of 1024 simultaneous connections. You might need to increase the number of simultaneous connections for the worker processes if you encounter performance issues.
Ensure that you source the environment variables before you run the commands in this task.
Symptoms
When nginx worker processes need more connections, the nginx pods include the following error:
1024 worker_connections are not enough
Causes
At least one nginx worker process needs more than 1024 connections.
Diagnosing the problem
Run the following command to determine whether you need to adjust the number of worker connections:
oc logs -n ${PROJECT_CPD_INST_OPERANDS} -l=component=ibm-nginx | grep "worker_connections are not enough"
If the command returns one or more responses with worker_connections are not enough, proceed to Resolving the problem.
Resolving the problem
You must be either:
- A cluster administrator
- An instance administrator
To increase the number of nginx worker connections:
- Log in to Red Hat®
OpenShift® Container Platform as a user with sufficient permissions to
complete the
task.
${OC_LOGIN}
- Set the
WORKER_CONNECTIONS
environment variable to the number of simultaneous connections to allow:export WORKER_CONNECTIONS=<number-of-connections>
- Run the following command to change the number of worker
connections:
oc patch configmap product-configmap \ --namespace ${PROJECT_CPD_INST_OPERANDS} \ --type=merge \ --patch "{\"data\": {\"GATEWAY_WORKER_CONNECTIONS\":\"${WORKER_CONNECTIONS}\"}}"
- Restart the
ibm-nginix
deployments:oc rollout restart deployment/ibm-nginx \ --namespace ${PROJECT_CPD_INST_OPERANDS}