-
Notifications
You must be signed in to change notification settings - Fork 64
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
Could not process server: Error collecting pg_stat_statements: pq: canceling statement due to statement timeout #164
Comments
The pganalyze container pointed at the heavy mirror is using a bunch of memory compared to the other instances for some reason:
May be unrelated. |
@caleb15 Could you try doing a "SELECT pg_stat_statements_reset()" to see if that addresses the timeouts? (when the Postgres query text file grows very large, retrieving the text sometimes takes too long) |
Sure, I'll try that out, although I still don't see how it can be timing out with statement timeouts disabled. Unrelated question: when you recommended that I set |
@caleb15 Yeah, 24h is a good place to start - in my experience that resolves the issues 90% of the time. The reason the statement_timeout setting doesn't take effect is because the collector sets a session-local session timeout: collector/input/postgres/establish_connection.go Lines 95 to 104 in 30e17bf
|
I enabled it, I'll see if that fixes it. For the |
@caleb15 I would set it on all the servers where you are seeing timeouts. In addition, make sure you have created the helper function on the primary, so its available for both primary and replicas:
(to be created as a user that has superuser / rds_superuser or similar permissions) |
This appears to have worked, thanks! |
@lfittl it's happening again with all the mirrors. I already had the reset set to 24h for all mirrors. Should change the reset to every 12h, or maybe increase the timeout? The statement timeout is at 30s and the query text timeout is at 120s. |
Yeah, reducing the reset time interval sounds like a good next step. Also its worth double checking that you can run |
Reducing the reset time interval didn't work 😢 I confirmed that I can run reset stat statements. Maybe I should try increasing |
@caleb15 Lets get together in a call to debug this further - I'll send you an email to follow up in a moment. |
In our docker container I am seeing frequent errors like below:
The database it is connecting to does not have a statement timeout:
The text was updated successfully, but these errors were encountered: