[CentOS] Optimum Block Size to use

Wed Aug 19 03:38:19 UTC 2015
Jatin Davey <jashokda at cisco.com>

Hi All

We use CentOS 6.6 for our application. I have profiled the application 
and find that we have a heavy requirement in terms of Disk writes. On an 
average when our application operates at a certain load i can observe 
that the disk writes / second is around 2 Mbps (Average).

The block size set is 4k

*******************
[root at localhost ~]# blockdev --getbsz /dev/sda3
4096
*******************

OS , Kernel Version:

*****************
[root at localhost ~]# uname -a
Linux localhost 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 
2014 x86_64 x86_64 x86_64 GNU/Linux

[root at localhost ~]# cat /etc/*release
CentOS release 6.6 (Final)
CentOS release 6.6 (Final)
CentOS release 6.6 (Final)
*****************

File-System being used:

********************
[root at localhost ~]# df -T
Filesystem     Type  1K-blocks     Used Available Use% Mounted on
/dev/sda3      ext3  100934056 20298152  75508688  22% /
/dev/sda1      ext3     198337    34459    153638  19% /boot
tmpfs          tmpfs  16440152        0  16440152   0% /dev/shm
*********************

I have a few queries with respect to the block size being set in the system:

1. Is 4k the optimum block size considering the amount of writes / 
second the application performs ?

2. How do i find out the optimum block size given the application load 
in terms of reads / writes per second ?

3. If there is a better block size that i can use , Can you suggest one ?

4. What are the pros / Cons of changing the default block size ?

5. We use ext3 as the file system for the partition which has heavy 
writes per second , Should we migrate it to ext4 ? Any pros / cons for it ?

Appreciate any response / pointers in this regard.

Thanks
Jatin