{"id":1574,"date":"2008-01-14T13:12:13","date_gmt":"2008-01-14T06:12:13","guid":{"rendered":"http:\/\/harry.sufehmi.com\/archives\/2008-01-14-1574\/"},"modified":"2008-01-14T13:12:24","modified_gmt":"2008-01-14T06:12:24","slug":"wordpress-permalinks-for-pages","status":"publish","type":"post","link":"https:\/\/harry.sufehmi.com\/archives\/2008-01-14-wordpress-permalinks-for-pages\/","title":{"rendered":"WordPress & Permalinks for Pages"},"content":{"rendered":"

After my post on increasing WordPress Performance<\/a>, I’ve been helping several other people with their overloaded website.
\nThe most unique probably is the one owned by (let’s call him) Mr. King.<\/p>\n

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.
\nHe’s making (my guess) thousands of dollars every month, just from Google AdSense shown on his website.<\/p>\n

However, the popularity brings other problems. His powerful server (I think it’s a quad core,with 4 GB RAM) was constantly overloaded.
\nAfter I optimized the server, it’s working fine now.<\/p>\n

Except for the static pages.<\/p>\n

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.
\nHowever, 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 \ud83d\ude42 considering the fun I had while optimizing the website.<\/p>\n

Basically, I think this is how permalink for pages works in WordPress :<\/p>\n

[ 1 ] A visitor requested a page, in the form of a people (and Google) friendly link.
\nExample :
http:\/\/asiablogging.com\/links-2-asia\/<\/a><\/p>\n

[ 2 ] Due to WordPress-generated .htaccess file, Apache will translate the permalink into loading index.php and passing along that permalink to it.<\/p>\n

[ 3 ] WordPress will lookup that permalink in the rewrite table, and got the real URL.<\/p>\n

The rewrite lookup record can be viewed with this SQL command :
\nselect * from wp_options where option_name=’rewrite_rules’;<\/b><\/p>\n

[ 4 ] The real URL loaded and shown to the visitor.<\/p>\n

So far so good.<\/p>\n

However, when we’re talking about **thousands** of pages, then things started to become messy.<\/p>\n

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.
\nAnd **everytime** he add a new page, that record will be recreated again, from scratch.<\/p>\n

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.
\nAnd since it’s within the WordPress’ core, it will require a rather significant overhaul to get this fixed.<\/p>\n

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 \ud83d\ude42 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.
\nSo last time I checked, they’re very interested to get this fixed.<\/p>\n

Back to Mr.King – I have now optimized the server so it performs much faster, despite the bottleneck I described above.
\nThere’s still slowdown noticable when creating a new page, but it’s now quite bearable<\/p>\n

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.
\nEnjoy !<\/p>\n

update:<\/strong>
\nHis 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.<\/p>\n

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).<\/p>\n

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.
\nNow I host Mr King’s website on my server, and he’s a very happy guy again.<\/p>\n","protected":false},"excerpt":{"rendered":"

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 … Continue reading WordPress & Permalinks for Pages<\/span> →<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1574","post","type-post","status-publish","format-standard","hentry","category-teknoblogia"],"_links":{"self":[{"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/posts\/1574"}],"collection":[{"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/comments?post=1574"}],"version-history":[{"count":0,"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/posts\/1574\/revisions"}],"wp:attachment":[{"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/media?parent=1574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/categories?post=1574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harry.sufehmi.com\/wp-json\/wp\/v2\/tags?post=1574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}