[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 693
  • Last Modified:

What is significance of the block size of each 4k and 8k , in Linux operating system

Dear experts,
I bit unclear in the idea on the block size of operating system. What is significance of each block size concept in the operating level? What is benefit having higher block size than lower?
Please elaborate in this respect.


Thanks for all in advance.
0
mansur_mca
Asked:
mansur_mca
  • 3
  • 2
1 Solution
 
omarfaridCommented:
Hi,

When a file is created it is allocated a block. The file data is written to this block till it is full and then another block is allocated, and so on.

If small (say 1k files) files are created on a file system, then a small block size is better since if the block size is big, you will have less blocks to allocate and hence less files can be created on the file system.

If small files are created on a big block size file system, then space is wasted or the file system will accommodate more than one file in a block (this is called fragmentation) and the overhead will be high in managing such blocks and files.

The block size has impact over the performance of the system.

In general, if you expect to have large number of small files, then have a small block size on the file system. If you expect big files then have a big block size.

Please see

http://www.docs.hp.com/en/B3929-90011/ch05s02.html
http://en.wikipedia.org/wiki/Comparison_of_file_systems
http://www.linfo.org/get_block_size.html
http://www.sunmanagers.org/archives/1999/0242.html
http://www.ixora.com.au/tips/buffered_block_size.htm
0
 
mansur_mcaAuthor Commented:
exellent omarfarid ... reacting so soon .
In the modern computing most of the organisations recommanding for 8k rather 4k.  
I am just wondering ,is this irrespective of their requirement how  all widly opting for 8k than 4k.  can you share you  view on this ...

thanks for ur understanding ...
0
 
omarfaridCommented:
Hi,

Well it depends on the nature of your system and the size of the files that will be created on the file system.

e.g.

If your files sizes is in the range of 2 to 4K, then it will be faster to write and read if the block size is 4k.

If you have large files then 4k blocks will make it more writes and reads when you create the file and read it.

If you have files is MBs then it could larger block sizes since reading will be faster.

It all depends on your needs and nature of your system. Most of the books / guides recommend block size of 4/8k, while I have seen 32k block sizes.
0
 
mansur_mcaAuthor Commented:
i impressed the way that you have answered the query.
experts like you are more valuable for this community . keep this journey going ....  hope we meet in next question
0
 
omarfaridCommented:
You are welcome :)
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now