Live data from Hacker News

An Afternoon of Code Golf in Lua to Achieve 4x Performance in Redis

amplitude.engineering

11–16 of 16 posts

Re: An Afternoon of Code Golf in Lua to Achieve 4x Performance in Redis

#11

Running MONITOR in production can severely affect performance, by 50% per monitoring client according to the documentation. twemproxy independently exposes some statistics, it's probably safer to do it that way.

OP may want to try "INFO commandstats" to get the same metrics in a much cheaper way. Example output:

    # Commandstats
    cmdstat_info:calls=1,usec=57,usec_per_call=57.00
    cmdstat_cluster:calls=8,usec=211,usec_per_call=26.38
    cmdstat_zrange:calls=4,usec=1990,usec_per_call=497.50

Re: An Afternoon of Code Golf in Lua to Achieve 4x Performance in Redis

#12
post #11

Running MONITOR in production can severely affect performance, by 50% per monitoring client according to the documentation. twemproxy independently exposes some statistics, it's probably safer to do it that way.

OP may want to try "INFO commandstats" to get the same metrics in a much cheaper way. Example output: # Commandstats cmdstat_info:calls=1,usec=57,usec_per_call=57.00 cmdstat_cluster:calls=8,usec=211,usec_per_call=26.38 cmdstat_zrange:calls=4,usec=1990,usec_per_call=497.50

Excellent remark. Note that antirez is Salvatore Sanfilippo, the author of redis. Kudos

Re: An Afternoon of Code Golf in Lua to Achieve 4x Performance in Redis

#13
post #10

I really wonder why redis hasn't implemented HMINCRBY. Have run into that issue a bunch of times and the Github issue just doesn't convince me.

It's a commonly used primitive and I'm tempted to do it sometimes, but the problem is that there is no clear semantics. For instance in the blog post, apparently, the author is interested in incrementing multiple fields of the same key, while the proposal on the Github issue, wanted to increment different keys. Unfortunately to extend HINCRBY to make it variadic is hard because the return value would change... At the…

Thanks for responding (and for Redis)! That makes a lot more sense now, would love to see the older commands get new, more powerful versions :)
Post reply on HN