WordPress & Permalinks for Pages
After my post on increasing WordPress Performance, I’ve been helping several other people with their overloaded website.
The most unique probably is the one owned by (let’s call him) Mr. King.
Mr. King has got a very popular website. PageRank 2 only, but since it’s a niche rarely targeted by others, people are flocking there anyway.
He’s making (my guess) thousands of dollars every month, just from Google AdSense shown on his website.
However, the popularity brings other problems. His powerful server (I think it’s a quad core,with 4 GB RAM) was constantly overloaded.
After I optimized the server, it’s working fine now.
Except for the static pages.
First, a little bit about “static” page in WordPress. It’s not really static actually, it’s dynamically generated. In itself it’s not a problem.
However, when you utilize WordPress’ permalink feature, essential to make your website more visible on Google, **and** you have thousands of pages; then it started to get, um, “interesting”. Note that this may probably an understatement
considering the fun I had while optimizing the website.
Basically, I think this is how permalink for pages works in WordPress :
[ 1 ] A visitor requested a page, in the form of a people (and Google) friendly link.
Example : http://asiablogging.com/links-2-asia/
[ 2 ] Due to WordPress-generated .htaccess file, Apache will translate the permalink into loading index.php and passing along that permalink to it.
[ 3 ] WordPress will lookup that permalink in the rewrite table, and got the real URL.
The rewrite lookup record can be viewed with this SQL command :
select * from wp_options where option_name=’rewrite_rules’;
[ 4 ] The real URL loaded and shown to the visitor.
So far so good.
However, when we’re talking about **thousands** of pages, then things started to become messy.
Last time I checked, the rewrite lookup table (the thing I was talking about in point 3 above) for Mr. King’s website is about 21 MB in size.
And **everytime** he add a new page, that record will be recreated again, from scratch.
WP developers have acknowledged the problem as very serious. This is because the way it works at the moment (WordPress version 2.3.1), this scheme is not scalable / will give poor performance over as little as 1000 pages.
And since it’s within the WordPress’ core, it will require a rather significant overhaul to get this fixed.
Don’t get it wrong, they’re (I think) most happy and flattered that some people are actually trying to make WordPress to work as substitute of a Wiki
It’s just that there’s this technical glitch at the moment that will be causing difficulties to many others from following the same path.
So last time I checked, they’re very interested to get this fixed.
Back to Mr.King - I have now optimized the server so it performs much faster, despite the bottleneck I described above.
There’s still slowdown noticable when creating a new page, but it’s now quite bearable
Anyway, again that was fun indeed. I guess this is why I chose IT as my career path back there years ago - it was fun (and very useful to many people), and it still is today.
Enjoy !
update:
His server had problems and crashing his website. Mr King said that the datacenter guys are looking into it, but I’m welcome to look around as well.
Soon it’s pretty clear that the hard drive of the server is dying. I told Mr King to relay that to the techies, which responded with “how did you figure it out ?” (dmesg + google - duh).
Long story cut short - they botched big time, but thankfully I managed to snatch a backup of Mr King’s website before it went down the flames.
Now I host Mr King’s website on my server, and he’s a very happy guy again.


January 15th, 2008 11:50
This guy sounds familiar…. Hey Harry ! nice article … I need to get in touch with you. Please reply!~ Take care.
February 7th, 2008 05:58
I have been a frequent visitor of this blog for some time now, so I thought it would be a good idea to leave you with my thanks.
Regards,
Jim Mirkalami
February 13th, 2008 18:34
Hi
I came across your post in a Google Search because I had not realised that Pages do not get permalinks unless .htaccess is writable. I can fix that for new Pages but is there a procedure or script for re-writing the permalinks for Pages after they have been created.
I probably have misunderstood a lot along the way of my thinking above but will be grateful for advice and pointers.
John
February 14th, 2008 05:37
Hi John, there are several Wordpress Redirection plugins available. Basically, they’ll inform incoming visitors (and search engine bots) with code 301 and the new location of the page. So you won’t lost visitors (and search engine rank) because of this.
.
Be aware though that each plugins are different. You’ll need to evaluate each carefully to find the one that fully suited for your needs.
.
Hope this helps.
.
February 21st, 2008 01:37
Great job, most people would only recommend a more expensive hosting plan
February 26th, 2008 11:31
Interesting. There are some good ideass presented here. I need to do spend some time reading more about these topics.
April 11th, 2008 00:43
I’ve noticed lag time with a brand new installation. I wonder if things will change soon.