C
C
comment2014-11-03 11:27:38
PHP
comment, 2014-11-03 11:27:38

Mysql threads explain behavior how to find bottleneck?

There is a php application (lighttpd + php-fpm + mysql). When a lot of users visit the site (about 3000), the mysql behavior becomes the following (I will give mysqladmin status data):
State 1. Everything works fine at first: Threads: 58 Questions: 462874 Slow queries: 3 Opens: 631 Flush tables: 1 Open tables: 624 Queries per second avg: 1081.481
State 2. As the load builds up and peaks, the following happens: Threads: 4 Questions: 737449 Slow queries: 3 Opens: 635 Flush tables: 1 Open tables: 628 Queries per second avg: 1258.445
In "state 2", it is impossible to connect to mysql and the site falls out at 500. It seems to be choking on what is happening and refuses to work =). After there are fewer users, mysql revives and returns to "state 1", threads start to be created and everything works well.
Why there is a drop in the number of threads and mysql itself at the peak moment I can’t understand. Moreover, when there are few threads, all of them (all 4) are in the sleep mode.
I understand that I have not described the entire architecture of the application, but as far as I understand, the bottleneck is mysql or the connection to it. Mysql is set up adequately, but if it's a matter of setting, please let me know where to turn my attention.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
comment, 2014-11-14
@comment

The bottleneck was the network. Users clogged the channel, and mysql simply did not reach, so the number of threads fell. Thanks to all.

P
Puma Thailand, 2014-11-03
@opium

with what error does the connection to the muscle fall out? Time-out?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question