From 7f90e61d363b67931c3d607ca308b9556bfa8fcd Mon Sep 17 00:00:00 2001 From: Simon Eskildsen Date: Wed, 25 May 2022 09:01:32 -0400 Subject: [PATCH 1/2] threading: default to 1 thread --- data_diff/__main__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/data_diff/__main__.py b/data_diff/__main__.py index daaa6f65..a4954c5e 100644 --- a/data_diff/__main__.py +++ b/data_diff/__main__.py @@ -44,7 +44,7 @@ @click.option("-v", "--verbose", is_flag=True, help="Print extra info") @click.option("-i", "--interactive", is_flag=True, help="Confirm queries, implies --debug") @click.option( - "-j", "--threads", default=None, help="Number of threads to use. 1 means no threading. Auto if not specified." + "-j", "--threads", default='1', help="Number of threads to use. Default of 1 means no threading." ) def main( db1_uri, @@ -77,10 +77,13 @@ def main( logging.basicConfig(level=logging.INFO, format=LOG_FORMAT, datefmt=DATE_FORMAT) if threads is not None: - threads = int(threads) - if threads < 1: - logging.error("Error: threads must be >= 1") - return + if threads.lower() == 'auto': + threads = None + else: + threads = int(threads) + if threads < 1: + logging.error("Error: threads must be >= 1") + return db1 = connect_to_uri(db1_uri, threads) db2 = connect_to_uri(db2_uri, threads) From 3357defb18d36d23d0212b924a6add3b5ff7b01b Mon Sep 17 00:00:00 2001 From: Simon Eskildsen Date: Wed, 25 May 2022 09:01:39 -0400 Subject: [PATCH 2/2] docker: allow 1000 connections to mysql for threading --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 58e006fa..a347372a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: -c maintenance_work_mem=1GB -c max_wal_size=8GB restart: always - volumes: + volumes: - postgresql-data:/var/lib/postgresql/data:delegated ports: - '5432:5432' @@ -32,13 +32,13 @@ services: --default-authentication-plugin=mysql_native_password --binlog-cache-size=16M --key_buffer_size=0 - --max_connections=10 + --max_connections=1000 --innodb_flush_log_at_trx_commit=2 --innodb_flush_log_at_timeout=10 --innodb_log_compressed_pages=OFF --sync_binlog=0 restart: always - volumes: + volumes: - mysql-data:/var/lib/mysql:delegated user: mysql ports: