Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Last active December 16, 2015 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahamas10/5498944 to your computer and use it in GitHub Desktop.
Save bahamas10/5498944 to your computer and use it in GitHub Desktop.
redis-server 2.4-eventport on smartos with libfasttime.so

redis-server and libfasttime.so

Testing out libfasttime.so with redis-server on SmartOS. see https://gist.github.com/bahamas10/5493551 for info on libfasttime.so.

Benchmarking done with DTrace and redis-benchmark from the redis source code

Without libfasttime.so

The library is NOT loaded

$ sudo pldd "$(pgrep redis-server)" | grep libfasttime.so

Running benchmark

$ ./redis-benchmark -h 192.168.26.83 -c 10 -n 100000 -q
PING_INLINE: 63492.06 requests per second
PING_BULK: 49850.45 requests per second
SET: 47778.31 requests per second
GET: 45372.05 requests per second
INCR: 47892.72 requests per second
LPUSH: 46554.93 requests per second
LPOP: 45167.12 requests per second
SADD: 46533.27 requests per second
SPOP: 49236.83 requests per second
LPUSH (needed to benchmark LRANGE): 49115.91 requests per second
LRANGE_100 (first 100 elements): 12003.36 requests per second
LRANGE_300 (first 300 elements): 4663.53 requests per second
LRANGE_500 (first 450 elements): 2994.73 requests per second
LRANGE_600 (first 600 elements): 2321.96 requests per second
MSET (10 keys): 23998.08 requests per second

With libfasttime.so

The library is loaded (set by the env variable LD_PRELOAD_64=libfasttime.so in SMF)

$ sudo pldd "$(pgrep redis-server)" | grep libfasttime.so
/opt/local/lib/libfasttime.so

Running benchmark

$ ./redis-benchmark -h 192.168.26.83 -c 10 -n 100000 -q
PING_INLINE: 63775.51 requests per second
PING_BULK: 57405.28 requests per second
SET: 51759.83 requests per second
GET: 55524.71 requests per second
INCR: 49701.79 requests per second
LPUSH: 57770.08 requests per second
LPOP: 59988.00 requests per second
SADD: 52137.64 requests per second
SPOP: 54200.54 requests per second
LPUSH (needed to benchmark LRANGE): 46816.48 requests per second
LRANGE_100 (first 100 elements): 12286.52 requests per second
LRANGE_300 (first 300 elements): 4176.94 requests per second
LRANGE_500 (first 450 elements): 3047.39 requests per second
LRANGE_600 (first 600 elements): 2217.79 requests per second
MSET (10 keys): 34614.05 requests per second

Results

  • PING_INLINE: 63492.06 => 63775.51 (1.004x)
  • PING_BULK: 49850.45 => 57405.28 (1.152x)
  • SET: 47778.31 => 51759.83 (1.083x)
  • GET: 45372.05 => 55524.71 (1.224x)
  • INCR: 47892.72 => 49701.79 (1.038x)
  • LPUSH: 46554.93 => 57770.08 (1.241x)
  • LPOP: 45167.12 => 59988.00 (1.328x)
  • SADD: 46533.27 => 52137.64 (1.120x)
  • SPOP: 49236.83 => 54200.54 (1.101x)
  • LPUSH: 49115.91 => 46816.48 (0.953x)
  • LRANGE_100: 12003.36 => 12286.52 (1.024x)
  • LRANGE_300: 4663.53 => 4176.94 (0.896x)
  • LRANGE_500: 2994.73 => 3047.39 (1.018x)
  • LRANGE_600: 2321.96 => 2217.79 (0.955x)
  • MSET: 23998.08 => 34614.05 (1.442x)
#generated with
awk '{ printf("%s (%.3fx)\n", $0, ($5/$3)); }' data.txt 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment