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

Async client for use with ngx_mruby? #106

Open
travisbell opened this issue Oct 4, 2022 · 0 comments
Open

Async client for use with ngx_mruby? #106

travisbell opened this issue Oct 4, 2022 · 0 comments

Comments

@travisbell
Copy link

travisbell commented Oct 4, 2022

Hello again @matsumotory!

As I mentioned in my other post, I've been playing around with ngx_mruby a fair bit over the past few days and so far, until I got to Redis, I couldn't see any meaningful performance difference between Lua and mruby. Certainly nothing siginificant enough to make me not choose to write Ruby over Lua. 😉 That is, until I got to Redis.

I use Redis as a distributed rate limiter and in the OR world, have benchmarked it well into the 20k rps range on a single instance. With mruby_redis, it seems as though I am getting approx. half the performance. On my local machine the lua implementation performs around 9k rps, while the mruby version is around 4.5k rps. One difference right off the bat is that I don't think mruby-redis supports any async features at the moment, correct? While the OR Redis client is all properly non-blocking. So this is not a very fair comparison.

I saw an old pr where you had been playing around with it but ultimately closed it. Is there any intention to resurrect an async Redis client in any way? I did see that @Asmod4n's library has an async client but have not tested it yet. That was going to be my next task. Edit: it looks like the mruby-hiredis gem needs mruby 3 (mruby 3 changed some number handling), so this is not an option.

Thanks again.

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

No branches or pull requests

1 participant