Reputation: 5346
We're scratching our heads the last couple of days trying to understand why some things seem a bit too slow with redis/ohm on our rails project.
The gist of it is that some requests to ohm/redis take around 100-200 ms, which seem rather high considering our high-expectations of blazing-fast performance.
The command we're running looks like:
Stats::TermStats.find(term_slug: 'term_slug', user_id: 123).to_a
It seems to us that we're not doing anything extremely complex or crazy. Our profiling (using miniprofiler) of this single command so far revealed the following:
slowlog get
on the redis-client does not show anything particularly slow on redis. Most of the redis command complete within less than 20 microseconds (0.02 ms)Our redis config is pretty much out-of-the-box with basically no tweaking. During testing the server is not doing much else.
Any suggestions how to improve performance / test what slows down things so much between redis and ohm/rails ??
Upvotes: 0
Views: 814
Reputation: 5346
In case anybody's interested, we seemed to have found the cause for this problem, and even a solution
TL;DR : use hiredis + tune the ruby GC parameters.
Upvotes: 1