Categorygithub.com/devops-works/mygopherhose
modulepackage
0.0.3
Repository: https://github.com/devops-works/mygopherhose.git
Documentation: pkg.go.dev

# README

mygopherhose

Parallel importer for mysqldumps.

What

mygopherhose uses a dump produced by mysqldump and imports it trying to parallelize INSERT statements.

From benchmarks, it seems to perform 3x faster on small instances (should be even better on high end machines).

Caveats

  • tables are not locked
  • does not support SETting things
  • does not support stored procedures

Use at your own risks in production.

Usage

mygopherhose [-h host] -u user -p [password] [-P port] [-d dbname] [-b bufsize] dumpfile
        -h defaults to 127.0.0.1
        -P defaults to 3306
        -b defaults to 10485760 bytes
        -d can be omitted is dump contains `USE DATABASE foo;` stanza
        -p if parameter is empty, password will be asked interactively
  • 🐑 is displayed at each CREATE TABLE operation.
  • ⌛ is diplayed when all transactions for the current table have been sent to the buffered channel for processing
  • a dot is displayed for each INSERT statement applied (those statements almost always contains several rows, see net_buffer_length)

GCP benchmarks

  • Client VM: n2-standard-2
  • CloudSQL: db-n1-standard-8 / 260GB
  • Dump:
    • 20GB
    • 95 tables
    • 68781981 rows
    • data size 23.04G
    • index size 2.48 G
descriptiondurationdb CPU
mysql cli piped30m24.209s~11%
mysql -e source30m30.161s~11%
mygopherhose -c 1013m02.016s54-87%
mygopherhose -c 2012m51.301s60-90%
mygopherhose -c 4012m51.799s60-93%
mygopherhose -c 10013m09.446s69-97%

# Constants

No description provided by the author

# Variables

BuildDate of current binary.
Version of current binary.