简体   繁体   中英

How to set up php-fpm multithreading work?

php-fpm config :

  pm = dynamic 
  pm.max_children = 50 
  pm.start_servers = 20 
  pm.min_spare_servers = 10

and this is nginx config:

    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name _;
    location / {
            try_files $uri $uri/ =404;
    }
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

But When I send 50 requests at the same time, it is executed one by one.

在此处输入图片说明

在此处输入图片说明

This could be because of the sessions.

By default php store sessions in files and during request block this file, so next request can be started only after previous is finished.

Try to store sessions in memcache or database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM