Skip to content

Using a LUA script to write the subscriptions - #30

Closed
smasry wants to merge 1 commit into
anycable:masterfrom
smasry:lua_write_subscription
Closed

Using a LUA script to write the subscriptions#30
smasry wants to merge 1 commit into
anycable:masterfrom
smasry:lua_write_subscription

Conversation

@smasry

@smasry smasry commented Jan 13, 2023

Copy link
Copy Markdown
Contributor

Using a LUA script to write the subscriptions to redis.

@Envek

Envek commented Jan 17, 2023

Copy link
Copy Markdown
Member

Hey, thanks for the pull request!

Why you decided to use Lua? Is there any performance bottleneck you hit into, and how much Lua improved the situation?

@smasry

smasry commented Jan 20, 2023

Copy link
Copy Markdown
Contributor Author

@Envek There are performance improvements using LUA. In testing we see a ~50% reduction from an average of 4ms to a 2ms when calling write_subscription with using a LUA script.

@Envek

Envek commented Jan 20, 2023

Copy link
Copy Markdown
Member

Oh, wow, drop from 4 to 2 ms is a lot. It is surprising, tbh.

Interesting, what Redis server are you using and how “far” it is from your application? High RTT can be a cause for this distinction.

Also, do you use broadcasting and how many subscriptions per fingerprint you have? I tried to optimize this use case in #28, but didn't finish yet (maybe it is related, not sure).

@smasry smasry closed this Mar 29, 2023
@smasry
smasry deleted the lua_write_subscription branch March 29, 2023 18:15
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.

2 participants