I’ve decided to keep the default title the WordPress gives to the post it autocreates on new installations. I think it’s fitting; what better way to signify the conversion from BlogEngine.net to WordPress?
But first things first.
I’ve decided to keep the default title the WordPress gives to the post it autocreates on new installations. I think it’s fitting; what better way to signify the conversion from BlogEngine.net to WordPress?
But first things first.
A few months ago came the need for a fax machine. Worse yet, it had to reside on a dedicated phone line since the main line was configured to redirect unanswered calls to a mobile number after a number of rings and incoming faxes could occur any time of the day.
View full article »
Generally speaking, I don’t like wasting time hunting down framework bugs. It’s not that I don’t like a challenge, it’s just that they are usually hard and very time consuming to fix (if at all possible), especially in case you have to deal with fringe cases (in other words, “Google isn’t going to help”).
Since we have lots of clients that are not limited to english-speaking markets only, Unicode has been a way of life for us, supporting it since we got off Windows 9x and moved on to Windows 2000. It’s always frustrating to see technology that doesn’t play nice with Unicode, especially considering that this is 2011, where everything is social and interconnected and having multilingual thingies is beyond cool; it’s a necessity.
I’ve stated before that despite its flaws, WordPress is an amazing product with a strong community and a plethora of available content that allows you to meet customer demands quickly and effectively (gone are the days of overpriced custom CMS solutions, especially since the global banks’ crisis began). Till now, the only real WordPress related problem we faced had to do with unicode permalinks, which to put simply…. just wouldn’t work with IIS: If your permalink contained unicode characters, WordPress would complain that it couldn’t find your post. There was no plugin that could solve the issue and as such, we usually resorted to ugly hacks in order to tackle it.
Recently, I was searching the web for some information on a subject (I won’t get into details, suffice to say that it had to do with my sound card) when a promising link lead me to a forum discussion (which I won’t name here for obvious reasons). A user had uploaded an image as an attachment with his message so I naturally clicked on it, only to be greeted with an error that resembled the following (just a random page that I retrieved from Google; nothing specific to Kaspersky): http://forum.kaspersky.com/index.php?&showuser=150963. I had to create an account, which would translate in providing my details then trying to pass the usually incomprehensible case-sensitive CAPTCHA tests that seem to block humans alongside robots, only to wait for a verification e-mail that would never arrive.
Screw that noise, perhaps another post might help me find a textual answer to the problem. I searched using four terms (SB X-Fi Elite Pro) only to see that SB, X-Fi and Pro were removed from search, because they were too short. Okay, what about “Sound Blaster Elite”? That should yield a few results, right? Well, I had to wait 40something seconds for my next search, in order to protect flooding. And then I had a zen moment: “Man, forum software suck!”
Up until yesterday, we were hosting all of our in house projects and our clients’ web applications to CBeyond (formerly MaximumASP). Today, we changed our hosting provider for a number of reasons.
Let me make it absolutely clear here that the service we received in MaximumASP was excellent. We found a deal and rented two relatively cheap quad Opteron servers for about $200 each (about €140 each). Not that new hardware, but good enough back then. The configuration was based on Active Directory (which simplified things a lot) and the technical experience of the staff was top notch.
[more]
Unfortunately, €280 in this economy is still pretty much and to tell the truth, the server did peak sometimes (WordPress can be a killer even with QuickCache). We’ve decided to look for a cheaper solution for at least a few months so we looked around. Here comes Hetzner.de into play.
Hetzner was a curious case. For starters, signs of budget offerings are all around the website. There are dedicated servers starting from $29 per month, they seem to like cross-selling a lot (especially that Flexi-pack offering is unethical to say the least) and the hardware is not server class but rather, desktop class. In any case, we decided to go with two EQ4 servers which provided 10 times the hard drive space we had before, a cpu that can handle 3 and half times the number of requests and 4 times the memory. The initial cost was about €49 per server, but with the inclusion of of Windows license, Flexi-pack (an empty requirement for stuff like extra IPs) and a /28 subnet the price went to €100 per server. Even so, these were cheaper and much more powerful than our previous servers. The only downside as I mentioned was that this was not server class hardware and as such the memory wasn’t ECC. Still, for that price we were willing to take the (mostly theoretical) risk of SEUs if ones were to occur.
But we were far from done. The control panel of our account (not Plesk or cPanel which were also provided) offered an abundance of features, such as custom DNS zone files, operating system reinstallation from PXE-boot, reverse DNS assignment to your IPs, a free /64 IPv6 block which gives us a few quintillion addresses (we are effectively IPv6 enabled now), status monitoring, 100GB backup space and a lot more.
So, is everything perfect? Not completely. There are some issues we faced but for some of these issues, it’s too early to tell yet and these problems might as well be temporary. For example, be careful with your Microsoft licenses since amalgamation is not supported, you will also not find any MSSQL support, the servers don’t belong into a domain and are completely unmanaged – I doubt the staff could login to your Windows installation with normal means, there is no MS certification and a few more similar issues. To tell the truth, all these make Hetzner more suited to Linux OSes, unless you are ready to take the risk of having a completely unmanaged Windows installation, which some people might consider a plus actually. We did and we are doing find so far.
We also faced a network issue where our connection with the outside world was limited to a mere 100-300KB/s. We sent a support ticket and the response was to test a connection to… another Hetzner server. Sure, it worked nicely but that wasn’t the problem anyway. The staff replied that unless that download had issues, they couldn’t help us (exact wording), effectively telling us that the network speed was not guaranteed at all. Well sure, we don’t demand a guaranteed 100Mbps uplink (that would cost a few thousand by itself), but 2Mbps is also too damn low to serve more than 3 users at the same time.
Speeds have improved a bit now and I hope that they will further stabilize. There’s also an issue when we attempt to upload files on our backup space which is on another server using SMB, but apparently FTP works fine as is reading files from that same server using SMB.
Hetzner has potential and unless you can afford a high profile solution at Orcsweb, Rackspace or CBeyond (with the adequate cost) I’d recommended them. Be warned though that while you’ll get a very fast and cheap server with lots of features, the hardware won’t be server class, the network speed is not guaranteed at all and (for the dedicated servers) you should be ready to manage it all by yourself.
I use a Logitech G700 as my mouse. Although it’s being marketed as a gamer’s mouse, I chose it for its many many customisable buttons (I love buttons when they are many and customisable) and the ability to assign different tasks to each part of it depending on my currently active application. I’d recommend it if you are a professional, but not if you are a gamer, since the weight of the battery might make the mouse a bit tiresome.
Today the scroll wheel started acting up. Scrolling the wheel would usually ignore some of the notches (when used in the notched-scroll mode in contrast to the free-scroll alternative) and trust me when I say that this can become annoying soon enough.
I was considering to RMA it, but then it occured to me. My office room is dusty. No matter how hard I try, it’s always dusty and I always have to wipe the dust off, usually even twice a week. I got meself a nice can of compressed air, blew a generous dose into the scroll wheel opening (no need to open it up and void your warranty) and voilà: Problem solved.
Now that you’ve read this, go buy yourself a compressed air can and give a proper dust-off treatment to your computer. Not only your mouse, but the back of your monitor where its heat dissipation grill is, your printer, your keyboard (if you are disciplined enough to crank it open and do a proper clean up, you’d be amased of what lurks in there – even shaking your keyboard while holding it upside down will release a fair amount of ugly dust and skin flakes) and most importantly, your computer case.
It’s far too hot in the northern hemisphere these days – forcing your computer’s fans to work harder (albeit ineffectively) because of the accumulated dust only increases the noise they produce and the risk of hardware damage.
Recently, I was forced to look into PHP caching, thanks to a series of events. Here’s what happened:
Once upon a fine day, the (windows) server demanded that I will install some windows updates it found and I proceeded in complying with my master’s wishes (dare say no, and it will kill your customers’ sites. It already send me their fingers once). After the restart though, I noticed that all of our PHP sites were timing out. It didn’t take long to find out that the one to blame was MySQL which due to the massive amount of files in the temporary folder, apparently needed a very long time to create its temp files. In the end, I found out the cause and boy, was it ugly or what?
It seemed PHP was creating session files on the Windows’ temporary folder but wouldn’t delete them after the session had expired. As a result, the amount of files in the folder reached the 1.000.000 (!), all of which were 0 or 32KB long, but nevertheless enough to make anything that tried to access the folder crawl like it never crawled before (such as MySQL).
[more]
This ugly event mustn’t have to happen again and I need to ensure that. So, I took a deep breath and began digging into php.ini. It seemed that the following piece of advice was giving me a hint:
| ; If you are using the subdirectory option for storing session files ; (see session.save_path above), then garbage collection does *not* ; happen automatically. You will need to do your own garbage ; collection through a shell script, cron entry, or some other method. |
Still, that wouldn’t explain why such an option was set, since I neved touched the session section of the php.ini, ever. I refuse to believe that by default php is designed to kill its hosting server (I may be wrong though, feel free to correct me). I took a quick look into the caching option I actually used, which was provided by the session.save_handler setting, which was set to files. Searching around for different options I could try, I found out about WinCache.
WinCache, or Windows Cache Extension for PHP is PHP accelerator in the form of a PHP extension which is designed to work in Windows, but strangely enough, not limited to IIS (although being developed by Microsoft). WinCache though is not just an opcode cache but also offers some other nifty features, such as file caching, user data storage (more on that later) and session storage. Also, tests conducted by other people seem to indicate that it does a pretty great job, even when compared to other solutions. Plus, it won’t mind if you’re having 1 or 16 PHP FastCGI processes, since the cache it creates is centralised, thus avoiding data duplication!
Now go to RuslanY’s (WinCache’s creator) blog and thank him for his great work!
I have to admit though that initially, I was sceptical about WinCache. I had tried WinCache as a beta and it had some serious bugs which made some of our PHP sites to unexpectedly crash and as such, I had removed it completely. Not so with version 1.2.614, a development release that gave me no problem. After verifying that all of our PHP sites would work without issue when this extension was enabled, I was curious to find out more about its session handling option. So, I changed PHP’s temporary folder to one that would be untainted by other processes, changed the session.save_handler option to wincache and went on an angry rampage using openload, which hammered my servers with requests, the best part of which was that it would create a plethora of new sesions. Let me tell you, I was relieved to see that WinCache only creates a single file for handling PHP’s sessions.
So, I had certainly solved that annoying problem, but now WinCache had proven to be interesting and had to find out more about it. After all, I was sold on this nice live stats page that showed the status of WinCache. The best part was already set and forget. Opcode caching and File caching were applied automatically to all of our PHP applications and required no tweaking from my part. The same goes for session caching (although in this picture the hit/miss ratio is low due to using openload which creates lots of new sessions). What peaked my interest was the User Cache session which initially was 0. I found out eventually that user cache is nothing more than an object storage provided by WinCache and which is accessible using the WinCache provided functions.
“Big deal” I thought. “We’re talking about PHP on Windows, who would bother to lock-in its application to Windows and WinCache?”. Although the question is valid, the answer was far simpler: “Caching plugins!” Indeed, applications that up until now used the disk to act as a cache, could benefit greatly from WinCache if they used it instead for that same purpose. First case in point? WordPress, a platform which is favoured by many of our clients.
Let’s take a specific example, extrahype.com. Extrahype is a heavily modified site based on WordPress for all things geek, be it movies, games, pop culture and more and we’re lucky enough to be hosting it. Using my crude benchmark tool, openload, like a an angry caveman wielding an obsidian knife, I went and performed a simple benchmark of its start page, without using WinCache or any form of caching within the site itself. The results on the 2xDual Opteron 2212 were a bit disappointing, even though this was PHP on IIS on a not that fast server processor. I only got about 14 requests/second, which is low. In contrast, our in-house developed site rekonit.com an online review aggregator for stuff that matter (such as cars, movies and games, you know, the geek stuff you see on extrahype.com) which uses ASP.net 4.0 & MSSQL server and self designed caching algorithms gets about 350 rps. Note, we are currently redeveloping rekonit.com in ASP.net MVC 3 & MSSQL, so get ready to be amazed within the summer (yes, it will also look cooler).
I then proceeded and enabled WinCache in the php.ini. The results were very positive. With WinCache enabled, the average requests/second extrahype.com could handle rose to 31 rps, a difference of more than 2 times! That was good, but still not good enough.
Here’s where WinCache’s user cache came into play in the form of WordPress plugin, WinCache object cache. After I installed this, I could see the user cache section in the WinCache statistics page populated with data. Did it make any difference? Well, a minimal one. The average rps climbed from 31 to 34 rps.
The differences were reasonable and it’s obvious here that the bottleneck appears to be the database server. Still, it provided my PHP websites with a nice performance boost that only costs a little RAM (thankfully, that’s in abudance).
I then proceeded on testing it with PHPBB 3. Using the same method of “before and after WinCache” I would end up with 18 and 30 rps respectively. PHPBB 3 uses a file caching mechanism as its default. I found an experimental WinCache implementation which, usurprisingly, uses WinCache’s user cache. The difference was still minimal, this time from 30 to 33 fps, but still a no brainer compared to other forms of caching. Note that the problem here were the serialized database accesses, since the PHP FastCGI processes were are at a cosy 10% of CPU usage while MySQL was struggling around 25-30% (a whole core in a quad core system, plus a little more).
As a comparison, a PHPBB 3 installation on my development machine (an Intel Q9550 quad core) achieves about 59 rps without WinCache and 82 rps with it enabled, with the same database bottleneck issues.
In the end, WinCache (as other PHP accelerators do) offers an almost free performance upgrade to your PHP applications. Its extra features such as file, user and session caching & handling are indispensible even if you don’t have that much RAM to spare. It’s highly recommended and if you run PHP on Windows you should definitely check it out!
Comments? Criticism? Testimonies? Feel free to comment below!
PS. Before closing this article, I’d like to present you with two additional plugins for WordPress that managed to blow my mind with their results:
I’ve also tested W3 total cache for WordPress, a highly sophisticated caching system which is designed to take advantage of any caching option you can think of, such as opcode and file caching, page minifying even CDNs and some additional features that didn’t have the change to use (yet). The improvement is simply spectacular, since with it enabled plus setting it to take advantage of winCache’s features (and WinCache obviously active) the requests/second I achieved for extrahype.com exceeded the 300 rps mark! This result is achieved mostly by creating static versions of components whenever it can.
If your site however does not need a complex caching mechanism nor is very complex in nature (extrahype.com for example is not as complex as it might seem) you can opt for another caching plugin, simply named Quick Cache. Quick Cache is essentially a very simple caching plugin that creates static versions of your site’s pages. It doesn’t have the sophistication level W3TC has and only few differentiation methods of the page are recognised, but if your site’s user base consists mostly of unregistered visitors or you want to deal with a sudden Reddit/Digg/SU/Slashdot attack, it will do a magnificent job. How magnificent? Well, with Quick Cache enabled in extrahype and WinCache enabled in the server, I managed to get 610 rps! This amazing number is due to the web server only serving static content, with minimal PHP processing.
Since most of our WordPress clients don’t really need (yet) the sophisticated features of W3TC and they mostly have unregistered users, we’ve decided to enable Quick Cache and migrate to W3TC when required. No matter what you select though, make sure the plugins have the required permissions on the cache folders they create, or you may end up with a bazillion of cache files!