mod_lsapi
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Shawn Purdy
  2. Thursday, 09 October 2014
  3.  Subscribe via email
speed
Rate this post:
  1. 09.10.2014 18:10:23
  2. # 1
Shawn Purdy Accepted Answer
Posts: 7
Joined: 09.10.2014
0
Votes
Undo
Hi,

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
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
  1. 10.10.2014 04:10:51
  2. # 2
Richard Hordern Accepted Answer
Posts: 219
Joined: 19.03.2011
0
Votes
Undo
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\" ?> ?
  1. 10.10.2014 16:10:34
  2. # 3
Shawn Purdy Accepted Answer
Posts: 7
Joined: 09.10.2014
0
Votes
Undo
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 it's 0.09 to 0.15  or so when it runs fast.

But I will try a simple script to see
  1. 10.10.2014 16:10:10
  2. # 4
Shawn Purdy Accepted Answer
Posts: 7
Joined: 09.10.2014
0
Votes
Undo
Here is the pictures of the benchmark from what is described above.

I will do the simple script in  a few minutes.

  1. 10.10.2014 16:10:20
  2. # 5
Igor Seletskiy Accepted Answer
Posts: 1200
Joined: 09.02.2010
0
Votes
Undo
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:

lsapi_backend_children 1
More info here: http://docs.cloudlinux.com/index.html?apache_mod_lsapi.html
  1. 10.10.2014 16:10:15
  2. # 6
Shawn Purdy Accepted Answer
Posts: 7
Joined: 09.10.2014
0
Votes
Undo
Hi Igor,

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.

Pictures below
  1. 10.10.2014 17:10:21
  2. # 7
Imagina Accepted Answer
Posts: 14
Joined: 24.10.2013
0
Votes
Undo
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.
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.