peku33
peku33

Reputation: 3903

Is pm.max_children in php-fpm equal to the maximum number of parallel downloads?

I'm preparing a web server (gentoo linux, nginx, php-fpm, php) for my website. During configuration I came to pm.max_children value in fpm config. The default is 50. If I plan to serve some big files with php, would each client block whole thread during the download? What will happen to 51st client trying to open the website / start download?

According to what I've read - one child = one thread. If I run my server on let's say quad core newest series xeon cpu with 32GB ddr3 - how many clients or threads could the cpu / system survive?

Is there any limit in linux of maximum open sockets / threads / processes? Os is gentoo amd64 (fresh installation), nginx 1.4.0, php-5.4

Thanks for your help.

Upvotes: 1

Views: 1231

Answers (1)

user1600649
user1600649

Reputation:

If you stream your files via php, then yes, each download will be a php process. This is also why it's a bad idea to do so. Php should be used to process data into a comprehensible webpage. Serving files is for a webserver. Perhaps you can rewrite your application to generate unique files and then redirect to that location and have the webserver handle it. The number of open sockets is configured via limits on a per process basis. Sockets count towards the number of open files.

Upvotes: 1

Related Questions