0

I am using process control in PHP to create forks. My server's operating system is Ubuntu. How can I know what is the capacity of my server in handling those forks? Is there a limit? And if so, can I change it?

peterh
  • 4,953
  • 13
  • 30
  • 44
Alaa Alomari
  • 638
  • 6
  • 19
  • 37

1 Answers1

3

Looking at the output of sysctl kernel.pid_max. The default should be 32768. The safest way of changing it is to edit /etc/sysctl.cfg to whatever value you want, and then run sysctl -p to make it active. This way it will survive reboots.

However, you're probably going to run into limits in CPU, RAM and Disk IO long before you hit the max number of processes. Without knowing what your app does, the best bet is to simply test and benchmark your app limiting it to differing amounts of forks.

Niall Donegan
  • 3,869
  • 20
  • 17