Defensio slows down Pixelpost
June 5, 2008Since yesterday Defensio reported they were having technical difficulties. About the same time some of the forum members over at Pixelpost were complaining about slow loading times of their site. John Hess identified the Defensio addon as the cause of this slow loading.
As the author of the Defensio plugin I’ve conducted a small investigation myself. It didn’t take much time to connect the problem with the downtime of the Defensio Service. However, finding the cause of the problem took some more time.
The majority of the code is only executed when needed. So basically Defensio is only activated when a comment is called. However, I managed to identify the source of the problem. The problem lies within the code for the widget.
That particular piece of code has a cache of two hours. If the stats are older than two hours it will try to pull down new stats and store it in the database. However, if the service is down for more than two hours it will repeatedly try to fetch the stats (failing each time). The addon will do this on every call to the page, slowing down the loading of the page in question.
The good news is I’ll fix it asap, but you can easily fix it yourself (assuming you have the latest version of the Defensio addon):
Open up admin_defensio.php and look at line 94 (or about):
// widget support
$defensio_widget = defensio_counter($defensio_conf);
$tpl = ereg_replace("
Change this code to:
// widget support
//$defensio_widget = defensio_counter($defensio_conf);
//$tpl = ereg_replace("
This will disable the widget code while storing unprocessed comments in the Defensio queue (so your spam won’t get through).
Look for the official patch in a few days (as I am totally swamped this weekend).
UPDATE:the problems with the Defensio service have been solved. All should be working again.
[...] the (long awaited) update for the Defensio addon for
.::Schonhose.nl::. » Defensio updated (finally?) | June 26, 2008[...] the (long awaited) update for the Defensio addon for Pixelpost is here. As mentioned in this blogpost earlier it contains the fix that slowed down a lot of photoblogs earlier this [...]