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

Proxysql to mysql connection bottleneck #4696

Open
chanakagl opened this issue Oct 7, 2024 · 4 comments
Open

Proxysql to mysql connection bottleneck #4696

chanakagl opened this issue Oct 7, 2024 · 4 comments

Comments

@chanakagl
Copy link

chanakagl commented Oct 7, 2024

This morning, we experienced a significant increase in traffic to our system, resulting in a rise in active frontend and backend connections. However, we've noticed latency issues specifically with database queries, despite those queries being well-optimized. This latency seems to occur primarily when load increases.

To address this, we've increased the pool size on the application side to prevent exhaustion during peak traffic periods, and we can confirm that our backend MySQL servers have sufficient headroom to handle the load. Additionally, our ProxySQL instances, which each have 8 vCPUs, have not exceeded 50% CPU utilization, even with the MySQL thread set to 8 in the ProxySQL configuration.

Given that ProxySQL appears to be underutilized, I wonder if there are additional settings or configurations we should consider to optimize performance and better manage peak traffic. Any insights would be appreciated.

Front end connections:-

image

backend connections:-

image

Proxysql CPU:-

image

@renecannao
Copy link
Contributor

Hi @chanakagl .
Be aware that mysql-threads is one of the only 2 variables that cannot be changed at runtime, thus it is possible that mysql-threads is still 4 if you loaded to runtime without a restart.
Important: do not try to load to runtime and later save to disk, as load to runtime will fail and revert the change. Instead, save to disk and restart.

@chanakagl
Copy link
Author

I checked that all proxysql and mysql-threads is fine it's set to 8 in runtime_global_variables table as well. Could you please suggest if there is any other setting that we need to check on?

@chanakagl
Copy link
Author

@renecannao I increased the mysql_threads in ProxySQL to 2 times the number of CPUs, which helped resolve the issue to some extent. However, during high traffic, ProxySQL still doesn't fully utilize the available resources, with CPU usage remaining at only 50%. As a result, we've had to horizontally scale the system to handle the increased load.

@chanakagl
Copy link
Author

@renecannao could you please help here?

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

No branches or pull requests

2 participants