SELECT option_value FROM wp_options WHERE option_name = 'jetpack_edit_links_calypso_redirect' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = '_transient_timeout_jetpack_idc_allowed' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = '_transient_jetpack_idc_allowed' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = 'jetpack_sync_error_idc' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = 'jetpack_excluded_extensions' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = 'jetpack_sync_non_blocking' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = '_transient_timeout_jetpack_scan_state' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = '_transient_jetpack_scan_state' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = 'sharedaddy_disable_resources' LIMIT 1
This happened even when I disabled every Jetpack module via the debug screen. It doesn’t seem to matter if I’m logged in or logged out, the queries are run on every page load of the site frontend.
Is there a reason these options aren’t autoloaded? A number of them don’t appear to exist in the current options table, but are being requested on every page. I was thinking of manually updating the options table to autoload them, but thought I’d check first what was actually happening.
]]>We are trying to find a solution to handle a million+ articles for a WP website. We managed to import all the articles and pictures but have issues with the DB queries. For example the query for homepage takes about 8 seconds. We installed w3 total cache and configured it and we use Amazon RDS for the database and AWS (EC2 etc) for the rest.
We are looking for a solution that doesnt imply modifying the WordPress core, because we would like to be able to use plugins or update them when necessary.
We know that many websites with millions of articles use wordpress but we’re not sure what’s their approach and how they handle it.
Any help regarding what to do in order to improve the speed of the website would be much appreciated.
Thank you.
]]>Now, when a page is shown, all related posts are presented below the content. A related post is presented by a title, a thumbnail and some text. The text comes from a custom field (_custom_introduce_text) that I pick up using this:
$manchet = $wpdb->get_results("SELECT meta_value FROM wp_FreshFarm_postmeta WHERE post_id=".$key->ID." and meta_key='_custom_introduce_text'", 'OBJECT');
I will start by saying that this actually worked before upgrading to 3.5.1, so I’m at a loss why it’s not working anymore.
If I “hard code” the query to e.g.
$manchet = $wpdb->get_results("SELECT meta_value FROM wp_FreshFarm_postmeta WHERE post_id=476 and meta_key='_custom_introduce_text'", 'OBJECT');
then a result is returned.
If I write $key to the screen this is not empty.
But whenever $key is part of the query, nothing is returned from the database.
This is the “full” code that I’m processing:
<?php
$related_posts = MRP_get_related_posts( $post->ID );
if( $related_posts ) {?><h2>Relaterede artikler</h2>
<ul class="opsamlingPost">
<?php foreach( $related_posts as $key=>$value ) { ?>
<li>
<a href="<?php echo get_permalink($key); ?>">
<?php echo get_the_post_thumbnail($key, array(220,220)); ?>
<h2><?php echo get_the_title($key); ?></h2>
<?php
$manchet = $wpdb->get_results("SELECT meta_value FROM wp_FreshFarm_postmeta WHERE post_id=".$key->ID." and meta_key='_custom_introduce_text'", 'OBJECT');
if( $manchet )
foreach( $manchet as $my_manchet) { ?>
<p><?php echo $my_manchet->meta_value; ?></p>
<?php } ?>
</a>
</li>
<?php }
?>
</ul>
Any help is much appreciated
since the Update to WordPress 3.5.1 and Plugin 5.0.1 the initial DB-Queries for each Page Load boosted from 16 to 934. If I deactivate the Plugin the initial DB-Queries go down to 16 again. If I activate it again, it goes up to 924 again … so I assume it might be the Plugin.
Not suprinsingly this number corresponds quite well to the numer of 914 redirected posts, that are listed under “Redirect Summary”. Could it be, that all Post-Redirects are loaded on each Page-Request?
Thanks in advance!
ben_
https://www.ads-software.com/extend/plugins/quick-pagepost-redirect-plugin/
]]>I’m showing here that you’re queries need to be optimized. Below is an example of one of your queries that was getting killed due to the amount of time it was taking to execute, you’ll notice it’s a huge query:
[ 1328286601 ] [ johanhor_johanmu ] [ 2162627 ] [ 27 ] [ johanhor_johanmu ] [ Query ] [ KILLED ] [ ] [ SELECT t.*, tt.*, tr.object_id FROM wp_56_terms AS t INNER JOIN wp_56_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_56_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (‘category’, ‘post_tag’, ‘post_format’) AND tr.object_id IN (8222, 8221, 8219, 8216, 8217, 8218, 8220, 8215, 8214, 8213, 8209, 8208, 8207, 8206, 8203, 8202, 8201, 8199, 8198, 8197, 8196, 8194, 8193, …………………………….(this continue for a page long).This one query is being executed, and killed as it’s taking too long to execute which in turn caused your site to receive the 500 error due to so many hanging PHP processes waiting on these types of queries to complete. Once you optimize your queries you shouldn’t receive these errors anymore. Here is a great resource on how to optimize your queries: https://hackmysql.com/nontech
I have read through the above and am clueless.
I then came across this https://revellian.com/2008/07/14/how-to-clean-wp-options-slow-mysql-queries/
And checked all my database tables under my multi install wordpress site. I have more than 1000 DB tables (I assume; due to excessive plugin use; plugins that i have killed to a few).
I thought why not kill the excessive DBs. But I have no idea what to leave and what to kill.
I hope you van help. Thanks Johan.
]]>Using “/%category%/%postname%/” as my custom permalink structure, loading my homepage takes ~3,000 queries taking ~5.0 seconds.
Using the default permalink structure (‘https://domain.com/?p=123’), loading my homepage takes ~20 queries loading in ~0.5 seconds.
To get this information and figure out which queries i am making, i added the following line to my footer to find out the #of queries and time taken to perform those:
<?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds.
And the plugin ‘Debug Queries’ to print out which queries are being ran on what page (adds info to the bottom of footer). Most of the queries look like this:
Time: 0.0001060962677002
Query: SELECT * FROM wp_posts WHERE ID = 3121 LIMIT 1
Call from: require, wp, WP->main, WP->parse_request, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index, get_page_uri, get_page, get_post
Anyone have any ideas of how to keep the “fancy” permalink structure while maintain the performance of the default and cut down on all of those DB-Queries?
]]>