vmware-archive / go-pmem-transaction

Golang library for using persistent memory
Other
29 stars 5 forks source link

Memtier throughput very low with new changes #15

Closed jerrinsg closed 5 years ago

jerrinsg commented 5 years ago

Memtier benchmark throughput when run against go-redis-pmem is seen to be very low as a result of commit #e135bf8.

Throughput numbers after the commit:

$ ./memtier_benchmark --clients=50 --threads=4 --requests=10000 --data-size=1000 --pipeline=100 --ratio=1:0 --port=6378
[RUN #1 100%,  40 secs]  0 threads:     2000000 ops,   71357 (avg:   49741) ops/sec, 71.38MB/sec (avg: 49.76MB/sec), 300.39 (avg: 401.23) msec latency

Throughput numbers before the commit:

$ ./memtier_benchmark --clients=50 --threads=4 --requests=10000 --data-size=1000 --pipeline=100 --ratio=1:0 --port=6378
[RUN #1 100%,   5 secs]  0 threads:     2000000 ops,  406942 (avg:  360076) ops/sec, 407.06MB/sec (avg: 360.18MB/sec), 49.42 (avg: 55.39) msec latency

This is because of the increase in number of memory allocations. resetLogTail() now creates a new backing array for the log entries on each transaction release call.

On profiling go-redis-pmem CPU usage, the following stats were obtained: Before the commit: 23% of CPU cycles were spent in mallocgc() After the commit: 47% CPU cycles spent in mallocgc

CPU profiling data from both the runs attached to this issue. data.zip