databacker / mysql-backup

image to enable automated backups of mysql databases in containers
647 stars 182 forks source link

mysqldump with ubuntu docker image is very slow #106

Open karthikeayan opened 5 years ago

karthikeayan commented 5 years ago

Below is the Dockerfile I used,

# mysql backup image
FROM ubuntu:18.04
MAINTAINER Karthikeyan Sundararajan

# install the necessary client
RUN apt-get update && \
    apt-get install -y mysql-client bash python3 python3-pip samba-client && \
    rm -rf /var/cache/apk/* && \
    touch /etc/samba/smb.conf && \
    pip3 install awscli

# install the entrypoint
COPY functions.sh /
COPY entrypoint /entrypoint
RUN chmod +x /entrypoint

# start
ENTRYPOINT ["/entrypoint"]

I had to remove the non-root user commands as docker run was throwing permission denied issues.

Why Ubuntu image

alpine image comes with mariadb client and having issues while dumping database contains generated columns

Issue

While using this ubuntu docker image in Kubernetes, the was very slow. Alpine image took 25 minutes to take 25GB database. Ubuntu image took around 1.5 hours to dump the first 5-6 GB and container got restarted.

deitch commented 5 years ago

What happens if you run the same outside of a container?

karthikeayan commented 5 years ago

I thought it works fine outside the container. But I see same issue even outside the container. So this github issue should not be valid.

deitch commented 5 years ago

Can you create a way for me to replicate the exact situation, both “it works” and “it’s slow”? Happy to figure it out and resolve it if you can make it easy to replicate.