I\'m fairly new to cloudlinux so forgive me if this has been asked and answered.
While I noticed lsphp is pretty fast. I do notice it is not so fast on the first load of a page. For example if the website is inactive, and I load the site. I can have as much as 1second delay fr om http. Where if lsphp is running already this response is much faster between 150 to 350ms.
To weed out caching as a possibility I disabled php caching. While without caching the overall best speed is a little slower more like 300-450ms, it still has a long .9 to 1second initial load time. This can be viewed fr om a NET tree of a website in the first http response. It has a very long wait time.
Is this normal for lsphp?
The only reason I ran into it is, I\'m in the process of building a client website. I noticed pagespeed insights would jump from 76 on mobile to 89. All because of this slow response. Wh ere if I reload the page a couple of times, and run pagespeed insights within a few seconds of doing that. I get the 89 score. Otherwise it drops to 76.
Server is a VPS
4 CPUs 2.8Ghz
Pictures below, although showing different scores as I mentioned above. If the Reduce Server response time drops into the red over 0.6 or 0.7 then my score in these pictures will drop more.
Is there a setting to wh ere a user can be assigned at least 1 start up process?
Could their be other factors ? Does your script do database calls ? LSAPI helps mosting on the time required to launch a script. What times to you get on a simple PHP script containing just <?php echo \"hello world\" ?> ?
Yes I have my own custom CMS, although the database calls get cached so they all take 0.0001 seconds. I have benchmark tool, and the delay I am getting some of it shows on the loading of the base php classes however this is only about 0.15 seconds of the delay. The page load time for the site itself in benchmark is showing at most 0.3 seconds. Where it's 0.09 to 0.15 or so when it runs fast.
The issue is related to starting PHP process for the first time. After some time, if there is no requests - PHP process for user would be killed, and delay you see is due to (PHP process) being started (and all the extensions/php.ini files being loaded).
We have to kill PHP processes, as otherwise PHP processes would eat up all the memory.
If you have plenty of memory on the server, and don\'t want PHP processes to ever be killed for any user, set:
This is what I figured. I just did this test and it's clearly the start up time of the process. It' takes roughly 2 times longer to load the page.
I do have a question though. If a user has 10 or 15 processes running they will never die? Ideally I'd like each user on the system to just have 1 process idling and waiting (sleeping). Is this not possible?
I can handle each user to have 1 process as the server doesn't have a lot of users. But too many would be a problem.
Great thread. We are looking the same thing for our premium hosting packages with Cloudlinux. There was an option for mod_fcgi called minimum number of process. That solved the issue in a customer server but it only had a couple of cpanel accounts so i don't know in a big server how it could affect the stability.
There are no replies made for this post yet. Be one of the first to reply to this post!