New Review using NGINX on cPanel version 100

sahostking

Well-Known Member
May 15, 2012
403
29
78
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
I was always sceptical on switching to NGINX by cPanel and always had extremely slow scores when doing so when testing with Google PageSpeed Insights and GTMetrix

however this morning I decided to switch again and followed the following tutorial. Note I am using Apache MPM Event, NGINX Proxy and Lsapi as the handler

Never got scores higher than 96/100 with Litespeed but today we got 99/100 and a 1 second drop in load time.

We did the following.

Enabled HTTP2:

Procedure
To enable this globally, add a new file ending in .conf such as http2.conf to the Nginx configuration folder located in /etc/nginx/conf.d and add the following contents.



server {

listen 443 ssl http2;
listen [::]:443 ssl http2;

}


Save the file and verify the Nginx configuration. Then, restart Nginx as well as PHP-FPM.

nginx -t

/scripts/restartsrv_nginx ; /scripts/restartsrv_apache_php_fpm

Then Enabled Compression:

Edited:
/etc/nginx/nginx.conf

gzip on;
gzip_types text/plain text/css text/javascript text/xml image/x-icon image/svg+xml application/rss+xml application/javascript application/x-javascript application/xml application/xhtml+xml application/x-font application/x-font-truetype application/x-font-ttf application/x-font-otf application/x-font-opentype application/vnd.ms-fontobject font/ttf font/otf font/opentype;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;

Then restarted some services

/scripts/restartsrv_nginx
/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpm


And site got scored in Gtmetrix with A from C and a load speed of 1.4 to 2seconds compared to 2.8 and 4.1 in some instances.

Seems much better.

Will be monitoring it but so far no issues with wordpress plugins nor WHMCS and it dashboard feels better.

Will inform you guys if we notice any issues or a change. But so far so good.
 

bejbi

Well-Known Member
PartnerNOC
Jan 20, 2006
168
32
178
Poland
cPanel Access Level
DataCenter Provider
We did the same test:

manually added:

- http/2: works
- gzip: works (only problem with this is, when it is set - that all content has gzip by default, but in Apache it could be set in .htaccess to use gzip or not - in Nginix gzip is set or not for whole server - this is of course Nginix issue not cPanel)

but we noticed higher memory usage when http/2 is enabled (from about 6GB using http1.1 to 20-30GB using http/2) - but we not made many tests about this - did you noticed the same with memory ? or not?

We have many accounts on testing server (~600 cPanel accounts) on 40core dual Xeon, 192 GB DDR4 RAM, ssd


:wq
 

sahostking

Well-Known Member
May 15, 2012
403
29
78
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
We did notice a massive spike in comparison to Litespeed. Litespeed uses 60% of our memory whereas with nginx it gets to 90% and we did at one point have to restart Nginx

But other than that it seemed ok.

Will do more testing sometime. I am aware though even with Engintron we had high memory usage. So it is possible. Its just I don't think 20 to 30GB sounds reasonable when changing to http2.

Maybe monitor the /var/log/nginx/access.log file or /var/log/nginx/error.log file and see if u can spot anything strange there
 
  • Like
Reactions: cPanelAnthony