Re: Slow web site response..PHP-8/CSS/Apache/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



you need to share the basics of your configuration and incoming hits for people to get an idea of what you really have or could be the problem.

The way you describe it sounds like you have the typical quick to deploy but slow to scale combo: httpd with prefork mpm + mod_php plugin loaded.  

httpd with mpm_prefork + mod_php
SLOW: prefork uses processes as workers, spawning processes costs much more cpu than threads and prefork is a multiprocess model. In this setup ideally you have to "pre-spawn" lots of children processes to serve the amount of concurrent you expect. For each new hit over the defined amount of preloaded processes, httpd has to spawn a new one (if there are spare ones defined) and this costs much cpu. 

httpd with mpm_event -> php-fpm
FAST: event uses threads as workers which are much faster to spawn since they require less cpu. You can have thousands of worker threads with a few processes, example: 5 process * 1000 threads each = 5000 workers (5000 workers would sound crazy with prefork, but not with event). With this setup every request to a php file should be "proxied" with mod_proxy_fcgi to PHP-FPM, and there you would more clearly see if apache has a problem or it is the php backend. (PHP-FPM).

I suggest you visit the official httpd wiki :

https://cwiki.apache.org/confluence/display/httpd/PHP-FPM#PHPFPM-High-performancePHPonapachehttpd2.4.xusingmod_proxy_fcgiandphp-fpm.

And the official docs about mod_proxy_fcgi in the httpd site:
https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html

El jue, 23 jun 2022 a las 15:45, KK CHN (<kkchn.in@xxxxxxxxx>) escribió:
List,

I am facing a slow response for a hosted PHP8 web site..   It takes 30 seconds to load the website fully .  The application and database( postgresql ) both are separately running on two Virtual Machines in OpenStack cloud.  in two 10.184.x.221  and 10.184.y.221 networks respectively.



When I  used tools like  GTMetrix and Webpagetest.org   it says   there are render  blocking resources  

Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles.

Learn how to improve this

Resources that may be contributing to render-blocking include:

URL Transfer Size Download Time
 xxx.mysite.com/css/bootstrap.min.css   152KB 6.6s
xxx.mysite.com/css/style.css 14.2KB 5.9s
xxx.mysite.com/css/font/font.css  3.33KB  5.7s

here this bootstrap.css, which take  TTFB  6 seconds   and full loading of the website taking almost extra 24 seconds total  30 seconds to render it..

https://pastebin.mozilla.org/SX3Cyhpg


The GTmetrix.com site also  show  this  issue also

The Critical Request Chains below show you what resources are loaded with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load.

Learn how to improve this

Maximum critical path latency: 24.9s




How can I overcome this issue   ?  Is this a  VM performance issue or PHP issue ?/Apache issue ?    or PHP applicaiton to Database  backend connection issue..

Excuse me if this an off topic post to httpd list. Hope a lot of people might have their experience to share how to trouble shoot or what may the root cause making this site response too slow.

Kindly shed some light here.  Any hints where to start most welcome..

Any more data needed pls let me know ..I can share .

Thanks in advance,
Krish.


--
Daniel Ferradal
HTTPD Project
#httpd help at Libera.Chat

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux