Checking for Connections

In general it is not critical that all connections be stopped prior to a promotion as the script will promote in a safe fashion. Ideally you do want connections associated with background work to wrap up before the promotion so that work does not have to be restarted. These checks are designed to help prevent errors from showing up in the application about the database disconnecting client connections.

When you run the commands below you will see the query associated with your own connection, but generally, when accessing as your application user, should not see any other connections.

For PostgreSQL run the command:

psql -c 'SELECT pid, datname, application_name, client_hostname, waiting, query
FROM pg_stat_activity;'


For MySQL run the command:

mysql -e'show processlist'


Please sign in to leave a comment.

Powered by Zendesk