0

I have my cakePHP application (hosted on centOS 7) monitored by appdynamics APM. In their monitoring controller I have breakdown of transactions that take too long.

I also installed a simple chrome page timing plugin. On one of my webpages I got the following results:

enter image description here

As you can see the page loaded after 157 seconds! However in my APM the slowest Transaction recorded has 'execution time' at 2.1 seconds. If my server serves the pages in under 2 seconds (and usually in around 0.5 second) where does this terrible 157 seconds come from? How can I monitor the source of that load time?

Thats another example with firefox plugin for page load times:

enter image description here

This one took nearly 54 seconds and thats a real load time (saw it mysekf). However firefox Firebug under Net tab shows that for that same page:

enter image description here

6 seconds for that same request? Why are they so different and why is firebug incorrect? I saw myself that the load took over 50 seconds

Damian
  • 461
  • 1
  • 7
  • 18
  • if you are sure the time the php script takes to execute is at most 2 seconds - the answer is the webserver. Look at your apache config/logs. I don't know what that image means btw - it _looks_ to mean it took 100s to parse the dom. Chrome has it's own dev tools which don't look like that.. – AD7six Aug 27 '15 at 17:15
  • I attached firefox timings. Seems like parsing the content takes that long, thats why nothing is showing up in my APM. Is it possible to debug what is taking that long since firebug doesnt even see this horrible load times? – Damian Aug 27 '15 at 18:15
  • There are a lot of variable in play here.Just because your PHP code can execute a request in 2s doesn't mean that is how long it take the client to download the content and get to an onload event. The size of the content, the connection speed, the physical distance between server and client, any javascript that may be exeucting (and causing browser to block) before onload event, etc. all come into play here. You will need to go through and eliminate all these possibilities to get to your answer. You should also necessarily expect to see discrepencies between metrics and server and at client – Mike Brant Aug 27 '15 at 18:25
  • I would start be investigating what javascript is running between primary response being served and the onload event, as this looks like the most likely candidate as to where time is being spent. FYI, you are also not showing the size of the primary request response here. That is also likely important. – Mike Brant Aug 27 '15 at 18:28
  • So I completly disabled javascript in my browser and in general sites became much faster. However once in a while I still get a page load close to 40 seconds (completly randomly). What could cause that? – Damian Aug 27 '15 at 19:07
  • MOreover, even with javascript being off completly, its the page processing that takes so long (not the request/response from the server. What else except JS can block page from loading? It usually takes 30 seconds just spinning without any output and then suddenly everything loads – Damian Aug 27 '15 at 19:14
  • That firefox screenshot isnt helpful. You're asking about why your php request is slow - it's not in that screenshot, however it's obviously not slow either - since the screenshot does show the main request was loaded in less than 1s. What is shown is a delay connecting to a 3rd party. Sounds like either a browser problem, a network problem connecting to a 3rd party, blocking js - or something else which isn't clear because you haven't said what url you are debugging so readers can take a look. To be clear: there are 2 images of unknown meaning - and one screenshot that doens't show a problem. – AD7six Aug 28 '15 at 08:47
  • I never asked "why is my php request slow". I said that APM monitors my php transactions and there is no slow transactions there. I also eliminated JS because like I said 2 comments up, I disabled JS in my browsers and I still got that issue from time to time. There is no specific URL where this happens (I wouldve posted it if there was). Out of 100 loaded urls about 2 or 3 would show that issue. On another try it would be different 2-3 urls. – Damian Aug 28 '15 at 14:55

0 Answers0