Skip to content

Instantly share code, notes, and snippets.

@lorneli
lorneli / benchmark-redis-aof-fysnc
Last active February 19, 2020 16:45
Benchmark redis aof fsync policy
1.Test environment
4core 2gb (use 4core so background fsync thread used by AOF_FSYNC_EVERYSEC can execute on other core)
ubuntu server 14.04
redis-version: 3.2.8
2.Procedure
Disable rdb bgsave, aof rewrite in config to avoid other factors
Set 'appendfsync' entry tto 'no', 'everysec' and 'always' in turn
for each policy:
@lorneli
lorneli / benchmark-redis-store-large-value
Last active March 18, 2017 16:12
benchmark-redis-store-large-value
Since redis uses single thread to process client requests one by one, storing large value for a key blocks others.
I tested how long this takes in different size value.
1.Test environment
4core 2gb
ubuntu server 14.04
redis-version: 3.2.8
2.Procedure
Disable persistence.
package node
const elemSize = 128
type node struct {
inodes []*inode
}
type inode struct {
k []byte