bug fixed: Bad Behavior causes Drupal sluggishness
ISSUE: Recently, I've noticed my Drupal site acting sluggishly, especially when I'm submitting/deleting content nodes or calling/querying data from the MySQL database. The sluggish performance was particularly noticeable when queries from the Views module are called upon. Tasks that would normally take milliseconds may take up to 20 seconds to 1 minute on my site.
This was EXTREMELY frustrating... until I found the solution!
So after many hours, if not many days of trial and error debugging...
THE SOLUTION: Uninstall the Bad Behavior module.
At this time I was using Bad Behavior version 6.x-1.0-rc2. If you can find a bug fix for this issue, post your solutions here.
And for the record, here's the context that led me to find the solution:
Initially, I thought this issue may have been due to limitations on my shared server hosting service Hostmonster. This theory came about when I was working on Dash Player, a next-generation Flash and XML-based media player that can be it's all-in-one YouTube service. The problem was basically that Dash Player's video playlists took forever to load. Since I've read online that a good number of people are usually not too happy with streaming video on shared server web hosts, I immediately thought my performance issue had to do with Hostmonster. But this was not the case!
Today I've somehow mustered the stamina to revisit the problem. It all began when I did a fresh Drupal 6.5 installation (which was released yesterday) to create yet another Drupal "sandbox" and realized that new site was running with blazing speeds.
I've created a simple method to the debugging -- editing a view with the Views module UI! All I did was click on any of the (+) symbols on view will calls up various parameter from the database. On my problematic Drupal installation, waiting for the parameters to load took up to 20+ seconds. It only took milliseconds for this to happen on my fresh installation.
Nevertheless, I took on a trial-and-error mission to find the culprit by painstakingly installing module by module (I have over 60 modules at this moment) until I found out Bad Behavior was really throwing a tantrum!
A few other modules that I've came across that may have been contributing to the sluggishness (though definitely not as much as Bad Behavior) were: Download Count and Advanced Help modules.
FINAL THOUGHTS
Now that the problem is fixed, developing my Drupal sites would be so much more efficient (I no longer have to wait for those spinning icons to make me dizzy). On the other hand, Dash Player is now querying up playlists (which are generated by Views) lightning speed now just like how it does on dedicated servers! I would have never known Bad Behavior was the little bugger. The only guilt I may have now is maybe yelling a few times at the Hostmonster tech support guys and gals about the sluggishness before I found the fix. Forgive me please! 
This work is licensed under a Attribution Share Alike Creative Commons license








Post new comment