Friday, April 22, 2011

How to create bigger than 2TB partition table on linux?

■ Requirement : create bigger than 2TB partition table
■ OS Environment : Linux[RHEL, Centos]
■ Application: parted
■  File system : ext3, ext4,xfs, gfs
■ Implementation Steps : 

Partition table msdos has limitation of partition table size and it is less than equal 2TB. Use parted command to change the partition table type to support more than 2TB size. Please do like :

$parted /dev/dev_name
$mklabel gpt

Monday, April 11, 2011

How to compress and uncompress image file on linux?

■ Requirement : How to compress and uncompress image file
■ OS Environment : Linux[RHEL, Centos]
■ Application:gzip
■ Implementation Steps : 

uncompress the image and extract the archive into /tmp/initrd

$ gzip -dc < /tmp/initrd.img | cpio -idv ----- or ---- zcat -d image|cpio -idv ---- 2


a) Generate a list of files to be made into a new cpio archive.

$find . -depth -print | cpio -ovc > ../custom-initrd.cpio

b) gzip the cpio image:

$gzip -9 ../custom-initrd.cpio

worker(ie threaded) MPM vs pre-fork(non -threaded) MPM

      Apache comes in a few different flavours. The two most common are pre-forked (multi-process) and multi-threaded (worker).

If you're doing lots of little static connections, threads would be lighter and faster. If you just have few big apps constantly spawned, prefork might have an edge due it's maturity and stability.

        The multi-threaded version often faster and takes less memory. Apache must fully support a multi-threaded environment. Modules that are not 100% thread-safe can cause Apache to crash or behave strangely. The pre-forked version takes more memory. In a VPS, like your Zerigo Server, memory’s usually a fairly important concern. However, the pre-forked version also alleviates the need for modules to be fully thread-safe.

In general, I recommend using the multi-threaded version of Apache only if you are confident that all of the rest of your software stack will support it. If it won’t, or you’re just unsure, then you should run the pre-forked version. Using more memory is definitely better than having things crash or be otherwise unstable.

          One of the most common add-on modules, PHP, has some thread-safely problems. To be fair, the core of PHP is supposed to be fine in a multi-threaded Apache. However, some of the third-party libraries used by PHP are not thread-safe. This has the downside of needing to use the pre-forked version of Apache if you plan to use PHP running from inside Apache as a module (using mod_php, which is by far the most common way of running PHP).

When running PHP via mod_php, choose pre-forked. When running only static files (html, jpg, etc), choose multi-threaded. If passing on to a backend application server like Mongrel (for Ruby on Rails), the multi-threaded version works fine.

If you’re mixing and matching uses and even one use, in one virtual host, requires the pre-forked version, then pre-forked will need to be your choice.

If you want all the available server resource put to the best use and get the best performance out of your server, you could switch to worker from the default prefork.

If you would rate stability more, then you would rather prefer prefork to worker.

The decision actually is not that obvious. It warrants expertise, and in-depth analysis of your exact requirements.