Finds the optimal piece size for a given number of bytes.