views:

76

answers:

4

Hi! I have a website. It's my first website with Zend Framework but I think it's written good. Generatiom time is about 0.9s now. I'll do it something like 0.2 but leave it now. When you press any link on the website it tooks about 1,5-2s before web browser is loading page. Then it tooks 0.15s to show it. So if execution time is 0.9 where are the other 1.1s? Ping is about 13ms. Website address is http://zgarnijlicke.pl

Edit:
Strange. Second domain, http://lottek.eu, is working good. Look at http://lottek.eu/picostreamer. It isn't lagging like the zgarnijlicke.pl domain.

Edit 2:

There is a problem with Zend-Framework. I setted up action without rendering view (layout disabled too) and it's working as fast as server can do it. I'll make new question for it.

A: 

Try putting some timer code in your php that measures the length of time it takes to generate the page content. This way you can confirm or rule out server problems.

You might also use network tools like ping and traceroute to see if your problem is caused by network latency.

Dana the Sane
Read my post again. Execution time is 0.9s but showing page tooks 3.2s now. Ping is about 13ms
Misiek
A: 

A quick test with wget here gets an overall execution time of 1.5s to transfer one of the pages, with an actual download time of 0.2 seconds, so 1.3s of overhead. The pause occurs before the transfer starts, so that's a server-side problem.

Is that site on a virtual server? It's possible that if the underlying physical server is heavily loaded, your image could be getting swapped out or otherwise CPU-starved and takes ~1 second to become responsive again.

Perhaps it's an internal resource thing - are you connecting to a DB, especially a remote one? Even if some or most of the pages aren't DB-driven, the overhead of connecting to a DB could be causing this slowdown. And then gets swapped/delayed again as there's little further activity to keep the image active.

It could even be something as silly as Apache being configured with 'IdentityCheck' on, though unlikely, as this would slow down all requests. I'm not seeing any slowdown on the requests for .css/.js files from your server when viewed from HTTPFox. Interestingly, requesting the .css/.js via wget returns a '500 Internal Server Error'.

Marc B
I was putting on caching and the headers mod was disabled. That was reason for 500 Error. Errors fixed. Every request (by Audit chrome) have 0.7-1.2 latency. It's VPS. I've setted up few game server but they are empty and when I tried to join them everything works fine. PHP scripts that are "talking" with servers are getting datas from MySQL in 0.5>time. So it's not DB error or lag.
Misiek
A: 

Here's a webpagetest.org report for your site: http://www.webpagetest.org/result/100721_1P0Y/

If you view the waterfall graph for the first view, you'll see that the browser gets your HTML source at around the 1.2 second mark, and is first able to render your page at just after 4 seconds. What happens in between those two is downloading of your three javascript files and two CSS files. So, this is where you want to start. Some suggestions:

  • Consider using a free CDN for jquery.js insteading of serving it from your server, e.g. Google's: http://code.google.com/apis/ajaxlibs/ . This way, users are more likely to already have it cached, Google will serve it from a location geographically closer to the user, and (I think) in compressed format.

  • For jquery.corner.js and jquery.media.js, consider merging them into one file and serving them compressed (the Apache module mod_deflate makes this very easy to do)

  • Same for your CSS files - consider merging them into one file and serving them compressed.

Those will give you some quick wins. However there are other things you can improve:

  • Add width and height attributes to your image tags. Without these, some browsers will halt rendering while they download the images so that they know how much space they'll occupy. None of your image tags have these attributes.

  • Make sure you're using the right image format for the job. Your banner.png image is over 300k which is far too large. I converted this to a JPEG image (80% quality) and it was 30k.

As for the execution time, 0.9 seconds seems quite high. Are you using APC or similar? Is the page doing any heavy database work?

Tim Fountain
It's Zend-Framework. No APC. I gave dimension to images. Now I can't convert images to smaller size but I have here 10 Mb download so for me it should work fine. Later (after eliminating "lag") I'll compress images and configure all stuff you written about.
Misiek
I renamed .htaccess to another name for a while but it isn't .htaccess error. I have really no idea.
Misiek
Test helped me a lot. Thank. I marking this post as answer.
Misiek
A: 

I found it. It's problem with ZF because when I did hello.php page with code like that:

hello world

Without any < ?php ?> script took 0.4s to complete.

Misiek