-
Notifications
You must be signed in to change notification settings - Fork 135
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
Resolve port conflict when starting multiple PMM agents #2573
Conversation
Hi @GuanqunYang193, can we learn the reason you run multiple PMM clients on the same machine? You can configure each PMM to use different port ranges to not have conflicts between them. |
Thanks for quick reply! We have multiple database instance deployed with docker on single machine and each database has their PMM agent because:
|
Using different port ranges can also be relatively complex in this shared environment. The number of available port on shared machines is limited. We also need to deploy new instance and remove old one, which means we have to manage the ports like memory management! |
Hi @GuanqunYang193,
Even with this feature implemented you still have to manage ports pmm-agent providing API on.
Althought I agree with this statement, I believe that it should be implemented other way: |
Thanks for providing another option! |
In our setting in production, we often deploy different instances of PMM clients on the same machines. However, we occasionally encounter port conflict issues, which are not automatically resolved until we restart the PMM client. The reason for this problem is as follows:
When the PMM client starts agents, it checks whether the port is unoccupied and then uses the selected port to launch other agents. However, when we start multiple PMM clients simultaneously (in our experiments, reproducing this problem consistently requires 5 or more concurrent instances), there is a race condition issue with the ports. This means that different clients simultaneously consider the same port available.
When the PMM client fails to start the agent process, it keeps retrying with the same parameters. This situation prevents the process from starting successfully.
Therefore, I submitted this PR to address the issue: