I wonder if a more robust option is to peek in the sysfs queue info on Linux.
It has some nice information about hardware io operation limits, and also an optimal_io_size hint.
https://www.kernel.org/doc/html/v5.3/block/queue-sysfs.html