Mysql引數解釋---wait_timeout、interactive_timeout

dimen007發表於2011-06-14
引數:interactive_timeout、wait_timeout

官方解釋:
    interactive_timeout
           The number of seconds the server waits for activity on an interactive                               connection before closing it.
          等待一個互動程式變成活動狀態的最長時間
     wait_timeout
           The number of seconds the server waits for activity on a noninteractive                           connection before closing it. This timeout applies only
           to TCP/IP and Unix socket file connections, not to connections made using                  named pipes, or shared memory.
            等待一個未互動程式變成活動狀態的最長時間

首先理解互動程式,它指的是這個程式正在等待該程式的提交、撤銷操作;未互動程式指的是該程式的一個操作已經完成,正在sleep,等待下個操作進行。

實際操作看看這兩個引數的效果:
SET GLOBAL interactive_timeout=20;
SET GLOBAL wait_timeout=50;

 s1  s2
start transaction        
 update t set c1 = 1;  
 等待20s不提交  
 發現直接被斷開  
   update t set c1 = 1

 等待50s
   被直接斷開
   


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12309491/viewspace-697887/,如需轉載,請註明出處,否則將追究法律責任。

相關文章