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

Expose more information about state of worker queue #790

Open
matthew-white opened this issue Mar 9, 2023 · 0 comments
Open

Expose more information about state of worker queue #790

matthew-white opened this issue Mar 9, 2023 · 0 comments
Labels
enhancement New feature or behavior

Comments

@matthew-white
Copy link
Member

I was watching the pg_stat_activity on the QA server when pm2 was running one instance. I observed the following (copying from Slack):

Even though there was only one pm2 instance, I saw 5 different queries at about the same time from a worker checking for work. I would only expect there to be 1. We spin up a new worker if the existing worker seems to be stuck, but I’m realizing that we never spin down the new worker. So a server could have a growth in the number of workers over time. I’m not sure that’s really the explanation here though, because the 5 queries were all in the same second.

The 5 queries stuck around in pg_stat_activity for a few seconds. I’d expect them to be nearly instantaneous. Their state was idle, so maybe that has something to do with it.

Follow-up idea here: add an option for more verbose logging or other monitoring of the workers. It’d be nice to have more information about the number of workers and how long each of their queries is taking, including the check for work. Right now, it can be hard to gain insight into what’s happening in the worker queue.

@matthew-white matthew-white added the enhancement New feature or behavior label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or behavior
Projects
None yet
Development

No branches or pull requests

1 participant