Tuesday, January 10, 2012

Having used a mac for years, I've always used either Parallels or Vmware Fusion for virtualization.

Before that, when I was using Linux, I used Vmware Workstation.

Today, when looking for a virtualization solution on Windows, I discovered Vmware Player.

It's free, and seems really fast. Just installed a virtual machine on it, and will do further testing as soon as I can.

But so far the signs seem very hopefully. I'm very impressed with the responsiveness, and that it doesn't cause the host to lag in the slightest.

Monday, January 09, 2012

Why the web server in my company went down

So I was reading on line about a piece of news about how Nginx, an alternative web server, has overtaken IIS in usage on the web. In the comments below the news, people were praising Nginx on how fast and lightweight it is compared to Apache.

So I absolutely had to try it out. On the unimportant company web server, I installed Nginx and tested it, without removing Apache. Being new to Nginx, I didn't really know what I was doing, and I wasn't very interested in reading the documentation because I was just experimenting.

I set it all up, didn't like what I saw because of some Bad Gateway issues, and decided to remove Nginx and restart Apache.

This resulted in lots of segmentation faults. I don't know why, because I didn't do a thing to the Apache config files. All I did was to stop and start the service.

Had to get the hosting service provider to give me a new VPS and spent long hours migrating from the current VPS to the new one.

But this time, while waiting for the hosting service to prepare the VPS, I set up a Debian server in my virtual machine, and set everything up using Nginx + FPM-PHP and Memcached. Success.

Then I replicated the configuration in the new VPS and migrated everything over. Had problems with Memcache config at first, but it's been resolved. Then I read that APC would be preferably since it's a single server, so I switched to that. Far easier than using Memcache, and it seems as fast.

Now the web site's really fast and spiffy but I will have to keep monitoring the site in case I see Bad Gateway errors (which randomly comes up, I don't know why. Is it due to the FPM-PHP version I'm using?) or in case the server cannot take the load (unlikely).

I may still switch back to using Memcache, especially when Django has to be used. I wonder if it makes sense to use Nginx + APC + Memcached, or just take out APC and use Memcached for everything, since Nginx can serve static files from Memcached?

In any case, I have now experienced for myself why people drop Apache. Previously, the web service had to be restarted automatically twice a day because it'd stop responding due to server load (not that it had lots of traffic; the server just wasn't powerful enough). I hope this switch will remove the need for the restarting. Right now I can already see an obvious speed boost, which is excellent, even if the restarting problem isn't resolved.

Fingers crossed :)