Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ioredis part 2 #138

Merged
merged 8 commits into from
Sep 7, 2018
Merged

Support for ioredis part 2 #138

merged 8 commits into from
Sep 7, 2018

Conversation

maritz
Copy link
Owner

@maritz maritz commented Aug 30, 2018

Continuation of #137

Huge thanks to @thepipster!

Open tasks:

  • Documentation (just a few words and one example, I guess) ✔️
  • Benchmarking ✔️

@maritz maritz mentioned this pull request Aug 30, 2018
@maritz maritz force-pushed the Treehouse-Interactive-master branch from 620ab0f to 4950b48 Compare August 30, 2018 11:45
@maritz
Copy link
Owner Author

maritz commented Aug 31, 2018

Hm, so for the simple stresstest benchmark using ioredis is actually quite a bit slower than node_redis.

ioredis

Starting stress test - saving and then updating 30000 models in parallel.
5578ms for 30000 parallel User saves, 5378.27 saves/second
Saves done, starting updates
3754ms for 30000 parallel User updates, 7991.48 updates/second
Total time: 9333ms

node_redis

Starting stress test - saving and then updating 30000 models in parallel.
4277ms for 30000 parallel User saves, 7014.26 saves/second
Saves done, starting updates
2335ms for 30000 parallel User updates, 12847.97 updates/second
Total time: 6612ms

(I did several of those, also tried 3000 and 10000 iterations, similar results)

So going from node_redis to ioredis incurs about 20-25% performance loss on saves. There is also an increased memory cost for ioredis in this test, but my measurements there are much less consistent. They point to about a 20% increase in memory used as well.

I would have assumed that the difference would be in ioredis' favor and would be much smaller. There might be simple explanations for this and this might not apply to real-world applications at all. When is an application going to do 30000 requests in parallel like this stress test? (they are all started as fast as possible in a single for loop, so backpressure handling in the redis client is most likely a factor).

So I will advise against using ioredis for nohm. You can still use ioredis in the rest of your application and just use node_redis for nohm, as far as I know the two should not cause conflicts.

@maritz
Copy link
Owner Author

maritz commented Aug 31, 2018

@thepipster do you think this is enough documentation for it? Should be different maybe?

Btw: Do you have a specific need why you need ioredis? Would you be able to test sharding or cluster support or work on it if it doesn't work?

@thepipster
Copy link

Thanks, yeah the specific need is cluster support. Bummer about the performance, that is interesting.

@maritz maritz merged commit f4fa805 into master Sep 7, 2018
@maritz
Copy link
Owner Author

maritz commented Sep 7, 2018

Merged and published as v2.2.0

@maritz maritz deleted the Treehouse-Interactive-master branch September 13, 2020 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants