[wp-hackers] Re: Very slow comment posting

Robert R. Marsh, SJ rmarshsj at hotmail.com
Fri May 9 16:57:43 GMT 2008


Thanks to all who helped. I tracked down the code causing the delay and
found a way to optimise it.

Rob

> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com 
> [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Jamie
> Sent: 09 May 2008 13:45
> To: wp-hackers at lists.automattic.com
> Subject: Re: [wp-hackers] Re: Very slow comment posting
> 
> 
> 
> Robert R. Marsh, SJ wrote:
> > That's the strange thing: (with caching disabled) the page 
> takes ages 
> > to load after a comment (the footer comment shows about 50 
> queries and 
> > 50
> > seconds!) has been made but NOT at other times.
> >
> > Rob
> >
> >   
> That's an awful lot of queries. I would try to find out which 
> query is causing the hangup. Put this in wp-config.php:
> 
> define('SAVEQUERIES', true);
> 
> And then in the footer put this:
> 
> <?
> if (current_user_can('switch_themes')){
>     global $wpdb;
>     echo "<pre>";
>     print_r($wpdb->queries);
>     echo "</pre>";
> }
> 
> That will show you each query, what function called it and 
> how long that query took to execute. I just added the 
> switch_themes permission so all the regular visitors don't 
> get a large dump at the bottom of the page, so you need to be 
> logged in as an admin, or change the permission to something lower.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.100 / Virus Database: 269.23.11/1422 - Release 
> Date: 08/05/2008 17:24
> 



More information about the wp-hackers mailing list