June 19, 2013

Post: Pitfalls of converting to InnoDB

… clients to convert their current database from MyISAM tables to InnoDB. The transfer by itself in most cases is almost plain… timeout expired. Transaction was rolled back. 1213 (ER_LOCK_DEADLOCK) Transaction deadlock. You should rerun the transaction. It is not hard to… do in our PHP applications: class mysqlx extends mysqli { … function deadlock_query($query) { $MAX_ATTEMPS = 100; $current = 0; while ($current++ < $MAX…

Post: Should you move from MyISAM to Innodb ?

Innodb. Application Readiness Application should be ready to work with Innodb, for example be ready to deal with deadlocks which can happen with Innodb…) for logging. Innodb Needs Tuning As a final note about MyISAM to Innodb migration I should mention about Innodb tuning. Innodb needs tuning. Really…

Post: Innodb Performance Optimization Basics

… for more details, check out detailed guide on tuning innodb buffer pool innodb_log_file_size – This depends on your recovery speed… on a lot of short write transactions. innodb_thread_concurrency=8 Even with current Innodb Scalability Fixes having limited concurrency helps. The… deadlocks which may happen. Third you would like to review your table structure and see how you can get advantage of Innodb

Post: Table locks in SHOW INNODB STATUS

… I see people confused what table locks reported by SHOW INNODB STATUS really mean. Check this out for example: —TRANSACTION 0… table. What does Intention mean ? Just what it says. If Innodb sets intention exclusive lock on the table this means it… table locks you may observe in SHOW INNODB STATUS output, they almost never would be cause of your lock waits or deadlocks.

Post: Percona Server 5.1.47-rel11.0

… of Percona’s earlier fast-recovery code. Added the –percona_innodb_doublewrite_path option to place the double-write-buffer into… query before using it in query cache. Added a global Innodb_deadlocks counter to SHOW STATUS, based on a patch by Eric… Can’t compile 5.1.46 #573104 separate name in INNODB_SYS_TABLES table #580324 Security bug in upstream #586579 Percona…

Post: Test Drive of Solid

… as we can see Solid does not have instant deadlock detection as Innodb and have to rely on timeouts instead. This may… could proceed modifying them without causing deadlocks. For comparion here are InnoDB sessions: Test 1: Deadlock detection (deadlock is correctly detected): insert into test2…

Post: How to Monitor MySQL with Percona's Nagios Plugins

… when a snapshot is failed or overly full. Too many deadlocks. Deadlocks (and lock wait timeouts, covered in another plugin) are frequent… pmp-check-mysql-deadlocks plugin can help you detect such problems, in conjunction with Percona Toolkit’s pt-deadlock-logger tool. Open… problems. The pmp-check-mysql-innodb plugin checks for several indicators of severe internal problems within InnoDB, such as contention that crosses…

Post: READ-COMMITED vs REPETABLE-READ in tpcc-like load

… poping up again and again. Recently it was discussed in InnoDB : Any real performance improvement when using READ COMMITED isolation level… case. However, however. For 10w run I got 60 Deadlock errors “1213, Deadlock found when trying to get lock; try restarting transaction” in READ-COMMITED mode, and 0 Deadlocks in REPEATABLE-READ mode. I understand that 60 deadlocks for total 2704687 transactions can be…

Post: SELECT LOCK IN SHARE MODE and FOR UPDATE

… simply add SELECT FOR UPDATE to your select and reduce deadlocks if you’re updating selected rows. As query results may… taken on Innodb level before MySQL performs like matching, and row is not unlocked if it does not match. Smarter deadlock victum scheduling At this point transaction which made least updates is killed to resolve deadlock. Which means if…

Post: Logging Foreign Key errors

… wrote about how to log deadlock errors using Percona Toolkit. Foreign key errors have the same problems. InnoDB only logs the last…-error-logger This is a tool very similar to pt-deadlock-logger that will help us to log those errors. It… DROP PRIMARY KEY; Conclusion If you are having too many deadlock or foreign key errors log them. Just reading the last…