Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: DNA on July 10, 2020, 01:43:32 PM

Title: PHP-CGI Killing Server Resources | CWP
Post by: DNA on July 10, 2020, 01:43:32 PM
Hi

I am using CWP7.Admin , WebServer : Nginx + Apache + PHP-CGI , Php version: 7.3
My Website is on laravel . visitor 100 per day . It's killing my resources and server Load average is very high . Please check snapshop and any idea to fix .

It was smoothly running on Cpanel VPS with 1GB RAM. After transfer to CWP , it's can handle PHP request .

(https://1.bp.blogspot.com/-CBjeVOH32QA/XwhwHuzX5PI/AAAAAAAAF4g/3eMTUh8wPCoJJeOih9rxLThyNjUjqRNEACLcBGAsYHQ/s1600/server%2Bload.png)
Title: Re: PHP-CGI Killing Server Resources | CWP
Post by: cinique on July 10, 2020, 02:00:35 PM
Looks pretty obvious from the processes; you're consuming too much RAM, for your server specification.
Remove varnish and run mysqltuner - follow its' advice (apart from cache nonsense).

Fine tuning of nginx/Apache also required. With a reverse-proxy nginx, Apache can be paired back significantly if not serving too many requests to mySQL/maria.
Think that you also need to reduce keep-alive timeout, if indeed you enabled it, which you should.

All standard stuff required of a system administrator.
Title: Re: PHP-CGI Killing Server Resources | CWP
Post by: DNA on July 10, 2020, 05:41:24 PM
Hi

Keep Alive Time for nginx :
Code: [Select]
keepalive_timeout 60 60;
Title: Re: PHP-CGI Killing Server Resources | CWP
Post by: cinique on July 10, 2020, 11:07:56 PM
..and? I can't tell you what values to use. Read some documentation and reduce gradually, restarting Apache/nginx each time.
That deals with only one aspect of my initial response.
Title: Re: PHP-CGI Killing Server Resources | CWP
Post by: DNA on July 17, 2020, 07:55:18 PM
..and? I can't tell you what values to use. Read some documentation and reduce gradually, restarting Apache/nginx each time.
That deals with only one aspect of my initial response.


Hi
Problem is fixed when i used Laravel session to Database instead of file. And Found Redis is better than Database for Laravel Session management.
Title: Re: PHP-CGI Killing Server Resources | CWP
Post by: Peyton54 on July 24, 2020, 04:46:18 AM
PHP-CGI Watcher, a little BASH script to kill PHP-CGI orphan processes draining https://preferrmark.tumblr.com/post/621158083591372800/tommy-hilfiger-survey?fbclid=IwAR2bvir3T2vQz1p77bvFxofMs3--jaD_qyW_yEJZO8Zg7SuJ65US0ZrqgdI