title: How to solve mysql warning: "InnoDB: page_cleaner: 1000ms intended loop took XXX ms. The settings might not be optimal "?
body: <p>I ran a mysql import mysql dummyctrad &lt; dumpfile.sql on server and its taking too long to complete. The dump file is about 5G. The server is a Centos 6, memory=16G and 8core processors, mysql v 5.7 x64-</p>
  
  <p>Are these normal messages/status "waiting for table flush" and the message <code>InnoDB: page_cleaner: 1000ms intended loop took 4013ms. The settings might not be optimal</code> </p>
  
  <p>mysql log contents</p>
  
  <pre><code>2016-12-13T10:51:39.909382Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4013ms. The settings might not be optimal. (flushed=1438 and evicted=0, during the time.)
  2016-12-13T10:53:01.170388Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4055ms. The settings might not be optimal. (flushed=1412 and evicted=0, during the time.)
  2016-12-13T11:07:11.728812Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4008ms. The settings might not be optimal. (flushed=1414 and evicted=0, during the time.)
  2016-12-13T11:39:54.257618Z 3274915 [Note] Aborted connection 3274915 to db: 'dummyctrad' user: 'root' host: 'localhost' (Got an error writing communication packets)
  </code></pre>
  
  <p>Processlist:</p>
  
  <pre><code>mysql&gt; show processlist \G;
  *************************** 1. row ***************************
       Id: 3273081
     User: root
     Host: localhost
       db: dummyctrad
  Command: Field List
     Time: 7580
    State: Waiting for table flush
     Info: 
  *************************** 2. row ***************************
       Id: 3274915
     User: root
     Host: localhost
       db: dummyctrad
  Command: Query
     Time: 2
    State: update
     Info: INSERT INTO `radacct` VALUES (351318325,'kxid ge:7186','abcxyz5976c','user100
  *************************** 3. row ***************************
       Id: 3291591
     User: root
     Host: localhost
       db: NULL
  Command: Query
     Time: 0
    State: starting
     Info: show processlist
  *************************** 4. row ***************************
       Id: 3291657
     User: remoteuser
     Host: portal.example.com:32800
       db: ctradius
  Command: Sleep
     Time: 2
    State: 
     Info: NULL
  4 rows in set (0.00 sec)
  </code></pre>
  
  <p><strong>Update-1</strong></p>
  
  <p><a href="https://bugs.mysql.com/bug.php?id=81899" rel="noreferrer">mysqlforum</a> ,<a href="http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_lru_scan_depth" rel="noreferrer">innodb_lru_scan_depth</a></p>
  
  <p>changing innodb_lru_scan_depth value to 256 have improved the insert queries execution time + no warning message in log, the default was innodb_lru_scan_depth=1024;</p>
  
  <p><code>SET GLOBAL innodb_lru_scan_depth=256;</code></p>