什么是“瘦池"?在码头工人的意思? [英] What does "Thin Pool" in docker mean?

查看:218
本文介绍了什么是“瘦池"?在码头工人的意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这应该很基本,但是我已经尝试过搜索它,并且阅读了码头工人文件.但是,我仍然无法理解" Thin Pool "的确切含义以及它在docker世界中的作用.

解决方案

短篇小说:

精简池是一种存储源,可按需分配存储空间.它或多或少类似于虚拟内存,它为每个进程提供了完整的地址空间.

长话短说

脂肪供应

传统的存储分配方法称为胖"或厚"置备.

例如,用户声称使用10G存储空间.胖配置然后为该用户保留10G物理存储空间,即使他/她仅使用其中的1%.没有人可以使用这个保留的空间.

精简配置

精简配置提供了按需存储分配机制,该机制允许用户声明比实际为该用户保留的存储空间更多的存储空间.

换句话说,它启用了存储空间的过度分配.考虑一下RAM的过量使用功能.

瘦池

精简池是一个概念性术语,代表精简配置所使用的后备存储源.精简配置从精简池分配虚拟存储块,胖配置从传统存储池分配物理存储块.

Docker中的瘦池

可以将Docker引擎配置为使用Device Mapper作为其存储驱动程序.这是您处理精简资源调配的地方.根据Docker的文档:

使用devicemapper存储驱动程序的生产主机必须使用Direct-LVM模式.此模式使用块设备创建精简池.

需要注意两个不同的精简池空间:元数据空间(用于存储指针)和数据空间(用于存储实际数据).从一开始,元数据空间中的所有指针都指向池中没有任何实际块.直到写请求到达,才真正分配数据空间中的任何块.如果您熟悉的话,这并不是什么新鲜事 虚拟内存机制.

让我们看一下docker info的输出:

Data Space Used: 11.8 MB
Data Space Total: 107.4 GB
Data Space Available: 7.44 GB
Metadata Space Used: 581.6 kB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Thin Pool Minimum Free Space: 10.74 GB

在这里,唯一令人困惑的是Thin Pool Minimum Free Space.它代表什么?

它指定成功创建新设备所需的精简池中的最小可用空间(以GB为单位).此检查适用于可用数据空间以及可用元数据空间.

如果精简池中的可用空间小于Thin Pool Minimum Free Space中的值,则容器创建(在docker pulldocker run中)将失败.空间不足需要要么在精简池中添加更多存储空间,要么清除未使用的映像.


链接:

I guess this should be pretty elementary but I've tried to google it and I've read the docker documentation. However, I still can't grasp what exactly does "Thin Pool" mean and the role it plays in the docker world.

解决方案

Short story:

A thin pool is a storage source that provides on-demand allocation for storage space. It is more or less similar to virtual memory, which provides full address space to every process.

Long story:

Fat Provisioning

The traditional storage allocation method is called "fat" or "thick" provisioning.

For example, a user claims to use 10G storage space. Fat provisioning then reserves 10G physical storage space for this user even though he/she only uses 1% of it. No one else can use this reserved space.

Thin Provisioning

Thin provisioning provides a mechanism of on-demand storage allocation, which allows a user to claim more storage space than has been physically reserved for that user.

In other words, it enables over-allocation for storage space. Think about RAM's over-commit feature.

Thin Pool

Thin pool is a conceptional term which stands for the backing storage source used by thin provisioning. Thin provisioning allocates virtual chunks of storage from thin pool, while fat provisioning allocates physical blocks of storage from the traditional storage pool.

Thin Pool in Docker

The Docker Engine can be configured to use Device Mapper as its storage driver. This is where you deal with thin provisioning. According to Docker's documentation:

Production hosts using the devicemapper storage driver must use direct-lvm mode. This mode uses block devices to create the thin pool.

Two different spaces of thin pool need to be taken care of: the Metadata space (which stores pointers) and the Data space (which stores the real data). At the very beginning, all the pointers in Metadata space point to no real chunks in the pool. No chunk in data space is really allocated until a write request arrives. This is nothing new if you are familiar with the virtual memory mechanism.

Let's take a look at the output of docker info:

Data Space Used: 11.8 MB
Data Space Total: 107.4 GB
Data Space Available: 7.44 GB
Metadata Space Used: 581.6 kB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Thin Pool Minimum Free Space: 10.74 GB

Here, the only confusing one is the Thin Pool Minimum Free Space. What does it stand for?

It specifies the min free space in GB in a thin pool required for a new device creation to succeed. This check applies to both free data space as well as free metadata space.

Container creation (during docker pull or docker run) fails if free space in thin pool is less than the value in Thin Pool Minimum Free Space. Insufficient space requires either adding more storage into thin pool or clearing up unused images.


Links:

这篇关于什么是“瘦池"?在码头工人的意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆