Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

[HowTo] Optimize Nginx and PHP-FPM using VestaCP on CentOS

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
xorro
Posts: 87
Joined: Sun Nov 13, 2016 3:11 pm
Contact:
Contact xorro
Website Skype

Os: CentOS 6x
Web: apache + nginx
[HowTo] Optimize Nginx and PHP-FPM using VestaCP on CentOS
  • Quote

Post by xorro » Tue Sep 11, 2018 7:25 pm

NGINX

Nginx configs are by default located under at /etc/nginx :

Edit Nginx Config :

Code: Select all

nano /etc/nginx/nginx.conf
First :

Once you open the file for edit you need to change this “worker_rlimit_nofile” value :
From :

Code: Select all

#worker_rlimit_nofile    65535;
To :

Code: Select all

worker_rlimit_nofile    65535;
uncomment the line remove “#”

*Value “65535” can be different on your server

Second :

find the “worker_connections” :

From:

Code: Select all

worker_connections 1024;
To :

Code: Select all

worker_connections 5000;
Once you changed this value restart nginx service :

Code: Select all

service nginx restart
PHP-FPM

By default php-fpm configs are by default located under at /etc/php-fpm.d

when you navigate to this dir you’ll find bunch of configs (domain.com.conf) are located under this dir open the config file for your website and change the value :

open your website domain name config file :

Code: Select all

cd /etc/php-fpm.d
nano your-website-name.com.conf
And change this Values :-

From :

Code: Select all

pm.max_children = 4
pm.max_requests = 4000
To :

Code: Select all

pm.max_children = 10
pm.max_requests = 6000
once you saved the config restart PHP-FPM service :

Code: Select all

service php-fpm restart
This are the optimal settings which can handle 2000-3000 real time visitor according to your server config very easily even more.
Top

mlopez
Posts: 21
Joined: Mon Nov 05, 2018 7:26 am
Contact:
Contact mlopez
Website Twitter

Os: CentOS 6x
Web: apache + nginx
Re: [HowTo] Optimize Nginx and PHP-FPM using VestaCP on CentOS
  • Quote

Post by mlopez » Sun Aug 25, 2019 1:06 pm

Is it just when one uses only nginx or it also work for nginx + apache?
What are the RAM and CPU config for this values?

Thank you, xorro!
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password