Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @rohirnaik44,
I bet that if you check dmesg you’ll see some errors about php-fpm, is that correct?
Such errors usually occurs when server is running out of resources, assuming that you’re running most recent stable versions of php and php-fpm.
Check there’s enough space on the disk Make sure to check the open file limits on the server. You’re interested especially in the hard limit (-Hn):
$ ulimit -Hn
4096
$ ulimit -Sn
1024
Check number of currently opened file descriptors on the server:
sysctl fs.file-nr
fs.file-nr = 1440 0 790328
Modern servers are capable of handling many files, usually ulimits are set to unnecessary low values.
Then check nginx.conf, at the beginning there’s something like:
worker_processes 4;
events {
worker_connections 1024;
}
If you’re proxying request for each connection you’d need 2 file handles. Which means that in case of many connections you’d reach the limit quite quickly.
nginx has a worker_rlimit_nofile directive for restricting opened files per worker process (top level directive like worker_processes 4;):
worker_rlimit_nofile 1024;
Just do the math and calculate how many opened file descriptors you’d need when all connections are used (a bit extreme case). Also consider all other services running on that server.
Regards, KDSys