title: Mysql process list too long with killed queries
body: <p>For several years I've been making automated daily database backups using a procedure iterating over existing databases.</p>
  <pre><code>mysqldump --user=${mysql_username} --password=${mysql_password} $db --single-transaction --events -R &gt;&gt; $normal_output_filename    
  </code></pre>
  <p>Recently I moved from a dedicated server (Centos 6, Apache 2.2, php5.6, Mysql 5.0 -as far I recall) to a VPS with Centos 7, Apache 2.4, php 7.2/5.6, MariaDB 5.5)<br />
  Recently, time to time SOME database accesses are slow and eventually &quot;time execution exceeded&quot;<br />
  I have a cron job to make a daily backup after 03:00 of all databases.<br />
  From <code>ps aux | grep mysql</code> I get</p>
  <blockquote>
  <p>root     15840  0.0  0.0 126772  3456 ?        SN   03:09   0:00 mysqldump --user=uuu --password=x xxxxxx information_schema --single-transaction --events -R</p>
  </blockquote>
  <p>which is on hold for several hours.<br />
  Once, I realized that problem after six days that mysqldump was on hold and no new db backups were performed.</p>
  <pre><code>show status like '%conn%';    
  </code></pre>
  <p>does not output anything, it stays on hold.</p>
  <pre><code>mysqladmin -uuser1 -p*** processlist     
  </code></pre>
  <p>(user1 is superuser) lists almost 8000 lines of Killed processes like</p>
  <pre>
  | 671958 | user1  | localhost | database1 | Killed  | 3 |   |                  | 0.000    |
  | 671959 | user1  | localhost | database1 | Killed  | 3 |   |                  | 0.000    |
  | 671961 | user1  | localhost | database1 | Killed  | 2 |   |                  | 0.000    |
  | 671962 | user1  | localhost | database1 | Killed  | 2 |   |                  | 0.000    |
  | 671963 | user1  | localhost | database2 | Killed  | 2 |   |                  | 0.000    |
  | 671964 | user2  | localhost | database3 | Killed  | 1 |   |                  | 0.000    |
  | 671965 | user1  | localhost |           | Killed  | 1 |   |                  | 0.000    |
  | 671966 | user1  | localhost |           | Query   | 0 |   | show processlist | 0.000    |
  +--------+-----+--------------+-----------+---------+---+---+------------------+----------+</pre>
  <p>I didn't restart mysql server yet. I can see some websites loading fast their pages which have several db accesses while Horde and Roundcube webmails reach the timeout and error 500.</p>
  <p>I don't realize why suddenly (it may be days before it happens) list of processes start growing with killed processes I don't know where they come from.</p>
  <p><strong>UPDATE 1:</strong><br />
  VPS at Contabo, 200GB SSD disk. 61.93 GiB used / 134.78 GiB free / 196.71 GiB total<br />
  Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz, 4 cores<br />
  CentOS Linux 7.7.1908<br />
  Linux 3.10.0-1062.9.1.el7.x86_64 on x86_64<br />
  At this time: CPU load averages 0.88 (1 min) 1.03 (5 mins) 0.95 (15 mins)<br />
  8GB RAM - At this time: 1.81 GiB used / 2.21 GiB cached / 7.63 GiB total<br />
  At this time: Uptime 2 days, 17 hours</p>
  <p><a href="https://pastebin.com/YbQw28wX" rel="nofollow noreferrer">MORE DATA</a></p>
  <p><strong>UPDATE 2</strong></p>
  <p>Added <code>thread_handling=pool-of-threads</code> to my.cnf</p>