views:

599

answers:

6

I am using CakePHP 1.2 for building a website. The problem i am facing is when ever a page loads it takes a lot of time in "waiting for www.example.com". The server response time is very slow. First i thot it was my database queries, but they were executing in less than seconds time. Next i also contacted the server people. They told it was not the server.

Now i am stuck very badly with "waiting for www.example.com". Is the problem is in coding or the cakePHP is mis configured.

Need help badly and fast.

Thanks

+4  A: 

Hi there. Yeah, I am experiencing this as well. Mostly my websites gets slower if I am requesting to a database. I am not really sure about the problem but please check this link:

http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/

jun
A: 

You should test your code on a known baseline. I highly recommend purchasing some time on an Amazon EC2 instance, because then you can compare to Paul Jones' benchmarks available at http://paul-m-jones.com/blog/?p=238. Alternatively, run it on your localhost with as few processes running as possible.

The pseudocoder article above is also a good place to look for speeding up your application.

Are you on shared hosting? Cake tends to perform horribly on those, due to huge variances in resource availability. One of the pitfalls of shared hosts.

If you're not on shared hosting, is it your SQL that takes forever to execute? What kind of "total times" do you get for the sql component (turn debug to 2, check the sql log at the bottom of the pages). If it's not the sql, it's your coding.

Be aware that Cake is pretty slow as well. Make sure you have the latest stable release (somewhere recently it got about a 25% speed bump w/o changing the API). And finally realize that on my VPS with a good host, 2GB RAM, a request still takes about a second to execute, just due to the overhead that is CakePHP.

Travis Leleu
A: 

application locally performs well doesn't mean it does on the web sometimes mysql server is far from the apache web server (latency) sometimes your page has a lot of assets (javascript, css, etc) to load sometimes web hosts are bad or the package is not convenient for the application.

test the time response of a blank layout, if it is slow, the problem is with your internet connection or the shared server of the hosts, or a bad configuration on the host.

if the time response is fast, you should test the time response of the query.. etc... just play the "by elimination" troubleshooting strategy

Robust Solution
A: 

just due to the overhead that is CakePHP. I think it is a joke, I am 100% against this reason

Robust Solution
A: 

If you are looking for a strong response time monitoring tool great for the end user Correlsense offers a free tool. http://www.real-user-monitoring.com

Eric Sullivan
A: 

Set Cache.disable to false in the core.php file.

cosmin