Poor Initial Connect Time

XN-Matt

Well-Known Member
#1
Hi,

We're seeing some really poor initial connect times. Have tried all methods of PHP (using lsapi/PHP via cPanels repo and Easy Apache 4).

Subsequent loads are good, just the initial.

Have unrestricted the user in CL giving all CPU/Memory as needed but no change there either.

Any initial suggestions. Have reverted the PHP handler back to defaults for now.
 

NiteWave

Administrator
#2
we have received another user report: a wordpress site is slow to access for first time, but much faster for subsequent visits.
after investigating in Chrome browser, it's because of initial connection and SSL handshaking takes long time. after a http 2.0 connection set up, the website becomes much faster. this is mainly a network issue, not relating to php or web server. in this case, you can test a plain simple http page(non SSL), to see if it becomes much faster.
another factor may be the homepage size is big and take long time to generate. in this case, the web server may wait for backend php to generate the whole page and cause the slowness.
 

XN-Matt

Well-Known Member
#3
It does appear to be PHP related but having compared Nginx with PHP-FPM and Litespeed, we only see the issue with the latter.

I think I have correlated it to the PHP process having to start up and although have tried altering the settings to keep this "alive", it appears this does not work that well at all. Once the PHP process dies, it takes just as long on the next attempt (i.e set to 10 seconds, any requests after that will take just as long as the first).
 

XN-Matt

Well-Known Member
#5
Daemon mode has helped overall. First connection is lower, where as others are little higher.

Is there any benefit of having more Instances or increasing Max Idle Time in such mode?
 

XN-Matt

Well-Known Member
#7
Will play with that.

I note that in the docs it states that Deamon mode does not work with CloudLinux PHP selector. What about cPanel native PHP version control?
 
Top