-
Notifications
You must be signed in to change notification settings - Fork 914
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
Connection reset by peer when dabase server cpu usage reaches 100% #613
Comments
What does postgres think happened to the connection? You should see something in postgres logs. |
First of all, thanks for this nice library! I'm using it to write a small benchmarking tool and have the same issue. Postgres is running in docker on the same machine on Linux. While docker logs show errors when a key constraint fails, there are no logs when this particular problem happens. On client side I get:
steps to reproduce:
install dbbench v0.2.0 or ...
run the benchmark:
After ~40 seconds the error occurs. |
On the other hand, it works with CockroachDB which also uses this Postgres driver.
Maybe it's an issue with Postgres. |
At least for me it seems to be a docker issue. It works when I run it using the package from the ubuntu repository. Same for MySQL. |
I meet the problem "read tcp 172.xx.xx.xx:39288->10.yy.yy.yy:5432: read: connection reset by peer", but the database server's cpu do not reach 100%,even not 60%. |
Those seeing
|
Our requirement is to execute thousands of queries per second on PostGres. Currently we are trying few hundred queries per second. We have database server with fairly high configuration (32 GB, 16 core).
ulimit set to 100000, database/sql max open connection config set to 30000 and max idle to 5000
Queries execute well till certain point but after some time cpu usage reaches 100%. and "connection reset by peer" error occurs. This in turn leads in application panic.
After some short interval when cpu usage starts gradually dropping from 100% . One approach we wanted to take was retry queries for some interval so that queries at least get chanceto get executed when cpu usage drops. Here this article they say default library mechanism is to retry 10 times and logic is hard coded https://www.vividcortex.com/blog/2015/01/19/gos-connection-pool-retries-and-timeouts/.
Could you help with how can I go about retrying queries by specifying certain retry time interval? Or is there any other way to resolve this problem?
The text was updated successfully, but these errors were encountered: