speed
Announcement
Collapse
No announcement yet.
mod_lsapi
Collapse
X
-
Hi,
Im 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, Im 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
4GB Ram
4 CPUs 2.8Ghz
SSD Disks
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?
http://pst.newedgedevelopment.com/assets/notcool.jpghttp://pst.newedgedevelopment.com/assets/cool.jpg
-
I will check the 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 its 0.09 to 0.15 or so when it runs fast.
But I will try a simple script to see
Comment
-
Here is the pictures of the benchmark from what is described above.
I will do the simple script in a few minutes.
http://pst.newedgedevelopment.com/assets/slow.jpghttp://pst.newedgedevelopment.com/assets/fast.jpg
Comment
-
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 want PHP processes to ever be killed for any user, set:
lsapi_backend_children 1
More info here: http://docs.cloudlinux.com/index.htm...mod_lsapi.html
Comment
-
Hi Igor,
This is what I figured. I just did this test and its 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 Id 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 have a lot of users. But too many would be a problem.
Pictures below
http://pst.newedgedevelopment.com/assets/slowtest.jpghttp://pst.newedgedevelopment.com/assets/fasttest.jpg
Comment
-
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 dont know in a big server how it could affect the stability.
Comment
Comment