Only one service shows strange connect information

hello.
The number of thread connects is displayed strangely.

in mysql tool
show global status like ‘%thread%’
At Threads_connected I get 363. I’ve never exceeded 1000.

Currently in Prometheus

avg by(service_name) (max(max_over_time(mysql_global_status_threads_connected{service_name=“$service_name”}[$interval]) or
max_over_time(mysql_global_status_threads_connected{service_name=“$service_name”}[5m])))

, the number of threads is more than 1000.

In the case of other servers, it is roughly similar (not correct), but the gap difference is too large for only one server.

Where should I look?

Hello @shshwe2,

So, what I think is, this is wrong comparison…

Documentation says: Threads_connected. The number of currently open connections
But the promql specified is showing you maximum value of threads_connected over that interval.

Is this server that you’re talking about is a primary or high traffic compared to others?
Can you also add output of:
show global variables like '%max%conn%';
show global status like '%max%conn%';
show global status like 'thread%';

Thanks,
Kedar.

Thanks for the reply

show global variables like ‘%max%conn%’ is
is set to 3000

show global status like ‘%max%conn%’ has value 1748.

Currently show global status like ‘thread%’ is about 403

I hit 1000 or more when there are conjoint players, but when it doesn’t, I keep it around 200-600.

However, the maximum average value of the range (from 15 minutes ago) exceeds 1000.

Other servers have a similar number of concurrent users as I thought,

Only one server is weird.

If you want to keep getting the maximum value during that period, do you have to modify promql?

I hope I understand your response to my queries correctly :slight_smile:
anyhow, I’d plot only mysql_global_status_threads_connected{service_name=“$service_name”} and compare it with current time.

Thanks,
K