Open timestee opened 7 years ago
25ms is three rotations of a 7200rpm disk. It has to flush writes to disk to ensure they're written in the proper order, and this is a problem with any ACID-compliant database.
You can batch updates together into a single transaction. There's also a db.Batch() method, or you can manage transactions manually with db.Begin and tx.Commit or .Rollback.
On server hardware, a non-volatile raid cache solves the commit delays. It reports back to the OS that the flush completed immediately, because it can guarantee that writes are committed even if the power fails or the OS crashes.
Testing Code:
The output running on SSD :
and on HDD:
But actually, we can not use bucket like delete_0 and put_0.
Can we enhance the performance?