Current time: 12-16-2017, 01:35 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
06-05-2011, 11:55 PM (This post was last modified: 06-06-2011 12:17 AM by Marvin.)
Post: #1
New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
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.

Marvin
Find all posts by this user
Quote this message in a reply
06-06-2011, 01:53 AM
Post: #2
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
06-07-2011, 12:13 AM
Post: #3
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
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:

OLD VPS:
EAccelerator for PHP
IonCube Loader for PHP
Mod Security
Zend Optimizer/Guard Loader for PHP
Proxy
UniqueId
Version


NEW VPS:
Mod SuPHP
CGI

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?

Marvin
Find all posts by this user
Quote this message in a reply
06-07-2011, 12:50 AM
Post: #4
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
06-07-2011, 12:54 AM
Post: #5
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
Quote:Is PHP running as a CGI or mod_php?

Pat, how can I determine that?

Marvin
Find all posts by this user
Quote this message in a reply
06-07-2011, 12:58 AM
Post: #6
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
php_sapi_name - http://us3.php.net/php_sapi_name is probably the most reliable way to tell since it is coming from the actual executed code.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-07-2011, 01:24 AM (This post was last modified: 06-07-2011 01:24 AM by Marvin.)
Post: #7
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
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?

Marvin
Find all posts by this user
Quote this message in a reply
06-07-2011, 01:31 AM (This post was last modified: 06-07-2011 01:31 AM by pmeenan.)
Post: #8
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
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:

Code:
<?php
echo php_sapi_name();
?>

Drop it somewhere on your server that you can reach it from a browser and then visit http://myserver.com/myinfo.php in a browser and you should get a page that tells you what mode PHP is running in.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-07-2011, 01:40 AM
Post: #9
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
Pat, the returned value is: apache2handler

Marvin
Find all posts by this user
Quote this message in a reply
06-07-2011, 02:10 AM
Post: #10
RE: New Hosting - Init. Connect. & Download faster, but TTFB slower. Why?
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)