-1

I have a 10 second page load time on Drupal 7.52. It has the approximately the same problem on localhost and my server.

On my localhost (WAMP) Apache uses an insignificant amount of CPU (3% or less). There is no sign of the localhost being limited by CPU, RAM, or Disk.

The MySQL queries are fast (50-250 ms total time). My page generation time is fast (100-350 ms).

Due to my server setup I cannot use APC.

I've tried searching for answers but most of the people are complaining about high cpu. I've got low cpu usage which is very weird.

I've tried disabling a lot of the modules and it didn't help.

How can I debug what is causing this slowness?

The website is www.energyjustice.net

  • 1
    Have you tried using Chrome's inspector tools to see what is loading and when. It could be a 3rd party script or something your using causing everyone to halt until the that finally loads or times out. Or could be something totally different but the inspector tools will help narrow it down – Leigh Nov 9 '17 at 12:32
  • It takes 10 seconds for Drupal to respond. – Aaron Kreider Nov 9 '17 at 19:54
  • "Due to my server setup I cannot use APC." and or Memcache, Varnish and the like? That could be a big reason. I suggest you profile your site with something like NewRelic so you can get to the meat of the issue. Short of that, your server may not have enough horsepower to serve requests. It will be hard to narrow down without more information. – Kevin Nov 9 '17 at 20:04
  • Have you got any code in a hook_init()? Or a contrib module that makes use of it? See like you've got page caching on but hook_init is still run with page caching on so if thats taking loads of time to do stuff that will slow it – Leigh Nov 10 '17 at 12:24
  • Or how many items do you have in the menu? It seems like there's quite a few. If you've got 100s or 1000s then that will definitely slow down performance – Leigh Nov 10 '17 at 12:26
1

Looks like my site was hacked. Bootstrap.inc was compromised and I have yet to find the source of the problem. But it might be related to an old security vulnerability.

https://www.drupal.org/forum/support/post-installation/2016-01-27/includesbootstrapinc-hackedchanged-constantly

The hack causes the website to try to load two URLs. The CURL timeout is 5 seconds. Thus the 10 second delay.

This is called the Pharma hack. It happened in February 2015, and the problem was that I only partially cleaned it. This allowed it to reinfect.

0

Most likely the issue is with the frontend CSS or JS due to the page generation time of 0.35s but page load times of 10 seconds. The network tab of your web browser (firefox, chrome) should help; you can also use http://www.webpagetest.org/ to get the same info.

  • It is taking Drupal 10 seconds to send the first byte. Do you think this indicates a problem with CSS or JS? – Aaron Kreider Nov 9 '17 at 19:59
  • First byte for the HTML is a PHP/Apache issue. Setup Xdebug, get a cache grind and look for the slowest running code. If that sounds too complicated, the devel module has some limited metrics that might help. See this for more info on how to do this docs.google.com/presentation/d/… – mikeytown2 Nov 9 '17 at 21:17
  • 1
    Thanks. I got cache grind setup. I've got two calls to php::curl_exec that are taking 10 seconds. Called from: request_url_data @ 737 The other 350 function calls take 0.1 seconds. The server got hacked a while ago (and I thought I fixed it). It looks like we are being directed to open two urls and failing. So the CURL request takes 5 seconds and times out. The first CURL request is to: 51.254.69.90/blog/?arsenal&utm_source=75539:621689:777 – Aaron Kreider Nov 14 '17 at 22:17
  • @AaronKreider Good job on getting xdebug setup! I think you found the problem. drupal.org/project/hacked can sorta audit your site but I'd recommend rebuilding and validating the backup info one node/line at a time. Sorry to give you bad news here :/ – mikeytown2 Nov 14 '17 at 22:21
0

the server itself loads a text file very fast (ie /robots.txt ) its seems like you are minifying and combining css/js files

have you enabled cache in admin/config/development/performance ? have you enabled cache on all the sidebar block views ?

create a page (a hidden one) with no blocks on the sidebars see if it loads faster if its faster progressively add all the blocks and see which one seems to slow it down

perhaps one of the blocks involves a view with a SLOW query

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.