Postgres db crash due to amount of connections/session and long wait times
Budget: €30 – €250 EUR
problem:
Postgres database often gets too much sessions/connections
which causes the database to crash.
remarks:
we see that most of the wait time is due to postgres db actions
such as autovacuum on pg_statistic (can be seen in aws rds)
Besides that also due to queries on the sms_audit table.
we also see that the table with name sms_audit is around 2.5 GB big
while when we take a copy of that table it is just 250 MB.
Therefore we tried to rename the old one and rename the new one too
so that our back end does not need to change but sadly we are not able
to delete or rename the sms_audit table in pg admin.
error message on delete: "String indices must be integers"
we also changed the rds type to a stronger type but that did not helped a lot.
Only the loadtime dropped enormously.
What we want:
We want to have an insight on why the database often gets those issues, why it creates so much session and
what happened/we can do regarding the sms_audit table and a solution for that problem/issues
Remark:
As this only happens in the production environment and not locally or on the test environment,
we need to be very carefull because when it is down, the company is down.
Prefarably work with auto commit OFF or when it really needs to happen we need to discuss a time frame.
We can provide any needed info to ensure the work can be done, regarding password and code etc.
Postgres database often gets too much sessions/connections
which causes the database to crash.
remarks:
we see that most of the wait time is due to postgres db actions
such as autovacuum on pg_statistic (can be seen in aws rds)
Besides that also due to queries on the sms_audit table.
we also see that the table with name sms_audit is around 2.5 GB big
while when we take a copy of that table it is just 250 MB.
Therefore we tried to rename the old one and rename the new one too
so that our back end does not need to change but sadly we are not able
to delete or rename the sms_audit table in pg admin.
error message on delete: "String indices must be integers"
we also changed the rds type to a stronger type but that did not helped a lot.
Only the loadtime dropped enormously.
What we want:
We want to have an insight on why the database often gets those issues, why it creates so much session and
what happened/we can do regarding the sms_audit table and a solution for that problem/issues
Remark:
As this only happens in the production environment and not locally or on the test environment,
we need to be very carefull because when it is down, the company is down.
Prefarably work with auto commit OFF or when it really needs to happen we need to discuss a time frame.
We can provide any needed info to ensure the work can be done, regarding password and code etc.
Related categories:
Linux
Amazon Web Services
Database Administration
PostgreSQL
Database Development