Low performance in queries when we get several connections

Hi all,

We are testing our database performance using JMeter. Our test call to a web service starting with 10 to 600 users on a time range of 15 minutes. The process adds them in a linear increase.

At some moment, the number of threads growth dramatically, coinciding with high consumption of CPU. We are not sure if this is a normal situation… We already review some indicators, but we couldn’t see anything relevant. Do any of you have this situation before?

In the attached image, you can see this situation.

The system is configured in this way:

Database
[LIST]
[]Percona MySQL Server 5.7.25.
[
]1 instance.
[]Mainly innodb engine.
[
]No clustered.
[]Buffer-pool: 5GB
[
]innodb_flush_method = O_DIRECT
[]sql-mode = “”
[
]key_buffer_size = 512M
[]max-connections=500
[
]max_allowed_packet = 512M
[/LIST]Virtual Machine (MySQL)
[LIST]
[]4 vCPU’s
[
]8 GB Memory
[]50 GB SSD
[
]OS: CentOS Linux release 7
[/LIST]
I hope someone can give us a hand. If you need other graphs, do not hesitate to asking for them.

Regards.
Thank you!

Hi @“pablo.barrachina”
To start with analyse your slow queries. Enable slow log and also use ‘long_query_time’ (it depends what is slow for your application). Identify slow queries, check explain plan and tune to best possible way. 

Some reference : You can refer to below blog for better understanding or step-by-step approach.
https://www.percona.com/blog/2020/04/23/a-simple-approach-to-troubleshooting-high-cpu-in-mysql/

Hope this helps…