Currently we are utilizing Serilog to write some logs
The hardware team found out that our SSD is wearing out super fast. They asked us to change the size of each write to a multiplication of 4K
I found it really strange for a request this specific. I believe that what we should do is limit the amount of write we are doing, not specify the size, we can just set the rolling file appender to write/flush to disk at 25K and it would still be better than write to disk at exactly 8K
can someone confirm that writing a multiplication of 4K blocks should be better or not?
They are probably basing that on the SSD block erase size. With SSD's, you can only write either 1's or 0's, not both, so unless your just flipping only 0's to 1's or 1's to 0's in the block, you must erase the entire block. Erasure wears out the SSD, so you want to avoid writing less than a block's worth of data at a time.
Some SSD's can only write or erase an entire block at once. They can't reliably merge or append data to the end of a partially written block, but some can, if the driver is smart enough and the write cache policy allows sufficient delays. I have written drivers for flash memory in the past, but I am unfamiliar with the state of current SSD technology, so if someone comes along and educates me, I may have to revoke this as a possible answer.
The file systems defrag algorithms/policies can come into play here as well. At a very low level in the system, you can chose to waste a lot of space, by allowing partially written blocks to persist, but that can be extremely expensive in terms of disk provisioning.
Apologies for the multi-part answer here, but I am on a very unreliable internet connection at the moment...
So the short answer to your question is 'probably'. It depends on the actual device, exactly how big the block size is, and the device and OS/FS capabilities. You may want to ask a sys-admin type, whether there are OS/FS configuration levers you can pull to improve this situation. I suspect, if it can be improved, you wind up reformatting with a different cluster size. So the hardware guy's fix, is probably the best short-term solution.
Your mileage may vary.