Dec 16 2008

Choose the right VPS to host your busy websites

Published by Jiwei under Internet, Software

I have a few busy websites running Wordpress, phpBB, phpList, eTicket, Magento and other PHP/MySQL based scripts. I get close to 1M hits a month with a peak observed at 9 hits/second.  A shared hosting won’t work for me anymore.  A dedicated server is too expensive and perhaps an over-kill. So I set off to find a VPS (Virtual Private Server) 8 month ago.  It’s a quest full of frustrations and learning.  I’ll write my experience down here in hope that it can be of some use to others about to start a similar quest.  I’ll cover two primary issues:

  • Picking the right VPS, and
  • Running a light system

VPSLink referral/promotion code: CSR42P 10% lifetime discount.

How to pick the right VPS

I first started with a HostIcan VPS-Rage (512MB RAM) using Virtuozzo virtualization. It came with a reseller package which I don’t need and it gave me a lot of headache in setting things up. The performance of the applications was unpredictable, in the sense that response latency could be unbearably long (>15 seconds) or reasonably fast (~1 second). Apache log showed many child processes being terminated. I wasn’t sure whether this was because of either my VPS being deprived of CPU or hiccups of Apache.

The last straw came when I changed the MySQL root password and the monitoring software kept restarting MySQL every 10~15 mins.  And I was demanded $30 to reset MySQL password.  No, I wouldn’t give in to this type of bullying behavior and decided to move on.  To make it the worst experience to me, HostICan won’t refund the remaining 6 month fee.  Their “Risk Free Money Back Guarantee” only applies to the first 30 days. Buyer beware!

Virtuozzo/OpenVZ gives you a bit speed but not stability

After realizing that life with a VPS is a bumpy ride, I tried to understand virtualization better. Virtuozzo is the commercial version of OpenVZ by Parallels. It runs a single instance of OS and claims to offer the highest levels of density, performance and manageability.  However, a fatal drawback is that each Virtuozzo VPS does not have virtual memory, but rather some additional burstable RAM. The burstable RAM are shared by all VPS on the same server.

When RAM on a server is exhausted, malloc() return an error and it is upto applications to handle the error gracefully.  Without exception, applications terminate with or without core dump.  When memory leak is still common (e.g. in PHP) and server setup is done by armatures (e.g. configuring 256 Apache processes), the chance for RAM exhaustion is pretty high.  This may explain why I saw many Apache child process termination on my HostIcan VPS.

Xen is the right choice

While stability being an issue with Virtuozzo or OpenVZ based VPS, the alternative is Xen. Xen is fundamentally different from Virtuozzo or OpenVZ.  Xen provides a hardware emulation and each VPS runs its own instance of OS, with virtual memory. When the allotted RAM is used up, the OS starts swapping.  It slows down the system but no sudden death occurs.  This is the same predictable behaviour of a dedicated server.  The following diagrams from VPSLink.com explains the differences pretty well.

After much search and research, I found VPSLink which has good reviews and reasonable pricing. BTW, when checking out hosting companies, it’s useful to have a read of their facilities and look at the server room pictures.  Pay particular attention the rack structure, heat vents, raised floor and wiring neatness. I managed to filter out a couple of hosting company showing Wal-mart racks on wheel, bare floor, hairy wiring and Linksys routers.

I signed up for VPSLink Link-4 Xen package ($30/month, 512M RAM) and installed Fedora 8.  Fedora 8 is in the same blood line of the vetted Redhat Enterprise Linux 5 (Fedora 11 will be in EL6 to be released 2010).  I have faith in its stability as I deployed multi-million dollar servers with Redhat EL5 to top tier mobile operators around the world before.

So far, VPSLink’s service is excellent. I asked for IP address reverse mapping and it was done in 10 minutes. If you want to sign up with a VPSLink package, use the referral/promotion code CSR42P.  You’ll get a 10% lifetime discount and I’ll get some credit to my package. Don’t feel obliged if there’s a better deal.

Read the Part 2 of this quest: Speedy ride on a VPS with Lighttpd

Related posts

7 responses so far

Mar 19 2008

The Fallacy in our Search for Information

Published by Jiwei under Internet, Philosophy

Jan. 8th, 2008 marked the official 10 year anniversary of Google’s famous PageRank algorithm.  The idea was conceived earlier, but Larry Page filed the PageRank algorithm patent (U.S. Patent 6,285,999 ) on Jan. 8th 1998. PageRank together with the business acumen of the Google folks powered Google to the throne of Internet. Is this worth celebrating?  Maybe not.  Here’s why.

aol-search-distribution-combined.jpg
Internet search results follows the power law (Pareto distribution), i.e. listings on the first few pages of search results get all the traffic. Based on AOL search data with 20 million searches for 650,000+ users over a 3-month period, the 1st search result was chosen 42.3% of time, the 1st  page (first 10 results) 89.6%.  The percentage drop drastically fast after 1st page and nobody ever picks a search result beyond the 502nd position. See the diagram.

The order of search results on the planet’s most popular search engine Google is governed by the PageRank algorithm.  PageRank algorithm assigns a numerial weight to each HTML page based on the number and the weight of other pages referring to it (called incoming links).

It’s of utmost importance to Internet marketers that your websites are listed on the first page of the chosen keywords. And this requires a lot incoming links with high PageRank to your websites. Tragically, much of the creativity of our generation of netizens has been consumed in engaging paid listing, link exchange, SEO, spam comments, etc. etc.  Sites not engaging in self-promotion for incoming links disappeared into oblivion in the search space. Plenty of SEO marketers promise 1st page listing within a week, for a fee.  And they fulfill the promise most of time.

Can the true knowledge compete with the assault of SEO marketers armed with an excessive array of modern weapons (tools, bots and phony web sites)? The competition is like that between the European settlers and the American India in the New World.

What Google search results present are, at best, our popular believes.  And a large collection of Google Bombs  is the living proof how easily and regularly the popular believes are manipulated.     Try searching for “French Victory”, “Dangerous cult” and “Miserable failure”.  The No.1 in Google results point to pages about “French defeat”, “Scientology” and “George Bush” respectively. Google defused some of the bombs in Jan. 2008. But God knows how many more are still at large or in the making.

Pages filled with disinformation swamp the ones with useful information, pushing them down in the ranking.   To see this effect, you only need to search for term “credit card”.  You won’t find a credit card provider in the first page.  To get noticed, the credit card providers have to pay, normally over $2 per click.  One may speculate that it is precisely this effect which sustains the growth of Google’s revenue.

Alas, we have created the great Internet in our own intellectural image. Are we aware of how fallable and distorted this image has become?  The image was shaped not by our understanding and truth, but rather by the commercial value of keywords. Most of us would think homogeneously because we read exactly the same information in our Google searches. I wish Google has “research philosopher” on staff to understand the philosophical impact of its search engine.

Back to PageRank.  The PageRank idea is similar to bibliography citation ranking in academic papers, where the most cited paper are considered most original.  Researchers in the early 70’s  showed the high citation ranking often do not reflect the importance but rather a phenomenon called the Matthew Effect (the famous authors get disproportionally more citations than the less famous ones). As Nassim Taleb put it in “The Black Swan”,

“Academic success is partly (but significantly) a lottery” (page 217).

PageRank had shown its age of relevance. To prolong the aging PageRank algorithm, Google proposed the “NoFollow” attribute in HTML tag in 2005.  Recent Google crack down on link farms and paid links is another attempt to maintain the meaning of PageRank. Will paid links be completely stamped out?  Betting on it would mean admitting that our generation of netizens do not have any ingenuity.

However, these being said, I believe Google only wants to prolong the life of PageRank until the next search ranking algorithm is ready.

The PageRank is dead; Long live the PageRank!

What will the next algorithm look like?  Well, for the sake of brevity, I’ll leave it to the next blog.  And here’s a hint. Why was Google toolbar aggressively promoted?  Why do other companies, e.g. Yahoo, Alexa/Amazon, promote their toolbar equally aggressively?

Until next time, please write down your praise, disapproval, criticism and suggestions.

Related posts

2 responses so far

Nov 25 2007

How to run WordPress over ADSL or Cable modem effectively

Published by Jiwei under Software

There are basically three ways to publish your blog with WordPress.

  1. Open an account on a blog service such as http://wordpress.com/. This is the easiest to set up.  But you cannot always customize to your heart’s content and you don’t earn from AdSense.
  2. Run WordPress on your own server at home.  You really emerge yourself in the wonderful world of open source technology and experience the thrill of making money on-line.  Well, it’s pocket changes to start with but you’ll have a chance to grow the traffic and look for the next alternative.
  3. Use a web hosting service such as the cheap and reliable share hosting 1&1 or VPS (Virtual Private Server) at VPS Link, use referral code CSR42P to get 10% discount, when you reach your stardom in the blogosphere.

If you decide to start with Option No. 2 and have got WordPress going (otherwise, WordPress.org offers everything you need), this HowTo is for you.  If you don’t have a static IP address at home, you can still run your own domain using dynamic DNS, e.g. http://dynadns.org/ .

This HowTo focuses on running WordPress over your ADSL or cable modem effectively.  ”Effectiveness” here is defined by your readers not noticing that your blogs are streamed over your ADSL/cable modem.  To do so, you have to overcome two hurdles:

  1. Long latency caused by the limited upload bandwidth (normally in the ~650kbit/s range), and
  2. The limited capacity of your home server (a P4 3GHz running at 95% CPU produces 3.5 dynamic pages per second; And an older P3 1GHz produces barely 1 dynamic page per second).

Combining the two hurdles, how bad is the delay to load your home page.  It takes about 1.2~2 seconds within North America. DNS lookup adds a few more milliseconds on top and cross continents delays it further. This is not too bad.  However, if you have AdSense ads along with your blog, it’ll take 5~15 seconds to display a page.  That is eternity on today’s Internet. Readers would have clicked away or turned attention to something else.  Don’t despair. There are ways to overcome the hurdles.

Firstly, why does Adsense slow down the page loading so much?  Because Adsense analyses your page on the fly to find the right AdWords ads and the Reader’s browser waits for the complete page before displaying. Safari browser performs poorer on this regard.  Secondly, if we can reduce the latency in generating the page and the size of the page in transmission, we’ll reduce the latency substantially.  So here is the recipe for the cure.

  • You need to avoid generating the dynamic page twice for Adsense. WP-Cache plugin by Ricardo Galli Granada. http://mnm.uib.es/gallir/wp-cache-2/ gives you the perfect solution. Cached page/post are discarded as soon as you modify it. There’s also WP Super Cache http://wordpress.org/extend/plugins/wp-super-cache/ which improves the throughput even further.
  • All major browsers can handle compressed pages. Your fully loaded home page (normally ~50KB in size) can be compressed to 8.5KB on the fly by Apache/PHP. Hey, this increases your bandwidth and reduces the latency by over 5 times. However, neither WP-Cache nor WP Super Cache tolerates compressed pages. You’ll have to configure your PHP for this task. In your /etc/php.ini file, change or uncomment the line “zlib.output_compression = on” and restart Apache.

How well does your blog perform after these two steps?  The latency comes down to 0.3~0.4 seconds (from previously 1.2~2 seconds) and your readers can enjoy your opinion with AdSense within about a second. This is on par with any major hosting service.

Good luck and have fun blogging knowing that there is no more digital distance between the readers and your blog.

Related

The dsl is an effective way to provide intuitive interface for optimizing the internet connectivity of a basic isp. The underlying technology can aid both the intermediary as well as the high-end in tweaking their broadband networks. These advanced concepts work in collaboration with the related adsl parameters to bring forth the specific dsl connection speed.

Related posts

2 responses so far

Nov 16 2007

WordPress backup and restore

Published by Jiwei under Software

The first thing you have to consider after installing WordPress and starting writing is to backup and restore your database.  I started with WordPress Database Backup 2.1.5, which was rated highly on WordPress.org.  It turned out to cause me tremendous grief when migrating to a different server. The primary issue is that some tables are not properly dumped. For instance, Counterize II 2.10 tables could not be restored properly. The secondary problem is that it took so long to back up my database, over a minutes with almost 100% CPU (P4 3GHz).

So I started looking for a better database plugin.  And I’m very happy to find WP-DBManager 2.20 by Lester ‘GaMerZ’ Chan.  WP-DBManager  uses the standard MySQL utility mysqldump to do the job.  It took less than a second to dump my database. Most importantly, everything is restored ok on a different server. WP-DBManager  also provides other functions to manage the database dumps, optimization DB, repair DB and a dangerous Empty/Drop tables.  Lester ‘GaMerZ’ Chan knows his stuff. Well done!

Related posts

No responses yet

Nov 14 2007

Android award idea

Published by Jiwei under Mobile, Mobile device, Software

Google announced the availability of Android platform SDK this week. However devices running Android will only come after mid of 2008. Like the saying in an old joke, reading the software manual without the hardware is like reading a porn book without the software.  It’s hard to hold the urge.

Meanwhile, Google also set up $10 million in prizes for developers who build compelling Android programs, including Developers Challenge offers 50 prizes of $25,000 each, with the best then going on to compete for greater prizes of $100,000 and $275,000.

So here’s the idea, if you can make Android run on Windows Mobile or Palm devices, you’ll hit the jackpot.

Related

Some cellular service providers reward their loyal customers with ringtone and wallpaper freebies. The graphics and audio amusements have become a big part of the mobile industry these days. The melodious mobile device ringtones may not be compatible enough to go with every service carrier. These ring tones come in a wide variety such as funny ringtones, monophonic or simple ringtones which may be downloaded as free ringtones and the most popular category of premium-charged music ringtones.

Related posts

No responses yet

« Prev - Next »