This is what happened between Apache, Nginx, and LiteSpeed Free Edition

This is what happened between Apache, Nginx, and LiteSpeed Free Edition

Few weeks ago i rent one box VPS to test resource usage from three different webservers without any tweaks, it is just basic installation with PHP and MySQL. This three webservers are Apache, Nginx, and LiteSpeed Free Edition. I’m using wordpress basic installation (without any plugins) plus one 404KB image and load it with 50 visitors maximum simultaneously. This VPS has 256MB memory (512MB burst) and using CentOS 5.5 32bit with OpenVZ virtualization. Allright here are the results.

Apache

Apache Load Time

Apache Resouce Usage (more…)

{ 0 comments }

Latest Stable Version Nginx 0.8.54 with PHP 5.3.5

Latest Stable Version Nginx 0.8.54 with PHP 5.3.5

This is the improvement of my previous Nginx version 0.8.53 with PHP 5.3.5 installation, and also this time i’m not using php-fpm to run fastcgi, i’m using php-cli command to run fastcgi, and the result is memory usage decreased about 50MB. So let’s get it on!

VPS: CentOS 5.5 32bit with 256MB RAM XEN

Add EPEL and REMI repository, also update YUM (we will use REMI reposity for PHP 5.3.5)
EPEL 32bit

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

EPEL 64bit

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

REMI

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
yum -y update

Install Nginx

yum -y install GeoIP GeoIP-devel GeoIP-data perl libperl

32bit

rpm -Uvh http://centos.alt.ru/repository/centos/5/i386/nginx-stable-0.8.54-1.el5.i386.rpm

64bit

rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/nginx-stable-0.8.54-1.el5.x86_64.rpm

start Nginx and add to init

/etc/init.d/nginx start
chkconfig --add nginx
chkconfig nginx on

Configure Nginx virtual host
As usual i prefer separate Nginx vhost for each domain so it will be easier to manage, and “/home” directory for domain root so it will ease you to synchronize domain root with ftp user root

create your domain root

mkdir -p /home/domain/public_html
mkdir -p /home/domain/logs

create two directory for domain vhost

mkdir /etc/nginx/sites-available
mkdir /etc/nginx/sites-enabled

edit Nginx configuration (more…)

{ 0 comments }

eAccelerator on PHP 5.3.5

eAccelerator on PHP 5.3.5

In my previous note i’m installing PHP 5.3.5 with XCache PHP opcode cacher, if you prefer to use eAccelerator for your PHP cacher, here is the guide note.

Download and install eAccelerator package

wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.zip
unzip eaccelerator-0.9.6.1.zip
cd eaccelerator-0.9.6.1
phpize
./configure
make
make install

add eAccelerator extension and settings to php.ini

nano /usr/local/lib/php.ini

zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

those setting above is default, for more information you can visit: eAccelerator Settings

create eAccelerator tmp folder

mkdir /tmp/eaccelerator
chmod 777 /tmp/eaccelerator

Check your PHP Version with eAccelerator installed

php -v

PHP 5.3.5 (cli) (built: Feb 11 2011 02:10:37)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator

with eAccelerator

Reference: eAccelerator Wiki

{ 0 comments }

Ngiiinnxxxx

Ngiiinnxxxx

New update: Nginx 0.8.54 + PHP 5.3.5 has been posted

I’m doing this on my CentOS 5.5 64bit with 256MB RAM OpenVZ VPS, another / my way to install Nginx with the appropriate modul for hosting WordPress site or blog. Nginx version is still 0.8.53 because i’m using Epel Repository.

Download Epel Repository
32bit

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

64bit

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Update YUM

yum update

Install Nginx and required packages

yum install -y nginx patch libtool libmcrypt-devel libxml2-devel make automake gcc gcc-c++ sudo flex bison wget zlib-devel openssl-devel pcre pcre-devel pcre-devel gd-devel bzip2* libc-client-devel.x86_64

Start Nginx

chkconfig --add nginx
chkconfig nginx on
/etc/init.d/nginx start

Optional: Before starting Nginx, you have to stop and / or remove httpd

service httpd stop
yum remove -y httpd

Install MySQL

yum install -y mysql mysql-server mysql-devel
service mysqld start

(more…)

{ 0 comments }

Understanding About Overselling In The Web Hosting Business

Understanding About Overselling In The Web Hosting Business

Have you ever heard about overselling in web hosting business? Generally, overselling means too much selling something, which can be the opposed of overstock. Okay, enough for scrubby talk, let’s get serious.

I maybe cannot explain deeply about this overselling business, but i can tell you this, when you have server that suppose to create or serve only 100 accounts or clients but you push it to create or serve for 200 accounts or clients, that is overselling. For instance, with the specification such 3.00GHz Processor, 4GB Memory, 120GB Disk Space, and 1000GB Data transfer, you can only sell or divide this server for maximum 60 clients. With these kind of spec divided by 60, each client will get (approximately):

1500MB Disk Space
15GB Data Transfer
60MB Memory Usage
40MHz CPU Usage

*I’m not counting this spec allocation with full resource, i assume the residual resource is reserve for server’s system.

So from my explanations above, you maybe do overselling by creating for example 200 accounts with that kind of server. You are expecting that your clients don’t use all of their resource, especially disk space and data transfer. And to prevent your client for using full resource of your package that you promised, you restrict them with general TOS like: prohibited to use for file hosting, peer to peer application, cpu large consume script such as CGI, Proxy, etc. Those kinds of TOS is very common and understandable in the web hosting business, but the disaster thing will come to you overselling provider when the client’s website is not use the restricted script or service but their website get about a thousand unique visitor a day and accidentally the website is full with large size of images, or simultaneously receive a thousand request. With the normal 60 clients, that kind of condition can overwhelmed the server, what about if you do overselling and you accidentally experiencing that kind of circumstances? Can be worst!

What would happens? Bandwidth limit exceed, fatal out of memory, slow response to the website (long time process), etc. Your email inbox will be full by your client’s tickets, complains, refunds, invectives, and another unpleasant emails. Is that good? Of course not! In my experience, good service provider will do response all of those ticket with good manner and resolve all of those problems, maybe upgrade the server spec or do refunds. But the bad or evil or terrible provider will not response all of the tickets, not do refunds, keep overselling until the server’s blow up and then dissapeared like they swallowed by the earth.

More about overselling, i will illustrate with these images below:

Non Oversold

Oversold

Non oversold server will stil be safe if their clients use maximum resource simultaneously, but in most case cpu and memory usage will sometimes exceed or boost to the top of your server’s spec limit, you just need to reboot your server to refresh cpu and memory, or maybe upgrade both cpu or memory. For the oversold server, you probably can also do reboot to refresh cpu and memory, but what about disk space and data transfer? Could you press reboot and refresh them? Haha… lol.

Is it good to do overselling? Or is it good to buy web hosting from the overselling provider? Overselling of course is good to maximize profit and it is not prohibited, but you service providers must keep in mind that you need to be ready to upgrade your server, especially disk space and data transfer in case your server is not enough no more to serve your client’s disk space and data transfer, if you don’t have problem with that, then you are a good overselling provider. For the customer, if you want to go with the overselling provider, then you must be looking for some good spec with very affordable price. You need to do research about the service provider candidate before you decide to go with them. Check how long they have been in business, testimonials, etc. Find all of those information in a community or forum which the provider sell their service, so if there is some trouble you can easily contact them in the forum or if in the worst case they do not respond your query, just post in the forum your testimonial about them with the proof or evidence like maybe screenshot.

One last important thing, i want to tell you that there is no such thing “Unlimited Disk Space” or “Unlimited Data Transfer”.

{ 0 comments }