Sunday, May 15, 2011

Smile a bit

Simple, elegant smile is what we expect everyday from everybody. It’s not that difficult neither complex to give a good smile. Smile can be results of simple foolish joke to a rocket science story. Sometimes you smile because you happy or maybe you want to pretend that you are happy. Even being happy has different meanings.

When you are really happy you smile, sometimes you even don’t know that you’re smiling. When you are part of an audience you need to smile when others smile. Cause I don’t want to destroy my reputation. Sometimes I just want to runaway then I do smile ;)

Whatever intention smile is always good. It always makes someone happy. Except you blow up eyes of the receiving end.

During my life time I saw so many advertisements, sayings, and stories and even by experience smile is so simple important.

But it’s going to be different from this moment onwards. I am writing this on top of small desk in hospital. We had several hard days with my 2 months baby. She is infected with germ that causes fever and limp node enlargement just below right ear. We have spent lot of time just to get a Simple Single Smile. We feed her. Medicate her. But she just refused to smile. Only positive idea came to my mind was maybe she smile when she is feel terrible.

I have planned everything before I came down to Sri Lanka from Singapore. But germ causes my vacation to be in a hospital. Fortunately my mum and dad work in health department. So we get served very well. Otherwise you know what would be the outcome. But she is still not fully recovered. Even I had asked for extension of my annual leaves.

Well now I have so many issues. I am running out of annual leaves, money, and my customer chasing me for the last 10 days. But I didn’t reply to him yet. I didn’t check my emails for last 10 days. But the biggest issue is getting that Simple Single Smile. Just 30 minutes ago she gave the smile may be because of dedicated medication. Whatever the reason is its feel so good when she smiles.

Now I know how much difficult to get a Simple Single Smile. And the Smile that will definitely change my life

22-04-2011

Monday, May 9, 2011

File Compression

Why you need to compress file, simple and single requirement is reduce file size. Save disk space.
When to compress, No need to be genius simply every day we compress files. It will reduce bandwidth usage during file transfer. And importantly it will save space on backup storage devices on production systems. So that makes backup stay for long period of time, before it overwrites by recent backup files.
Which method to use, simply on windows I use Winrar or Winzip. In Linux it is Tar or Gunzip. It is something to think about?
Well, I thought it is not be serious problem.
Then sometime back I compare the different methods.
Server I used is 6GB Ram with 4 Dual-Core AMD Opteron processors running rhel4.7.

Bzip2

Compressed file is a text file.
Average CPU usage is 90-99% during compression. But sometimes CPU usage exceed 100% also
Memory usage is around 1%
Original text file size 1135782806
Bunzip2 file size 30722634
Size reduction 1105060172(bytes). Reduction percentage 97.29%
Time elapsed - 528 sec

Gzip

It’s the same text file.
Average CPU usage is less than 1%.
Memory usage is very low. Less than 1%
Original text file size 1135782806
Gzip file size 51512452.
Size reduction is 1084270354. As a percentage 95.46%
Time elapsed 23 seconds.

Tar.gz

This is what I commonly used for archive and compress. So I want to know how efficient it is.
Average CPU usage is less than 1%.
Memory usage is very low. Less than 1%
Original text file size 1135782806
File size reduction 1135782806 --> 51512524. Ratio is 95.46%
Time taken is 23 seconds.

Zip

CPU usage is 90-100%. Memory usage is very low. Around 0.1%
File reduction was 1135782806 --> 51512601. Ratio is 95.46
Time taken was 27 seconds

Compression type you need is really depending with the requirement. If you have separate backup server, only have few script to run and if you don’t mind the CPU usage during file compression bzip2 is your choice. It will reduce file size to minimum. But remember it will eat up your CPU. Also need much more time.

For me gzip full fill my requirements. Compression ratio is less than bzip2 but not harm on CPU usage. So I can use it with production servers. And I do have lot of scripts on my crontab so the time need for compression is also important for me. Tar.gz also which I was currently using do the same. So basically I don’t need to change my backup scripts.

But whenever I need to do a file transfer I will prefer bzip, cause it is reduce the file size significantly when you compare with gzip.


So end of the day it always gonna be you to decide.