OpenVZ & Digital Ocean read/write test results

Here is a quick view on the read and write results on Digital Ocean & OpenVZ:

Write Operation with Digital Ocean Server
[email protected]:~# dd if=/dev/zero of=test bs=1048576 count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 7.93444 s, 271 MB/s
Read Operation with Digital Ocean Server
[email protected]:~# dd if=test of=/dev/null bs=1048576
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 3.39856 s, 632 MB/s

Write Operation with OpenVz Server
[email protected]:~# dd if=/dev/zero of=test bs=1048576 count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 20.3058 s, 106 MB/s
[email protected]:~# dd if=test of=/dev/null bs=1048576
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 2.26675 s, 947 MB/s
Read Operation with OpenVZ Server

The above results show that the Digital Ocean SSD does make it faster to write to the disk while the Reads are better in OpenVZ VPS that I own. This difference might change depending on the overhead of the Hardware node which would be serving my VPS/CloudVPS. More to digg out in coming days.

Citrix Xen – Server Pool unavailable

Due to power failure if your Citrix Xen Slave server doesn’t get back online in pool, this might help:

When the Xen environment changes the pool master, If a slave cannot reach the pool master it goes into a failed state. To change this edit pool.conf file (vi /etc/xensource/pool.conf) and changed the pool master IP address from 10.174.XX.XX to 10.174.XX.YY (to the correct new pool master address). The following identifies the changes as represented within the .conf file:

slave:10.174.20.155

to

slave:10.174.20.157

Once the change is complete, run xe-toolstack-restart. The management interfaces should be restarted and as a precaution the server  restart should help. On reboot, you will be able to see the slave server joining the pool without any trouble.

Reference: http://forums.citrix.com/thread.jspa?threadID=242210&tstart=30

Loging Varnish client IP in Apache logs

When you have a varnish server infront of your Apache server, you will be reverse proxying the requests. This will mark your varnish’s servers ip as the client in apache logs. To let apache know the real client’s ip we can user mod_rpaf module needs to be loaded. Use the following steps to install mod_rpaf module on your apache server.

wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
tar xvfz mod_rpaf-0.6.tar.gz
cd mod_rpaf-0.6
sed -ie ‘s/apxs2/apxs/’ Makefile
make rpaf-2.0
make install-2.0

Once the installation is done, we need to add the following configuration apache configuration file to enable the module.

LoadModule rpaf_module modules/mod_rpaf-2.0.so


RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1
RPAFheader X-Forwarded-For

RPAFproxy_ips can be multiple IP address and it’s IP from your reverse proxy.

RPAFproxy_ips 127.0.0.1 xxx.xxx.xxx.xxx

Replace xxx.xxx.xxx.xxx with your varnish servers ips.

Add the following LogFormat to apache configuration file (httpd.conf)

LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” varnishcombined

In the VirtualHost entry of your domain use varnishcombined as logformat for access logs.

In varnish (3.0.x) default.vlc file under vlc_recv{} add following lines:

if (req.restarts == 0) {
if (req.http.X-Forwarded-For) {
set req.http.X-Forwarded-For = req.http.X-Forwarded-For + “, ” + client.ip;
} else {
set req.http.X-Forwarded-For = client.ip;
}
}

restart apache and httpd to finish with.

You should now start seeing the actual client’s ip in apache logs as well.

Source: varnish, stackoverflow, bxtra.net etc

Startup City

0606_101351

Yesterday attended an event called “Startup City” Organized by Silicon India at Nimhans convention hall, Bangalore.

It was a good chance to hear about top notch companies like Rediff, Naukri and Tejas Network directly from their founders. Naukri.com (Sanjay Bikchandhani), Rediff.com (Ajit Balakrishnan) and Tejas Networks (Sanjay Nayak) shared their experience with the startup city. Along with it I attended a range of inspirational and informative seminars covering everything from Cloud Computing to Monetizing Applications from leaders of Amazon.com, Sun Microsystems and Forum Nokia.

Stalls arranged at the venue displayed various products and services offered by many startups and it was good learning experince talking to many of them. Checked out Amazon’s “Kindle” and Nokia’s upcoming touch screen handset N97 too. I also got a chance to check out OpenMoko phone.