14

Where would I set the maximum time a query will wait for a lock in MySQL 5.0.68 before timing out?

| improve this question | | | | |
6

Other timeout settings that are general (not just for locks, since innodb_lock_wait_timeout only applies to InnoDB row locks) would be wait_timeout and interactive_timeout (both default to 28,800)

| improve this answer | | | | |
8

By default, it is 50 seconds

Just set innodb_lock_wait_timeout as needed.

| improve this answer | | | | |
1

If you hit the 50-sec InnoDB timeout, you have a poorly designed application!

That timeout exists to catch naughty things that cannot be caught any other way.

| improve this answer | | | | |
  • 1
    Or due to errors, I've an extremely busy mysql and mariadb server and deadlocks are a normal thing ot happen all the time. Even if "impossible". If you have a hundred million rows and ten thousands of sql command every second you'll find every sort of bug in mysql (crashes) as well as deadlocks of various sorts. – John Dec 19 '18 at 19:15
  • 1
    It depens to the situation. From the mysql docs: You might decrease this value for highly interactive applications or OLTP systems, to display user feedback quickly or put the update into a queue for processing later. You might increase this value for long-running back-end operations, such as a transform step in a data warehouse that waits for other large insert or update operations to finish. – g4b0 Sep 5 '19 at 7:38
  • Checking that application is poorly built...yep! – Noah Duncan Dec 18 '19 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.