Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting

Archive for May, 2012

google analytics – javascript event


2012
May 21

in the past, we used google analytics javascript event like this:
<a href=”products/jqrte_latest.zip” title=”jQuery rich text editor – jQRTE” onclick=”javascript: pageTracker._trackPageview(‘/products/jqrte’);”>jQuery Rich Text Editor v0.4.2</a>

However, we did try to use the above code and found that it would not reflect to the google analytics in real time.

Hence, we make change on the code like this and it works finally:
<a href=”#” onClick=”_gaq.push(['_trackPageview', '/page/javascript_call']);”>javascript event</a>

LAMP or LNMP?


2012
May 13

The most common software bundle is LAMP in the past.
What is LAMP? Linux + Apache + MySQL + PHP

How about LNMP? it is almost the same, except the change of the web server from Apache to Nginx. Why there is such change? Loading and performance issue.

Apache will consume a lot of memeory, if you are using just very low-end vps, your vps maybe down due to all memory are being used. we have bad experinece in the past for OpenVZ, the apache eat up all memory and the machine shutdown and need reboot.

In recent year, Nginx become more popular, few benchmarks make comparison between both, Nginx seems a lot better on load balancing and memory consumption.

One of the disadvantage is that you could not use .htaccess anymore. You have to re-learn the syntax of Nginx to adapt your needs.

XEN v.s. OpenVZ


2012
May 07

vps hosting – openVZ or XEN
this is the two main choices of vps hosting. which one do you need?

1. i need an independent environment
Your choice is XEN. XEN is similar to a dedicate server, other nodes on the same server will not affect you.
openVZ nodes would affect each other, however, the system resource usage is much less than XEN.

2. i am a linux starter
If you are not so familiar with linux environment, you can try openVZ first.
After you are confident, you can try XEN, based on price concern.

3. i need to see all logs
Your choice is XEN. we have try using openVZ, however, some logs are missing, for example auth.log, boot.log, dmesg, kern.log.
If you need to have a deep trace on the server, you can only choose XEN.

4. i need swap control
OpenVZ do not have swap. If you use up all the memory, your server would shutdown immediate.
However, for XEN, even if you use up the memory, you still have swap for buffer.

5. i need a better server performance
If OpenVZ is not oversell and have enough spare resource, the average performance of OpenVZ is much better than XEN.

improve website loading performance – CDN


2012
May 06

if your website has to face the whole world, you have to think of the loading time of each page in your website.
if your website is just plain text format with little graphics, it is ok to just host on one server.
However, if your website involve heavy graphics, videos or even flash, some regions would have loading issue on your website.

Most likely cloud hosting actually can solve your problem, but if you have limited budget, you have no choice.
CDN stands for Content delivery network, it is much similar to cloud hosting, they call it CDN nodes.

what you have to do is to change all images pointing to a sub-domain, like http://cdn.yourdomain.com.
CDN nodes are placed on different locations, visitors may get the graphics, videos from the nearest CDN node.

There are different pricing plans, some are in monthly basis, some are in bandwidth usage basis, for eaxmple 1TB per year.
There are lots of CDN providers, just google it and you could find some.

web server selection


2012
May 05

we are now moved to the new VPS server and really said goodbye to shared hosting. we tried a few unlimited shared hosting but all of them has some issues:
1) unlimited is not really unlimited, take care the terms and condition
2) website got redirect or rewrite easily
3) if the server you hosted got hacked, technical support cannot help
4) down time really cannot control (sometimes VPS too)

we moved to use VPS for around 1-2 years, it is really a good choice as compare to shared hosting because you can customize the server you want.
However, you have to take care the bandwidth and storage space usage very carefully.

so depend on your budget, in the internet world, you have these choices:
1) shared hosting
2) VPS hosting
3) semi-dedicated server hosting
4) dedicated server hosting
5) cloud hosting

we did not yet try cloud hosting due to its high cost…

if you have enough budget, you would choose cloud hosting or dedicated server hosting.
However, due to the budget concern, you have to select among the choice 1-3.

we are now using the VPS server from vps6 provider.