Skip to content

🐞 Issue Report: MySQL Docker Container in Kubernetes Restarts Every 2–3 Days Despite 11 GB RAM Assigned to Pod #1111

Closed
@jayrajmeh0

Description

@jayrajmeh0

Description

We're running a MySQL Docker container in a Kubernetes cluster. The container restarts every 2–3 days, typically when memory usage increases. We've assigned 11 GB of RAM directly to the Pod, yet the MySQL container still crashes and restarts periodically.

Interestingly, the same application and MySQL configuration runs fine on a Windows Server with only 8 GB RAM, without restarts.

We’ve already tuned my.cnf parameters to better manage memory usage, but that hasn't resolved the issue. We suspect the MySQL container may be hitting memory limits or being killed (possibly due to OOM conditions).


📦 Environment Details

  • MySQL Version: e.g., 8.0.35
  • Docker Image Used: e.g., mysql:8.0.35
  • Kubernetes Version: e.g., v1.28
  • Pod RAM Limit: 11 GB
  • Windows Server (reference setup): 8 GB RAM — No restart issues
  • Storage Type: _e.g., PVC / Rook-ceph
  • Platform: Kubernetes

⚙️ MySQL Configuration (my.cnf)

[mysqld]
log_bin_trust_function_creators=1
sql-mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
cte_max_recursion_depth=10000
group_concat_max_len=1000000
innodb_print_all_deadlocks=1
transaction_isolation=READ-COMMITTED
lower_case_table_names=1
default_authentication_plugin=mysql_native_password
local_infile=1
default-storage-engine=INNODB
slow-query-log=1
slow_query_log_file=/var/lib/mysql/ADMIN-slow.log
long_query_time=10
log-error=/var/lib/mysql/ADMIN.err
innodb_buffer_pool_size=512M
tmp_table_size=64M
thread_cache_size=10
table_open_cache=500
max_connections=100
key_buffer_size=64M
read_buffer_size=4M
read_rnd_buffer_size=4M
innodb_log_buffer_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=25
innodb_buffer_pool_instances=4
back_log=80
join_buffer_size=8M
max_allowed_packet=64M
open_files_limit=8161
sort_buffer_size=4M
connect_timeout=1000
max_heap_table_size=40M
innodb_log_files_in_group=8
max_length_for_sort_data=16K
innodb_print_all_deadlocks=1
innodb_ft_result_cache_limit=128M
innodb_ft_total_cache_size=64M
thread_stack=512K
wait_timeout=60
interactive_timeout=60
performance_schema=ON

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions