MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?

WebPagetest Forums

Full Version: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I just moved from a VPS to another VPS at different hosting company in the hope to improve what was already good. However, at the moment the over all load time of a page is pretty much identical to what it used to be. What puzzles me a bit is why my TTFB is now slower when the Initial Connection, and also the Content Download, are both noticeably faster?

Any ideas as to why this is, and suggestions on how to address this, would be greatly appreciated.

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - URLJET
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - SERVINT

Orange - Initial Connection (Now Faster)
Green - TTFB (Now Slower)
Blue - Content Download (Now Faster)
P.S. Gzip compression on both servers is likely identical as the compressed files have the same sizes.
What platform does the code run on (Apache/PHP)? What you are seeing is likely a difference in the tuning of the application layer serving (if it is PHP then the PHP/Apache integration). Since it is a VPS, do you have full control over that part?

If it is PHP, make sure php-apc is installed, also check to see if they are both integrated with php the same way (mod_php, cgi or fcgi). For dedicated/VPS I usually like to run apache with mod_php because I don't have to worry about multiple different user accounts like you do in a shared environment and it can be somewhat faster than cgi (particularly with apc running).
Pat, thanks for pointing me in the right direction (as always).

The site is a vBulletin-based forum , so yes, it is PHP. The server runs Apache. The old server used LiteSpeed plugin, which I'm not certain is needed, but I will test the site with and w/out it on the new server, too.

The VPS has just one site on it, so I can chose any configuration that suits the site best, w/out worrying about negatively affecting another site.

I'm now comparing the Apache options enabled in the old vs new VPS. The following is a brief list of the options that are enabled on one, but not on the other VPS:

EAccelerator for PHP
IonCube Loader for PHP
Mod Security
Zend Optimizer/Guard Loader for PHP


Should I disable the Mod SuPHP and CGI on the new server, and enable some (or all) of the options of the OLD server listed above?
I wouldn't blindly enable all of the modules unless you know you need them (IonCube looks like it's for loading obfuscated code for example).

Is PHP running as a CGI or mod_php? I expect the bulk of the difference is coming from EAccelerator and you can choose to continue using that or switch to APC instead (from looking around EAccelerator may be a touch faster but APC is more standard and is being integrated into PHP itself).

Most of the others are only needed if parts of your site actually need them (well, except for mod security which is usually a good idea to have installed).
Quote:Is PHP running as a CGI or mod_php?

Pat, how can I determine that?
php_sapi_name - is probably the most reliable way to tell since it is coming from the actual executed code.
Pat, I'm not sure how to use that information. But when I go to WHM > EasyApache (Apache Update) > Exhaustive Options List, in the new server I do see check-marks in front of Mod SuPHP, and CGI, but in the old server these two options did not have check-marks.

Should I disable those two in the new server?
Yep, My guess is that those are used to run PHP as a CGI script (and changing the user account that runs it).

For using php_sapi_name you'd just need to create a small php file on your server and hit it from a browser. For example, create myinfo.php with the contents:

echo php_sapi_name();

Drop it somewhere on your server that you can reach it from a browser and then visit in a browser and you should get a page that tells you what mode PHP is running in.
Pat, the returned value is: apache2handler
Sounds like it is running as a module. Enabling EAccelerator (or APC) should improve the base page times (make sure to hit it a couple of times to let the server-side cache populate).
Pages: 1 2
Reference URL's