<p>Im trying to run a basic MySQL 8 pod in Kubernetes. I did a basic deployment without any resource limits or whatsoever. What i do notice that the memory consumption is high. I have a nearly empty database (i think there are max 100 rows with basic data) and the pod is consuming 750M memory.</p>

<p>Is there anything that you can do about this?</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: db
  namespace: my-namespace
spec:
  replicas: 1
  selector:
    matchLabels:
      app: db
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: db
    spec:
      containers:
        - name: db
          image: mysql:8.0
          resources:
          env:
            - name: MYSQL_DATABASE
              value: mydb
            - name: MYSQL_USER
              value: myuser
            - name: MYSQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: secret
                  key: "DATABASE_PASSWORD"
          ports:
            - containerPort: 3306
              name: transport
              protocol: TCP
          volumeMounts:
            - name: db
              mountPath: /var/lib/mysql
              subPath: mysql
      volumes:
        - name: db
          persistentVolumeClaim:
            claimName: db
</code></pre>

<p>Best 
Pim</p>

Dirkos
<p>I've just ran a docker container with MySQL and it consumes ~400M of RAM with an empty database that is not even being queried by some application.</p>

<pre><code>docker run -itd -e MYSQL_ROOT_PASSWORD=password mysql
docker stats
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
a779ef705921        happy_lumiere       2.22%               373.4MiB / 1.943GiB   18.77%              1.05kB / 0B         0B / 0B             38
</code></pre>

<p>According to this assessment it seems to me that 750M is not that much.</p>

<p>You can check out these <a href="https://www.percona.com/blog/2016/05/03/best-practices-for-configuring-optimal-mysql-memory-usage/" rel="nofollow noreferrer">Best Practices for Configuring Optimal MySQL Memory Usage</a>.</p>
