LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Initial page load slow compared to Apache+mod_php?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2009, 08:28 AM
Sindre Sindre is offline
Member
 
Join Date: Dec 2008
Posts: 31
Default Initial page load slow compared to Apache+mod_php?

Hello,

I am doing some tests with LSWS and the PHP LSAPI. From my experience, it takes a bit longer before a page is served on the first access compared to Apache with mod_php. I was under the impression that the LSAPI should be even faster than Apache+mod_php? The site is an eCommerce store based on Magento Commerce (heavy PHP/MySQL). After the first load, subsequent accesses are handled very fast, so this is bugging me a bit. I really like LiteSpeed.

Are there some settings in the admin I can tune to speed up the inital page loading time?

I already have enabled the "Run On Start Up" option for the lsphp5 ext. appl and set "Instances" to 1. Does the "priority" setting or "response buffering" have any effect?

I am running LiteSpeed Enterprise 1-core on a Intel QuadCore system, which should leave 3 cores for PHP and MySQL processing.

Thank you for your advise!
Reply With Quote
  #2  
Old 01-19-2009, 06:47 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Are you using cPanel + LiteSpeed? are you using PHP suEXEC? Are you using a VPS? PHP opcode cache? It should be fast no matter what.
Reply With Quote
  #3  
Old 01-19-2009, 09:25 AM
Sindre Sindre is offline
Member
 
Join Date: Dec 2008
Posts: 31
Quote:
Originally Posted by mistwang View Post
Are you using cPanel + LiteSpeed? are you using PHP suEXEC? Are you using a VPS? PHP opcode cache? It should be fast no matter what.
I'm using LiteSpeed with cPanel (Apache replacement) and suEXEC enabled. I have ionCube, eAccelerator and Suhosin loaded with PHP, and also the "Mail Header (Identifies Mail Source)" extension was checked when compiling PHP.

It is a dedicated server, Quad-Core Q6600 CPU with 4GB RAM.

I have the 1-core license. Does this mean that lsphp5 (the external app) will only use 1 core, or is it just static content that will be affected by the 1-core limit?
Reply With Quote
  #4  
Old 01-19-2009, 09:28 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Try the "Building Matching PHP" function in our WHM plugin. 1-core license only affect static content.
Reply With Quote
  #5  
Old 01-19-2009, 09:32 AM
Tony Tony is offline
Senior Member
 
Join Date: Dec 2008
Posts: 133
What priority are you running php at? I've changed mine to -5 as I found the default did not give enough priorty -5 made it equivalent to my previous suPHP setup's priority for PHP.
Reply With Quote
  #6  
Old 01-19-2009, 10:07 AM
Sindre Sindre is offline
Member
 
Join Date: Dec 2008
Posts: 31
Quote:
Originally Posted by Tony View Post
What priority are you running php at? I've changed mine to -5 as I found the default did not give enough priorty -5 made it equivalent to my previous suPHP setup's priority for PHP.
The priority is set to default (1). At least that is what cPanel -> "Show Current CPU Usage" reports for lsphp5.
Reply With Quote
  #7  
Old 01-19-2009, 01:22 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Is this for shared hosting, or dedicate for one or a few large web sites?
How slow is the first request?
It may be a network problem.
Reply With Quote
  #8  
Old 01-19-2009, 01:41 PM
Sindre Sindre is offline
Member
 
Join Date: Dec 2008
Posts: 31
Quote:
Originally Posted by mistwang View Post
Is this for shared hosting, or dedicate for one or a few large web sites?
How slow is the first request?
It may be a network problem.
I doubt it is a network problem. The server is in DedicatedNow (FortressITX) data center, which has a very reliable network. It is shared hosting (about 50) PHP/MySQL intensive ecommerce sites.

E.g. if I have not accessed a particular site in some hours (over the night), it can take up to 3 seconds where it just "hangs", then the whole page is loaded at once. Subsequent requests are near instant. Could it be related to the eAccelerator opcode cache?
Reply With Quote
  #9  
Old 01-19-2009, 01:53 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
I think it may be the browser. Some browser can only render certain web page all at once after all embedded elements has been received, image, css, js, etc.
Other browser maybe do better, try different browser, like IE, FF, Opera, etc.

For subsequent requests, the images, css, js have been cached, so once the main page html has been received, the page can show up.

You can check the loading speed with FireBug and find the request that takes long time to complete.
Reply With Quote
  #10  
Old 04-28-2009, 08:27 AM
txyoji txyoji is offline
New Member
 
Join Date: Apr 2009
Posts: 1
The behavior you describe sounds like your using the cgi module for php.
This site - http://www.ohloh.net/p/php-lsapi
explains that the litespeed module is configurable in admin panel and is very similar to the fast cgi module.

Look for a setting in your litespeed server that will keep a couple of php processes hot or perhaps a cron job to wget the page at regular intervals would help.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:25 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.