How to configure MySQL on a very slow environment? - mysql

My application is installed on a client machine which is really really slow.
I'm getting errors like:
"Operation not allowed after ResultSet closed" (which I believe that occured due to timed out connections)
"Lock wait timeout exceeded;
try restarting transaction".
I would like to ensure that all of these errors caused to the slow machine by increasing MySQL timeouts.
My question is - which configurations should I change so that MySQL will be more tolerated to the slow environment.
Thanks

Well, you could try setting your innodb_lock_wait_timeout parameter in your my.ini file to resolve the second problem, but i dont really know how to fix the first one. More on innodb_lock_wait_timeout.

Related

mysql lock wait timeout: just try again without txn restart

Many solutions on this site describe how to debug and fix a lock-wait timeout. They discuss changing innodb_lock_wait_timeout and figuring out the root cause.
The official error code states "try restarting transaction". My question is if I don't restart the transaction, is there any benefit to just retrying the query?

Magento 1.8 & Amazon RDS Lock wait timeouts

Firstly this isn't a duplicate of this question because I'm not behind a load balancer at the moment. Also randomly restarting the instance isn't a satisfactory solution either.
I moved our store from using a local mysql db on the EC2 to RDS recently and we're getting some errors on the backend when they're moving categories around / adding products. Mostly they look like SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction but I've seen other variations of PDO errors.
How would one go about eliminating these issues?
I've read suggestions to just 'keep retrying' but this seems stupid.
I've tried tinkering with innodb_lock_wait_timeout and others but doesn't seem to resolve it.
I have finally disabled magento logging to the DB - will see if this helps going forward. Unfortunately I have to wait a while to let the staff tinker on the backend and then see if any fix has an effect.
Thanks
UPDATE
Now also seeing a bunch of these
User Error: DDL statements are not allowed in transactions

mysql 1205 error on bulk delete in django admin

I've moved to mysql from sqlite and funny issue - whenever I mass-delete objects via django admin (about 100 or so) I get this mysql error:
(1205, 'Lock wait timeout exceeded; try restarting transaction')
this has never happened with sqlite with the same models.
I am able to delete a max of two records, three are failing.
The setup is windows7, mysql 5.5.20, python 2.7, django 1.3
That error is directly from MySQL. It happens when there's a lock created on the table and it isn't released for whatever reason. You can try restarting your MySQL server. That might be enough to clear things up and allow you to proceed. You can also edit your my.conf file (not sure of its location in Windows, but should be with the rest of your MySQL stuff) and change the following line to a longer time period (number is seconds):
innodb_lock_wait_timeout = 50
Turns out there may be many causes to this issue. My case was caused by indexes mixing up somehow - I was only able to fix this by recreating the database and importing data.
in general
show status
show engine innodb status
explain <select causing issues>
may give some hints.

MySQL Error 1205: Lock wait timeout exceeded

I'm using SQLyog to sync a production database to a dev db. On 4 tables, I'm getting:
Error No. 1205 Lock wait timeout exceeded; try restarting transaction
Researching the web seems to indicate that a transaction has begun, locked tables, but has not committed. One post said to SHOW PROCESSLIST; but the only processes appear to be my own, via SQLyog.
I have also tried a Restart of MySQL, but that didn't help either.
As a relative novice in MySQL, I'm stuck: I can't determine what transaction or process is locking the tables, nor how to clear this situation.
Any suggestions would be gratefully accepted!
MTIA
Having the same problem on MySQL-cluster, I've solved (at least it looks being solved now - no fail have occured during last two days) it by performing commit/rollback after SELECTs too.
Export and re-import your database; this can often fix a lot of mysterious problems. You can do this through phpMyAdmin or from the command line.
This page at MediaTemple has a good set of instructions:
http://kb.mediatemple.net/questions/129/Export+and+import+MySQL+databases#gs
(Well, it worked for me!)

MySQL replication is not running although mysql says it is

I have two servers configured in a master-master pair using MMM. I recently had an issue where the passive master received a replication error (got a packet bigger than max_allowed_packet) but the slave IO and SQL threads continued running. And seconds_behind_master was still showing as 0 even though the slave was not executing new statements.
I thought this type of error would cause replication to stop (it's done this in the past). Instead replication kept running and our monitors didn't notice the problem. Also the replication errors continually showed up in the mysql error log, instead of "Last_Error" in "show slave status".
We are running version 5.0.33.
Any ideas what happened here? thanks!
For the max allowed packet size, it sounds like your two DBs are not configured identically. At least the network protocol stuff should be identical.
Did you try show slave status on both machines?
Quiet failure is a terrible situation. I wonder what records did not make it. Do you have a way of finding out?
Are you getting periodic errors in the error log or a flood of identical errors? Is the sequence number incrementing on the passive master?
Jacob