Skip to content

Commit

Permalink
Merge pull request #12 from kronostechnologies/DOPS-3905/mysqldump_slow
Browse files Browse the repository at this point in the history
Improve performance: Increase default max_allowed_packet
  • Loading branch information
mcantinqc authored Oct 23, 2023
2 parents faf7525 + 2a97b1a commit 43ab8fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
FROM node:14 AS builder
MAINTAINER "[email protected]"
FROM node:18 AS builder

WORKDIR /code
COPY ["package.json", ".yarnclean", "yarn.lock", "/code/"]
RUN yarn install && yarn autoclean --force && yarn cache clean


FROM node:14-slim
FROM node:18-slim

COPY --from=builder /code /code
WORKDIR /code
Expand Down
3 changes: 2 additions & 1 deletion mysql2s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const config = {
host: process.env.MYSQL_HOST,
user: process.env.MYSQL_USER,
password: process.env.MYSQL_PWD,
max_allowed_packet: process.env.MAX_ALLOWED_PACKET || "4194304",
max_allowed_packet: process.env.MAX_ALLOWED_PACKET || "256000000",
},
s3: {
bucket: process.env.AWS_S3_BUCKET,
Expand Down Expand Up @@ -307,6 +307,7 @@ const _getMySqlDump = (config) => {
'-u', config.user,
'--single-transaction',
'--max_allowed_packet', config.max_allowed_packet,
'--skip-lock-tables',
config.database
],
{
Expand Down

0 comments on commit 43ab8fa

Please sign in to comment.