Personal Opinion: Timeouts
I can find most of MySQL’s “timeout” variables with a SHOW statement:
mysql> show variables like '%timeout%';+----------------------------+-------+ | Variable_name | Value | +----------------------------+-------+ | connect_timeout | 10 | | delayed_insert_timeout | 300 | | falcon_lock_wait_timeout | 50 | | innodb_lock_wait_timeout | 50 | | ...................................| | interactive_timeout | 28800 | | net_read_timeout | 30 | | net_write_timeout | 60 | | slave_net_timeout | 3600 | | table_lock_wait_timeout | 50 | | wait_timeout | 28800 | +----------------------------+-------+ 11 rows in set (0.01 sec)
The straightforward list conceals several anomalies and buried controversies.
* Should we allow non-integer values like 0.55 seconds, or perhaps make all values milliseconds rather than seconds, in order to reflect the importance of blocking for as little time as possible?
* Should we allow the value to be zero? If so, does zero mean “there is no timeout” (i.e. zero = infinity), or does 0 mean “timeout should go on for zero seconds”?
* Should the default be 50 for more cases, or tailored to something that looks less arbitrary?
* Should it be possible to set timeouts per session, or should it always be done with GLOBAL?
It’s a set of questions that we had to revisit in January when falcon_lock_wait_timeout appeared, and we’ll see it again for an upcoming timeout variable in BACKUP. And my opinion is: I wish we had a magic formula for every question that ever arose at MySQL.

Leave a Reply