Question: 28
The MySQL error log shows:
InnoDB: Warning: a long semaphore wait:
The relevant parts of the InnoDB monitor output shows:
Which two options would help avoid the long wait in the future?
A. Increase the value of the innodb_lock_wait_timeout option.
B. Increase the value of the innodb_read_io_threads option.
C. Change the table to use HASH indexes instead of BTREE indexes.
D. Set the value of innodb_adaptive_hash_index to zero.
E. Deactivate the query cache.
F. Increase the size of the InnoDB buffer pool.
答案:DE
解析:MySQL是多线程服务,多线程之间并发操作时需要进行并发控制;前台线程访问MySQL资源时,使用锁进行并发控制,而后台线程访问系统共享资源时使用信号量进行并发控制。因此出现出现长时间信号量等待的情况时,往往是后台资源访问系统共享资源时出现竞争。