Drupal surprisingly slow
Hi all,
I've been working with Drupal for over a year now and I'm beginning to find some strange speed issues. I'm not new at all this stuff (nor at PHP), but I've tried two hosting companies and at both servers my site ran significantly slower than comparable database-driven websites on the same server (shared hosting).
Pages load in > 5 s. This is very problematic. I have reports of 47 s page loading (and that's only the frontpage...)
First things first, my installation:
Drupal 5.7
Cron maintenance tasks Last run 9 hours 38 min ago
GD library bundled (2.0.34 compatible)
MySQL database 5.0.45
PHP 5.2.5
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Web server Apache/1.3.39 (Unix) PHP/5.2.5 mod_ssl/2.8.30 OpenSSL/0.9.8b mod_perl/1.29 FrontPage/5.0.2.2510My site is not a frequently visited site, I've gotten only about 7000 frontpage hits in 7 months, which rounds op to 30 uniques a day, which is not much to explain the site's speed.
My question now is: what could be slowing my site down and more importantly: what can I do about it?
Some extended profiler would be handy, I've run the devel module and found that on most pages, I have about 5 database queries taking longer than 5 ms (max. 70 ms) thus making about 400 ms in total for database queries, but the page loaded in an ugly 5 s. So that's about 4 s overhead, but where does it come from?
Another page has about 30 queries > 5 ms (ranging 13-1000ms, average 200 ms- > 6000 ms queries), but the page took 28 s to load.
This time, queries took longer, so I've optimized my tables now, I've only done that yesterday, so not too many changes. Loading the previous page again: all queries took about half time less and the page execution time is still 26s.
My performance settings are set to Normal caching and minimum cachce lifetime of 1 min, uncompressed CSS files.
I don't think it's memory related:
* Memory used at devel_init(): 11.97 MB
* Memory used at devel_shutdown(): 16.17 MBMy modules (hold on to your hosre):
aggregator
block
blog
blogapi
book
captcha
captcha_pack
cck
color
comment
contact
contemplate
date
devel
diff
drupal
emfield
filefield
filter
forum
forum_access
help
image
imagefield
jstools
legacy
locale
menu
node
nodeaccess
path
ping
poll
profile
recent_changes
remember_me
search
sgca
smileys
statistics
system
taxonomy
throttle
tracker
upload
user
usernode
views
watchdog
webformI've upgraded all of them recently, about 3 weeks ago, when upgrading to Drupal 5.7. The problem already persistes BEFORE Drupal 5.7.
I hope anyone can help me out some way.
Thanks!
SabbeRubbish

Update: Oh crap, I've just
Update:
Oh crap, I've just rebuilt node permissions and the site is about 20x faster... This is not normal right?
Update: I've used the trace
Update: I've used the trace module now to find out what could be wrong (I'm busting my head hard here!) and I've found a VERY strange thing. When all activity is logged (except PHP Notices, too many of them to conclude anything), it seems that my script is dead for 10 seconds and then renders the page in 2 seconds! Making 12s total of course.
Beginning of my trace:
#6845a1fb T=0.000000 [REQUEST] 2008-04-29 20:18:44.393448 GET /forum HTTP/1.1#6845a1fb T+10.193651 [DEBUG ] $_ENV = array()
#6845a1fb T+10.217606 [DEBUG ] $_SERVER = array('DOCUMENT_ROOT' => '/home/...
Normally the trace module should display the environment things rather quickly, but it takes 10 seconds to do so, what happens BEFORE all of this?
Please, I need an answer!
SabbeRubbish