Uncategorized

HOW TO : Check IO speed on a Linux Machine

For my notes.. if you ever want to check the IO capability of a disk (local or network) on a linux machine, use the following command

[bash] dd if=/dev/zero of=test.file bs=4M count=1000 [/bash]

The above command make a copy of the output from /dev/zero to a file called test.file (you can locate the file on the disk you want to measure) with a block size of 4M for a total file size of 4000Mb.

2011 Resolutions..

For the few folks that keep in touch with me through this website.. Happy New Year!! :). Hope this new year brings you health and love.

I am usually not a resolutions guy :).. But I wanted to give it a try this year. And I am making them public, so that I have more incentive (read pressure) to reach them. Without future adieu, here they are

  1. Take a look at this picture No.. not the part, where I am eating Jhanvi’s head :).. But that big fat gut hanging out for everyone’s viewing pleasure. Loosing that is my first resolution.
  2. Second picture..This is a picture of the traffic to this site, according to Google. I want to double that by the end of this year. In other words, write more often :).
  3. The third resolution doesn’t have a picture :). I have always wanted to get a CISSP certification. Well, this year, I am going to stop thinking and act on it.
  4. And finally, the fourth one is to go on a decent vacation. Ideally, some place exotic :)..And hopefully, we will have a visa to visit it.

Last run for 2010?

Jhanvi and I ran the 2010 Hot Chocolate 15K last Saturday (11/6/2010). I don’t know why I keep doing this.. but I don’t seem to realize that I am not a superman 🙂 and cannot run races efficiently without practicing. Anyways, here is what happens when you run a race without ANY training..

My Results

I was aiming to be the last in everything :).. but looks like some people still beat me..

Jhanvi’s Results

Thx to Jhanvi for making me run the race… I wanted to run the 5K and call it a day 🙂 (and no. it is not called cheating when it is 27 degrees and you are freezing your butt off!! 🙂 ).. but she encouraged me to run the 15K. Clearly not my best time.. but I am proud I completed it never the less.

Cloud Computing and your company's infrastructure

Bold forecast :).. But in 5 to 10 years, I predict the majority of a company’s infrastructure will be hosted in a “cloud”. If you recall (circa 2000..), most of the companies were hosting “anti-spam” services in house. If anyone suggested that we can outsource that service, you would get a “are-you-crazy” look :). And now, you will get the same look if anyone suggests they run the anti-spam service in house. I believe the same is going to happen for infrastructure. You might still be running some components in house, but it will get smaller and smaller. Companies will be forced to focus on their core competency rather than try to maintain an army of engineers to perform tasks that someone else might be a lot better at.

Speaking of being visionary, apparently Netflix operates most of their infrastructure in the cloud. If Netflix can operate in the cloud, a majority of us can too :). Here are some links regd their lessons from moving to a cloud.

http://blip.tv/file/4252897 (Video of Netflix Director of Engineering explaining their move to the cloud)

https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxwcmFjdGljYWxjbG91ZGNvbXB1dGluZ3xneDo2NDc2ODVjY2ExY2Y1Zjcz&pli=1 (Write up by a Netflix engineer about the move to the cloud from a storage and DB prospective)

2010 First Half Marathon

Guess what happens, when one runs a half marathon without any training? You break all records for finishing late :). Jhanvi and I ran the 2010 Rock and Roll Half Marathon in Chicago today. It was hot and humid.. but we managed to finish the run. Am so proud of Jhanvi for finished faster than me.. She just started running last year and I think she is a natural.

2010 August : Chicago Rock and Roll Half Marathon

HOW TO : Check status of bond interface in Linux

For my notes.. If you ever wanted to check the status of a bonded interface configure in Linux (esp RHEL), you can check the status by running the following command

[root@serverxyz bin]# cat /proc/net/bonding/bond0

i.e. assuming the name of your bond interface is bond0.

Output from the command

Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth3 (primary_reselect always)
Currently Active Slave: eth3
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:10:18:6e:b8:1a

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:21:5e:11:34:32

The configuration files involved are

/etc/sysconfig/network-scripts/ifcfg-bond0 (Bond Interface)

DEVICE=bond0
IPADDR=10.10.40.26
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
GATEWAY=10.10.40.1
NETWORK=10.10.40.0
BROADCAST=10.10.40.255
TYPE=Ethernet

/etc/sysconfig/network-scripts/ifcfg-eth3 (Primary Interface)

DEVICE=eth3
BOOTPROTO=none
ONBOOT=yes
HWADDR=00:10:18:6e:b8:1a
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
USERCTL=no

/etc/sysconfig/network-scripts/ifcfg-eth0 (Secondary Interface)

DEVICE=eth0
HWADDR=00:21:5e:11:34:32
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
TYPE=Ethernet

Lessons of the Trade : Purging Databases

We ran into an interesting issue at work recently. Documenting the solution for my records..

BACKGROUND : We had a table in one of our databases that served as a “hopping” point for some jobs. Data was inserted into this table and at jobs get kicked off at periodic intervals to “process” the data and delete it.

CURRENT METHOD : Launch multiple jobs to process the data and delete the rows as soon as the data is processed. This is causing locks on the table because there are multiple delete operations occurring at the same time. Which in turn means that the jobs cannot complete processing the data causing the table to grow in size.

PROPOSED METHOD : Add a new column to the table called “PROCESSED_STATE” and modify the “processing” jobs to set a flag “Y” in this column as soon as the data is processed. Create a new job that will be launched periodically, which checks the PROCESSED_STATE column and if the flag is set to “Y”, deletes the row.

Morale of the story.. 🙂 .. Multiple deletes on a table are bad. Better way is to have multiple updates and one delete.