<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>In the future please add more information about your environment (local, <code>kubeadm</code>, <code>minikube</code>, <code>cloud</code>) and scenario. It would be easier to reproduce or troubleshoot.</p>

<p>I would not say that <code>750M</code> RAM is high consumption. For test I've deployed <code>MySQL 8.0</code> on my GKE cluster using <code>HELM</code> based on <a href="https://github.com/helm/charts/tree/master/stable/mysql" rel="nofollow noreferrer">this chart</a>. I've only changed default MySql image version to <code>8.0</code>.</p>

<p><code>$ helm install sql stable/mysql</code></p>

<p>Pure instance of MySQL on my cluster without any <code>limits</code>, <code>requests</code> or data:</p>

<pre><code>$ kubectl top pods
NAME                         CPU(cores)   MEMORY(bytes)
sql-mysql-6c9489d5b9-m8zmh   8m           376Mi
</code></pre>

<p>So if <code>MySQL</code> works with actual data it's normal to consume more resources.</p>

<p>I would say it's normal behaviour.</p>

<p>For general resources use in <code>MySql</code> you can check <a href="https://dev.mysql.com/doc/refman/8.0/en/memory-use.html" rel="nofollow noreferrer">How MySQL Uses Memory</a>.</p>

<p>However if you working on local environment with some limited resources you should specify <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" rel="nofollow noreferrer">Limits</a> in your YAMLs.</p>
