SAN Drives question. Format 4k or 64k blocks

  • Summer90

    SSC-Dedicated

    Points: 32821

    I have never known how our server team formats the drives in 4k blocks or 64k blocks.   They gave me a new server and I installed it all and it is running fine.  Then a server engineer came to me later and said I formatted the drives in 4k blocks.

    Can anyone tell me if this is a major problem, minor issue or you probably won't notice.

    Then the question becomes, what is the recommended one?   and is there a way I can tell?

  • bmg002

    SSC-Insane

    Points: 22387

    recommended is 64k due to that being the size of an extent.

    An extent is 1 chunck of data that SQL requests.  Having your block size and extent size the same means that when SQL tries to read a 64K chunk, it can read 1 block which will be continuous and thus quick to read.  If you have a 4K block size, it needs to get 16 of them from disk which may or may not be in physical order on the disk.
    Lets say that it is a worst case scenario setup.  SQL asks for 1 extent, the first block it gets is the first block on the disk.  The second block is the last block on the disk.  Third is the second block on the disk and so on until you have all 16 blocks.  Presuming this is a spinning platter disk, it would need to jump back and forth across the disk repeatedly to get your 16 blocks.  Assuming this is an SSD, it would need to do 16 separate read requests from the disk.

    You put that as a 64K block size on the disk, when SQL asks for it, you only need to get 1 block and there is only 1 disk seek.  It will perform a lot faster when you have a heavy read operation.

    As for finding the block size it was formatted as, I do not know of a "good" way, but you can run chkdsk against the partition and when it is done, it will tell you the number of "bytes in each allocation unit" which is your block size.

  • Sue_H

    SSC Guru

    Points: 90260

    To get the current allocation unit size, from the command line:
    fsutil fsinfo ntfsinfo YourDrive:
    Look at bytes per Cluster for allocation unit size.

    Otherwise start diskpart, type list volume, type select volume <your volume number> and then type filesystems

    Sue

  • Perry Whittle

    SSC Guru

    Points: 233794

    bmg002 - Wednesday, June 7, 2017 2:19 PM

    recommended is 64k due to that being the size of an extent.

    An extent is 1 chunck of data that SQL requests.  Having your block size and extent size the same means that when SQL tries to read a 64K chunk, it can read 1 block which will be continuous and thus quick to read.  If you have a 4K block size, it needs to get 16 of them from disk which may or may not be in physical order on the disk.
    Lets say that it is a worst case scenario setup.  SQL asks for 1 extent, the first block it gets is the first block on the disk.  The second block is the last block on the disk.  Third is the second block on the disk and so on until you have all 16 blocks.  Presuming this is a spinning platter disk, it would need to jump back and forth across the disk repeatedly to get your 16 blocks.  Assuming this is an SSD, it would need to do 16 separate read requests from the disk.

    You put that as a 64K block size on the disk, when SQL asks for it, you only need to get 1 block and there is only 1 disk seek.  It will perform a lot faster when you have a heavy read operation.

    As for finding the block size it was formatted as, I do not know of a "good" way, but you can run chkdsk against the partition and when it is done, it will tell you the number of "bytes in each allocation unit" which is your block size.

    it's also irrelevant for the t-log drive as this does not use extents, the sector size is used for the log file layout.
    Better off just leaving this as default 4K NTFS cluster size

    -----------------------------------------------------------------------------------------------------------

    [font="Tahoma"]"Ya can't make an omelette without breaking just a few eggs"[/font] 😉

  • m.r.piatek

    Valued Member

    Points: 71

    To get the current disk Format you can go with PowerShell:

    get-wmiobject -class win32_volume|select Name, blocksize

     

    regards,

     

     

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply