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

[Question] Difference between connect pool_size and set_keepalive pool_size #247

Open
NicoAdrian opened this issue Mar 30, 2022 · 2 comments

Comments

@NicoAdrian
Copy link

NicoAdrian commented Mar 30, 2022

I don't understand the difference between:

red:connect("unix:/path/to/unix.sock", { pool_size = 1000 })

and this:

red:set_keepalive(10000, 1000)

Both create a pool a 1000 reusable connections, am I right ?
If so, why adding the pool_size option in set_keepalive and vice-versa ?

@NicoAdrian NicoAdrian changed the title [Question] Difference between [Question] Difference between connect pool_size and set_keepalive pool_size Mar 30, 2022
@zhuizhuhaomeng
Copy link
Contributor

the size from keepalive is deprecated, you can refer to https://github.com/openresty/lua-nginx-module#tcpsocksetkeepalive

@NicoAdrian
Copy link
Author

NicoAdrian commented Mar 31, 2022

the size from keepalive is deprecated, you can refer to https://github.com/openresty/lua-nginx-module#tcpsocksetkeepalive

I don't even have access to the underlying socket, how am I supposed to set keepalive ?

Edit: Ok I got it, I must use pool_size from the connectmethod

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

2 participants