mysqldump-php
mysqldump-php copied to clipboard
Faster dump by less tiny writes()
while writing the dump the script is doing millions of tiny writes().
after this PR we are buffering the contents within a string a do the write only after we reached the net-buffer-length. this means we are doing waaaay less IO calls.
before this PR:
mstaab@mst22:/cluster/www/www/www/mysqldump-php$ time php test2.php
real 0m14.194s
user 0m10.762s
sys 0m2.340s
after this PR
mstaab@mst22:/cluster/www/www/www/mysqldump-php$ time php test2.php
real 0m7.492s
user 0m6.403s
sys 0m0.204s
which is now 40-50% faster 🚀
What if you have very large tables? In my case i have a table of ~90gb and growing
Give it a try and report back :-)
Hi, thanks for the PR and the time you took to evaluate this. During your tests... did you use compression output or was it disabled? Please see #284.
As far as I remember I used default settings / not sure whether this means compressed or not
By default, compression is configured to None. So I think the option to buffer only when compression is None is better, let me do some tests and I will update the PR and fix the issue.
Thanks for your effort.
Message ID: @.***>
This makes more sense than #284.