rune00
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WordPress CPU load (disable page_rewrite_rules()?)@aaurel1an no WordPress plugin is as effective as a standalone installation of Varnish.
Forum: Fixing WordPress
In reply to: WordPress CPU load (disable page_rewrite_rules()?)@bpa The problem for you is when publishing the page WordPress re-builds all permalinks as I explained in my previous post.
You are right. A different permalink structure might solve your problem, but in my case I really needed /%category%/%postname% ??
Forum: Fixing WordPress
In reply to: WordPress CPU load (disable page_rewrite_rules()?)For the frontend I suggest you use Varnish cache. It will cache every webpage and deliver the content before Apache is activated. Thereby the permalink are cached as well. https://www.varnish-cache.org/
Forum: Plugins
In reply to: Sharing Media Library among Subsites WordPress 3 MultisiteI agree.
Forum: Fixing WordPress
In reply to: WordPress CPU load (disable page_rewrite_rules()?)I have solved this – at least for now. If anyone might be interested here is what I did.
I looked through the WordPress core code and disabled all calls to the function flush_rules(). It will flush rewrite_rules in the option table and rebuild it from scratch. I don’t want that now, as it is too resource demanding.
I grep’ed the function and commented out the ones called from backend (when creating, editing or deleting posts (and pages)):
<homedir>/wp-admin/includes/upgrade.php: // $wp_rewrite->flush_rules();
<homedir>/wp-admin/includes/upgrade.php: // $wp_rewrite->flush_rules();
<homedir>/wp-admin/includes/misc.php: // $wp_rewrite->flush_rules();
<homedir>/wp-admin/includes/schema.php: // $wp_rewrite->flush_rules();
<homedir>/wp-admin/admin.php: // $wp_rewrite->flush_rules();
<homedir>/wp-admin/admin.php: // $wp_rewrite->flush_rules(false);
<homedir>/wp-admin/options-permalink.php:// $wp_rewrite->flush_rules();
<homedir>/wp-includes/post.php: // $wp_rewrite->flush_rules(false);
<homedir>/wp-includes/post.php: // $wp_rewrite->flush_rules(false);
<homedir>/wp-includes/rewrite.php: * @see WP_Rewrite::flush_rules()
<homedir>/wp-includes/rewrite.php: $wp_rewrite->flush_rules( $hard );
<homedir>/wp-includes/rewrite.php: function flush_rules($hard = true) {I instead sat up an additional webserver that has access to the live database. I created a PHP script to run, whenever needed, that will rebuild rewrite_rules without wasting resources on the live server.
Problem solved.
Forum: Fixing WordPress
In reply to: WordPress CPU load (disable page_rewrite_rules()?)I’ve been debugging a bit and it seems to me that this line will get ALL WordPress pages and re-build the permalinks. Then update the rewrite_rules row in the wp_options table:
$page_uris = $this->page_uri_index();
Naturally, when you have thousands of pages it takes forever to rebuild.
I’m wondering if this could be done more efficient?
I did the exact same thing. Installed on Linux and exported db to set up on my Mac.
I disabled APC on my server and it seems to be fixed.
Pretty weird bug however.
Thanks ??
I got the same error im my Apache log. The error seems to cause issues with both backend and frontend – sometimes the page returns blank, sometimes mysql errors are returned.