-
Notifications
You must be signed in to change notification settings - Fork 93
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
how to set properties of connection pool? #69
Comments
You can pass the same parameters you pass to the ngx keepalive method to the pg object's keepalive method https://github.com/leafo/pgmoon#success-err--postgreskeepalive |
But I didn't find parameters in the source code of pgmoon/init.moon and pgmoon/socket.lua. |
@gzliudan the I updated the package on opm |
thanks a lot. I updated pgmoon through opm command. Can you give an example how to set parameters of connection pool? |
-- when you want to return the connection to the pool:
pg:keepalive(timeout, pool_size)
-- if you need to configure the pool name:
pgmoon.new({
pool = "custom pool name",
-- ...
}) Generally you don't need to configure the pool name since it will choose a reasonable default based on connection settings. |
Thank you very much. |
Check out the docs https://github.com/openresty/lua-nginx-module#tcpsocksetkeepalive |
Thank you again. Maybe it's better update ReadMe. |
52 closed, continue here. There are similar issues: 47, 64 How to limit connections in openresty? The answer is here Basically, we cannot strictly limit connections, in practice, openresty group has more details, for example this |
such as pool's size, min and max value, keepalive time, etc.
The text was updated successfully, but these errors were encountered: