Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid locking tables during mysql dump #2

Closed
Toub opened this issue Feb 9, 2016 · 3 comments
Closed

Avoid locking tables during mysql dump #2

Toub opened this issue Feb 9, 2016 · 3 comments

Comments

@Toub
Copy link

Toub commented Feb 9, 2016

Piwik default table engine is InnoDB since Piwik 2.1.

In that case, mysqldump documentation recommends to use --single-transaction option instead of --lock-tables.

This avoids LOCKS conflicts with piwik application and has much better performances.

As --lock-tables is enabled by default (due to --opt shortcut option), you have to explicitly disable it:

mysqldump --skip-lock-tables --single-transaction ...
@pierreozoux
Copy link
Member

Nice catch :)
Do you want to PR? :P

(You must have a big setup to spot this? Or just reading the doc?)

@Toub
Copy link
Author

Toub commented Feb 15, 2016

I experienced this issue with an other application, and the performance impact is real when accessing to the database in write mode during the backup.

I don't know how it affects piwik, nor how piwik manages the DB pool, but it is a no-cost optimization, so enjoy! ;-)

@Toub
Copy link
Author

Toub commented May 23, 2016

Thanks @stefancrain

@Toub Toub closed this as completed May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants