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

Performance test #55

Closed
rohitjoshi opened this issue Feb 7, 2017 · 4 comments
Closed

Performance test #55

rohitjoshi opened this issue Feb 7, 2017 · 4 comments

Comments

@rohitjoshi
Copy link

rohitjoshi commented Feb 7, 2017

I came across a blog post: http://mansion.im/2014/speed-comparison-of-postgresql-modules-for-nginx-openresty/ showing performance comparisons.

The fastest solution was ngx_postgres. My 1000 times loop took 1.3 sec.
 The second fastest solution was lua-resty-postgres which took 1.8 sec. 
And then, I tested pgmoon which took 4.4 sec. I guess it was slower because it does type conversion in Lua, although I am not sure that this is the only reason.

Have you done performance analysis?

@ttfkam
Copy link
Contributor

ttfkam commented Feb 8, 2017

There's not much info to work with there. Were keepalives used with pgmoon? As for the differences, lua-resty-postgres doesn't support MD5 authentication, SSL connections, async notifications, arrays, hstore, json/jsonb or work outside of an OpenResty context. ngx_postgres doesn't work directly with Lua as a native nginx module; ngx_postgres requires the use of nginx location handlers and output filters.

Could pgmoon be profiled and optimized further? Probably. However comparisons with the other implementations are very much apples vs oranges.

@rohitjoshi
Copy link
Author

Thanks for the details. I am using OpenResty with MySQL and wanted to switch to PostgreSQL but was not sure about performance related to pgmoon and that's where I found this article. Have you compared pgmoon with other native drivers for performance?

@ttfkam
Copy link
Contributor

ttfkam commented Feb 9, 2017

I have not personally, no, so take anything I'm saying here with a grain of anecdotal salt.

DB query processing, drive I/O, and network latency have always dominated any benchmarks I've done in the past. There's always room for improvement, but I personally use solutions like pgbouncer to mitigate network effects like connection speed. Whether pgmoon or some other driver, connections to pgbouncer on localhost are wicked fast compared to anything else in the stack.

@leafo
Copy link
Owner

leafo commented Oct 14, 2021

Closing old issues. I never wrote any benchmarks. In my experience this client library has never been a bottleneck in the apps I've worked on. Queries are going to be much slower than whatever raw throughput this library is capable of.

@leafo leafo closed this as completed Oct 14, 2021
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

3 participants