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

Database connections not being closed #6

Closed
ghost opened this issue Apr 12, 2017 · 10 comments
Closed

Database connections not being closed #6

ghost opened this issue Apr 12, 2017 · 10 comments

Comments

@ghost
Copy link

ghost commented Apr 12, 2017

After upgrading to 6.2.16-1.20170331, we are now getting a significant number of idle sessions on the sympa database. If I don't close them by killing the backends we run out of available connections and that then impacts other services.

The last query executed in most of the sessions would appear to be
SELECT bounce_subscriber AS "bounce", bounce_address_subscriber AS "bounce_address", bounce_score_subscriber AS "bounc
e_score", custom_attribute_subscriber AS "custom_attribute", date_part('epoch',date_subscriber) AS "date", user_subscri
ber AS "email", suspend_end_date_subscriber AS "enddate", comment_subscriber AS "gecos", include_sources_subscriber AS
"id", included_subscriber AS "included", number_messages_subscriber AS "number_messages", reception_subscriber AS "rece
ption", suspend_start_date_subscriber AS "startdate", subscribed_subscriber AS "subscribed", suspend_subscriber AS "sus
pend", topics_subscriber AS "topics", date_part('epoch',update_subscriber) AS "update_date", visibility_subscriber AS "
visibility"+
FROM subscriber_table

@racke
Copy link
Contributor

racke commented Apr 12, 2017

@Godzone, which SQL database are you using?. Also please post the query as code, so I can copy it from here easily.

@ghost
Copy link
Author

ghost commented Apr 12, 2017

Sorry, I cut and pasted from pg_stat_activity.
DB is PostgreSQL 9.5.6 on x86_64-redhat-linux-gnu

@ghost
Copy link
Author

ghost commented Apr 12, 2017

SELECT bounce_subscriber AS "bounce", bounce_address_subscriber AS "bounce_address", bounce_score_subscriber AS "bounce_score", custom_attribute_subscriber AS "custom_attribute", date_part('epoch',date_subscriber) AS "date", user_subscriber AS "email", suspend_end_date_subscriber AS "enddate", comment_subscriber AS "gecos", include_sources_subscriber AS "id", included_subscriber AS "included", number_messages_subscriber AS "number_messages", reception_subscriber AS "reception", suspend_start_date_subscriber AS "startdate", subscribed_subscriber AS "subscribed" suspend_subscriber AS "suspend", topics_subscriber AS "topics", date_part('epoch',update_subscriber) AS "update_date", visibility_subscriber AS "visibility" FROM subscriber_table WHERE list_subscriber = 'list-owners' AND robot_subscriber = 'godzone.net.nz' ORDER BY email

@ghost
Copy link
Author

ghost commented Apr 12, 2017

This isn't the only query but seems to be the last that most of the sessions executed.

@ghost
Copy link
Author

ghost commented Apr 12, 2017

Its late here so will leave this until tomorrow.

@ikedas
Copy link
Member

ikedas commented Apr 14, 2017

@Godzone, can you try ---

  • checking query_start columns repeatedly.
    For example, if values of the column stick to the same times, queries may keep running or waiting. Otherwise, if new time values appear one after another while number of queries do not decrease much, simply many queries are issued.
  • checking log.
    If it is possible that queries are kept, please check Sympa log, pick the entries at the times queries started and show them us (encrypted passwords and parsonal e-mails would be masked).

And, I want to know what version of Sympa you have upgraded from.

@ghost
Copy link
Author

ghost commented Apr 14, 2017 via email

@ikedas
Copy link
Member

ikedas commented Oct 12, 2017

Stagnant issue. Closed for the present.

@ikedas ikedas closed this as completed Oct 12, 2017
@ghost
Copy link
Author

ghost commented Feb 17, 2018 via email

@ikedas
Copy link
Member

ikedas commented Feb 18, 2018

@Godzone, can you find out what function (not SQL statement) Sympa was executing when PostgreSQL executed DEALLOCATE? If possible, please show the log of Sympa around that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants