Welcome Guest, Not a member yet? Register   Sign In
Slowness on Dreamhost

Hi everyone,

I have finished developing a site on my local server (vmware of xubuntu/apache/php/mysql running inside windowsxp).

Locally, the load times are really great - with the {elapsed_time} for every page being 0.01-0.08 seconds (even for the more query intensive pages).

So, thinking everything was wonderful, I have moved to my production server (just a DreamHost shared server).

Now, I would expect that pages render slowly on Dreamhost - but I wouldn't expect the {elapsed_time} output to jump up to 1-10 seconds for pages (which is has).

So i have been trying to debug - and even with absolutely no autoloading, logging set to 0 and a controller with:


class Index extends Controller
    public $data = array();

    function Index()

        $this->load->view('index', $this->data);


and a view file of:


my load times are still anywhere from 0.1 to 2 seconds (depending on the refresh). To me, this is very high??

I have captured the log file contents (by changing the log threshold to 4 for a bit) and this is what it says:

DEBUG - 2007-09-13 20:23:32 --> Config Class Initialized
DEBUG - 2007-09-13 20:23:32 --> Hooks Class Initialized
DEBUG - 2007-09-13 20:23:33 --> No URI present. Default controller set.
DEBUG - 2007-09-13 20:23:33 --> Router Class Initialized
DEBUG - 2007-09-13 20:23:33 --> Output Class Initialized
DEBUG - 2007-09-13 20:23:33 --> Input Class Initialized
DEBUG - 2007-09-13 20:23:33 --> Global POST and COOKIE data sanitized
DEBUG - 2007-09-13 20:23:33 --> URI Class Initialized
DEBUG - 2007-09-13 20:23:33 --> Language Class Initialized
DEBUG - 2007-09-13 20:23:33 --> Loader Class Initialized
DEBUG - 2007-09-13 20:23:33 --> Controller Class Initialized
DEBUG - 2007-09-13 20:23:33 --> File loaded: /home/.hasbro/blah/blah.com/system/application/views/index.php
DEBUG - 2007-09-13 20:23:33 --> Controller Class Initialized
DEBUG - 2007-09-13 20:23:33 --> File loaded: /home/.hasbro/blah/blah.com/system/application/views/index.php
DEBUG - 2007-09-13 20:23:33 --> Final output sent to browser
DEBUG - 2007-09-13 20:23:33 --> Total execution time: 0.4661

You can see the File loaded: part happens twice for some reason, this only seems to happen in the index.php page - but i dont' think that is the reason for the load times as the other pages which don't have duplicated 'File loaded:' message are still producing similar load times.

I guess i have eliminated to following as the causes:
* mysql being on a separate server to apache - as the slow times happen even when database library isn't loaded
* my code - works fine locally, and also its slow on dreamhost even when i have the most basic controller and view in existence.

anyone have any ideas??

PS> just in case anyone is wondering, the memory usage seems to be around 1.5mb so i think that part is ok.

[eluser]Michael Wales[/eluser]
A load time of 1-2 seconds isn't that bad... this page here loaded in 1.594 seconds.

Regardless, Dreamhost is notorious for over-selling. You may just have a lot of "neighbors" that are using a lot of resources on their sites.

My recommendation:
1. Install the YSlow extension for Firefox and browse to your site. Look over the results it returns and make appropriate corrections.

2. If it's still slow - complain to Dreamhost. They really hate moving you to another server, but if you complain enough they will. If they refuse, switch to a different host. Lunarpages is pretty good and they will buy out the rest of your existing contract with another host, if you switch (meaning, if you owe DH 3 more months at $10, Lunarpages will pay you $30 to switch).

Run traceroute to your server to make sure that there are no routing problems. Those packets make a few stops on the way. You can also ping the server at intervals to check the response times. Remember: Every host will be slow compared to localhost ;-)

well see i don't think it has anything to do with tracerts, pings and what not.

if i understand correctly, the {elapsed_time} is how long the server took to 'generate' the page (i.e. all internal).. not how long to render the page on my browser.

so the slowness is more internal to the server - i.e. php being slow, codeigniter being slow etc or something. not network related.

Sure. elapsed time in the benchmarking class is from CI starts to final output. If the time varies from env. to env., it is of course due to the env. and not CI being slow. So your question is really: Is 0.1 to 2 sec. slow? Well, 0.1 is pretty fast and 2 is pretty slow. Either way, there's very little you can do apart from upgrading shared host -> VPS -> dedicated. Each level will give you more to play with in performance tuning to shave off some ms. Nothing flies at $7.95 a month for a gazillion GB in storage and bandwidth. You likely share that server with 800-1000 domains (you can look it up).

[quote author="walesmd" date="1189769653"]A load time of 1-2 seconds isn't that bad... this page here loaded in 1.594 seconds.

yeah 1-2 seconds is fine - for a page with html, php, mysql, numerous helpers and libraries involved.

but for the most basic controller and view to be taking that kind of time is a bit slow i would have thought. it means that by the time i add all my content i am looking at page generation times of 2-5 seconds each - which must kill the server quickly if the site gets a lot of traffic.

maybe its just DH shared hosting not allocating much cpu speed/time so the server takes longer to generate the page.

i am now looking into slicehost so i can manage my own server - pity about the waiting times.

I'm on dreamhost as well, and I'm actually getting everything from 4 to 9.9 seconds in total execution time for the same page. And everything feels really slow to load. I've had the same code at dreamhost in a non-CI version, and it was definitely faster.


I did a check on the memory peak, and the CI version is 2,2 mb versus 0,4 mb in the non-CI version of the code, so I guess performance is the price you pay for using a framework?

[eluser]Michael Wales[/eluser]
I've never had an issue with CI on Dreamhost. If I did have slow load times (I have with Wordpress before), I complain until they move me to another server (they get tired of giving me free months of service when I refuse to pay). Dreamhost is notorious for overselling their servers, the result is shoddy performance on many of them.

Theme © iAndrew 2016 - Forum software by © MyBB