Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the operation of optimizing Mysql running memory in Docker

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Docker optimization Mysql running memory operation is what, many novices are not very clear about this, in order to help you solve this problem, the following small series will be explained in detail for everyone, there are people who need to learn, I hope you can gain something.

Using docker stats query run memory, from here you can see that my mysql uses a total of 400mb memory. After the following operations can be optimized to occupy only 100MB of memory.

1. Enter container docker exec -it mysql01 bash2. Install vim

We need to enter the container to modify the configuration file inside the container. There may be servers that do not have vim installed, so we do not need to install them.

apt-get updateapt-get install vim3, Modify configuration

docker Enter the mysql container, enter the/etc/mysql/conf.d directory and execute vim docker.cnf

[mysqld]performance_schema_max_table_instances=400 table_definition_cache=400 #cache performance_schema=off #Used to monitor MySQL server resource consumption during a lower level of operation, resource stuff table_open_cache=64 #Open table cache innodb_buffer_pool_chunk_size=64M #Block size of InnoDB buffer pool resizing operation innodb_buffer_pool_size=64M #Maximum memory buffer size for table data and index data of the InnoDB storage engine

Exit container:

exit;4, Restart mysql container docker stop mysql01docker start mysql015, Observe the modified memory docker stats

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report