Overlay storage driver internalsRunning Docker containers with different storage driversWhat are the...

Does the radius of the Spirit Guardians spell depend on the size of the caster?

Is there really no realistic way for a skeleton monster to move around without magic?

Are tax years 2016 & 2017 back taxes deductible for tax year 2018?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

LED on same Pin as Toggle Switch, not illuminating

How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?

Is it possible to make sharp wind that can cut stuff from afar?

Japan - Plan around max visa duration

DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?

Extreme, but not acceptable situation and I can't start the work tomorrow morning

Why don't electron-positron collisions release infinite energy?

How to type dʒ symbol (IPA) on Mac?

whey we use polarized capacitor?

What defenses are there against being summoned by the Gate spell?

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

What is the command to reset a PC without deleting any files

What do you call a Matrix-like slowdown and camera movement effect?

Are white and non-white police officers equally likely to kill black suspects?

Copycat chess is back

Schwarzchild Radius of the Universe

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

A Journey Through Space and Time

The use of multiple foreign keys on same column in SQL Server



Overlay storage driver internals


Running Docker containers with different storage driversWhat are the implications of using an inode_ratio of 16384 in terms of storage use on ext4?ext4 file system tuning for storage partitionIf I grow an ext4 partition, will it increase the number of inodes available?How do I get Consul to work so I can get Docker Overlay to work?Docker storage setup utility absent in 1.11.x versionUsing ceph storage directly for docker volumesHow to get logs from Docker with journald driver?Running Docker containers with different storage drivers






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















A follow-up from this question.



My further reading on Docker storage drivers revealed that the overlay driver merges all the image layers into lower layers using a hard link implementation which cause excessive inode utilization. Can someone explain this? As far as I know, creating hard links does not create a new inode.










share|improve this question




















  • 1





    Please do note that each question must be able to stand on its own. I have added some details from your earlier question to establish the context. Feel free to add or remove details as necessary.

    – Haxiel
    23 hours ago


















2















A follow-up from this question.



My further reading on Docker storage drivers revealed that the overlay driver merges all the image layers into lower layers using a hard link implementation which cause excessive inode utilization. Can someone explain this? As far as I know, creating hard links does not create a new inode.










share|improve this question




















  • 1





    Please do note that each question must be able to stand on its own. I have added some details from your earlier question to establish the context. Feel free to add or remove details as necessary.

    – Haxiel
    23 hours ago














2












2








2


0






A follow-up from this question.



My further reading on Docker storage drivers revealed that the overlay driver merges all the image layers into lower layers using a hard link implementation which cause excessive inode utilization. Can someone explain this? As far as I know, creating hard links does not create a new inode.










share|improve this question
















A follow-up from this question.



My further reading on Docker storage drivers revealed that the overlay driver merges all the image layers into lower layers using a hard link implementation which cause excessive inode utilization. Can someone explain this? As far as I know, creating hard links does not create a new inode.







docker inode hard-link






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 23 hours ago









Haxiel

3,56811021




3,56811021










asked yesterday









Rajnish Kumar SoniRajnish Kumar Soni

1781213




1781213








  • 1





    Please do note that each question must be able to stand on its own. I have added some details from your earlier question to establish the context. Feel free to add or remove details as necessary.

    – Haxiel
    23 hours ago














  • 1





    Please do note that each question must be able to stand on its own. I have added some details from your earlier question to establish the context. Feel free to add or remove details as necessary.

    – Haxiel
    23 hours ago








1




1





Please do note that each question must be able to stand on its own. I have added some details from your earlier question to establish the context. Feel free to add or remove details as necessary.

– Haxiel
23 hours ago





Please do note that each question must be able to stand on its own. I have added some details from your earlier question to establish the context. Feel free to add or remove details as necessary.

– Haxiel
23 hours ago










1 Answer
1






active

oldest

votes


















1














OverlayFS is a union filesystem, and there are two storage drivers at the Docker level that make use of it: the original/older version named overlay and the newer version named overlay2. In OverlayFS, there is a lower-level directory which is exposed as read-only. On top of this directory is the upper-level directory, which allows read-write access. Each of these directories is called a layer. The combined view of both the lower-level and upper-level directories is presented as a single unit, called the 'merged' directory.



The newer overlay2 storage driver natively supports up to 128 such layers. The older overlay driver is only able to work with two layers at a time. Since most Docker images are built using multiple layers, this limitation is fairly significant. To work around this limitation, each layer is implemented as a separate directory that simulates a complete image.



To examine the differences on my test system, I pulled the 'ubuntu' image from Docker Hub and examined the differences in directory structure between the overlay2 and overlay drivers:



[root@testvm1 overlay2]$ ls */diff
4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231/diff:
run

4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780/diff:
var

a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214/diff:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00/diff:
etc sbin usr var


[root@testvm1 overlay]# ls */root/
001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var


In the overlay representation, each layer simulates a complete image, while the overlay2 layers only contain the exact differences between layers. In the overlay driver's approach, hard links are used as a way to save space between the different layers. However, this method is still not perfect, and new inodes are required when the image data contains special files such as symbolic links and character devices. This can quickly add up to large number of inodes.



The inode distribution betwen the overlay2 and overlay drivers on my test system are as shown below.



[root@testvm1 overlay2]$ du --inodes -s *
8 4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231
27 4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780
3311 a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214
1 backingFsBlockDev
25 c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00
5 l

[root@testvm1 overlay]# du --inodes -s *
3298 001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf
783 048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc
768 8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9
765 fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361


The total count of inodes on overlay2 comes to 3378 on my system. Using overlay, this count goes up to 5615. This value is considering a single image and with no containers running, so a large system with a number of docker containers and images could quickly hit the inode limit imposed by the backing filesystem (XFS or EXT4, where the /var/lib/docker/overlay directory is located).



Due to this reason, the newer overlay2 storage driver is currently the recommended option for most new installations. The overlay driver is deprecated as of Docker v18.09 and is expected to be removed in a future release.






share|improve this answer
























  • Thanks Haxiel for such detailed explanation.

    – Rajnish Kumar Soni
    19 hours ago












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510931%2foverlay-storage-driver-internals%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














OverlayFS is a union filesystem, and there are two storage drivers at the Docker level that make use of it: the original/older version named overlay and the newer version named overlay2. In OverlayFS, there is a lower-level directory which is exposed as read-only. On top of this directory is the upper-level directory, which allows read-write access. Each of these directories is called a layer. The combined view of both the lower-level and upper-level directories is presented as a single unit, called the 'merged' directory.



The newer overlay2 storage driver natively supports up to 128 such layers. The older overlay driver is only able to work with two layers at a time. Since most Docker images are built using multiple layers, this limitation is fairly significant. To work around this limitation, each layer is implemented as a separate directory that simulates a complete image.



To examine the differences on my test system, I pulled the 'ubuntu' image from Docker Hub and examined the differences in directory structure between the overlay2 and overlay drivers:



[root@testvm1 overlay2]$ ls */diff
4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231/diff:
run

4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780/diff:
var

a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214/diff:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00/diff:
etc sbin usr var


[root@testvm1 overlay]# ls */root/
001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var


In the overlay representation, each layer simulates a complete image, while the overlay2 layers only contain the exact differences between layers. In the overlay driver's approach, hard links are used as a way to save space between the different layers. However, this method is still not perfect, and new inodes are required when the image data contains special files such as symbolic links and character devices. This can quickly add up to large number of inodes.



The inode distribution betwen the overlay2 and overlay drivers on my test system are as shown below.



[root@testvm1 overlay2]$ du --inodes -s *
8 4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231
27 4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780
3311 a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214
1 backingFsBlockDev
25 c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00
5 l

[root@testvm1 overlay]# du --inodes -s *
3298 001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf
783 048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc
768 8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9
765 fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361


The total count of inodes on overlay2 comes to 3378 on my system. Using overlay, this count goes up to 5615. This value is considering a single image and with no containers running, so a large system with a number of docker containers and images could quickly hit the inode limit imposed by the backing filesystem (XFS or EXT4, where the /var/lib/docker/overlay directory is located).



Due to this reason, the newer overlay2 storage driver is currently the recommended option for most new installations. The overlay driver is deprecated as of Docker v18.09 and is expected to be removed in a future release.






share|improve this answer
























  • Thanks Haxiel for such detailed explanation.

    – Rajnish Kumar Soni
    19 hours ago
















1














OverlayFS is a union filesystem, and there are two storage drivers at the Docker level that make use of it: the original/older version named overlay and the newer version named overlay2. In OverlayFS, there is a lower-level directory which is exposed as read-only. On top of this directory is the upper-level directory, which allows read-write access. Each of these directories is called a layer. The combined view of both the lower-level and upper-level directories is presented as a single unit, called the 'merged' directory.



The newer overlay2 storage driver natively supports up to 128 such layers. The older overlay driver is only able to work with two layers at a time. Since most Docker images are built using multiple layers, this limitation is fairly significant. To work around this limitation, each layer is implemented as a separate directory that simulates a complete image.



To examine the differences on my test system, I pulled the 'ubuntu' image from Docker Hub and examined the differences in directory structure between the overlay2 and overlay drivers:



[root@testvm1 overlay2]$ ls */diff
4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231/diff:
run

4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780/diff:
var

a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214/diff:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00/diff:
etc sbin usr var


[root@testvm1 overlay]# ls */root/
001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var


In the overlay representation, each layer simulates a complete image, while the overlay2 layers only contain the exact differences between layers. In the overlay driver's approach, hard links are used as a way to save space between the different layers. However, this method is still not perfect, and new inodes are required when the image data contains special files such as symbolic links and character devices. This can quickly add up to large number of inodes.



The inode distribution betwen the overlay2 and overlay drivers on my test system are as shown below.



[root@testvm1 overlay2]$ du --inodes -s *
8 4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231
27 4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780
3311 a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214
1 backingFsBlockDev
25 c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00
5 l

[root@testvm1 overlay]# du --inodes -s *
3298 001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf
783 048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc
768 8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9
765 fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361


The total count of inodes on overlay2 comes to 3378 on my system. Using overlay, this count goes up to 5615. This value is considering a single image and with no containers running, so a large system with a number of docker containers and images could quickly hit the inode limit imposed by the backing filesystem (XFS or EXT4, where the /var/lib/docker/overlay directory is located).



Due to this reason, the newer overlay2 storage driver is currently the recommended option for most new installations. The overlay driver is deprecated as of Docker v18.09 and is expected to be removed in a future release.






share|improve this answer
























  • Thanks Haxiel for such detailed explanation.

    – Rajnish Kumar Soni
    19 hours ago














1












1








1







OverlayFS is a union filesystem, and there are two storage drivers at the Docker level that make use of it: the original/older version named overlay and the newer version named overlay2. In OverlayFS, there is a lower-level directory which is exposed as read-only. On top of this directory is the upper-level directory, which allows read-write access. Each of these directories is called a layer. The combined view of both the lower-level and upper-level directories is presented as a single unit, called the 'merged' directory.



The newer overlay2 storage driver natively supports up to 128 such layers. The older overlay driver is only able to work with two layers at a time. Since most Docker images are built using multiple layers, this limitation is fairly significant. To work around this limitation, each layer is implemented as a separate directory that simulates a complete image.



To examine the differences on my test system, I pulled the 'ubuntu' image from Docker Hub and examined the differences in directory structure between the overlay2 and overlay drivers:



[root@testvm1 overlay2]$ ls */diff
4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231/diff:
run

4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780/diff:
var

a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214/diff:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00/diff:
etc sbin usr var


[root@testvm1 overlay]# ls */root/
001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var


In the overlay representation, each layer simulates a complete image, while the overlay2 layers only contain the exact differences between layers. In the overlay driver's approach, hard links are used as a way to save space between the different layers. However, this method is still not perfect, and new inodes are required when the image data contains special files such as symbolic links and character devices. This can quickly add up to large number of inodes.



The inode distribution betwen the overlay2 and overlay drivers on my test system are as shown below.



[root@testvm1 overlay2]$ du --inodes -s *
8 4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231
27 4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780
3311 a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214
1 backingFsBlockDev
25 c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00
5 l

[root@testvm1 overlay]# du --inodes -s *
3298 001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf
783 048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc
768 8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9
765 fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361


The total count of inodes on overlay2 comes to 3378 on my system. Using overlay, this count goes up to 5615. This value is considering a single image and with no containers running, so a large system with a number of docker containers and images could quickly hit the inode limit imposed by the backing filesystem (XFS or EXT4, where the /var/lib/docker/overlay directory is located).



Due to this reason, the newer overlay2 storage driver is currently the recommended option for most new installations. The overlay driver is deprecated as of Docker v18.09 and is expected to be removed in a future release.






share|improve this answer













OverlayFS is a union filesystem, and there are two storage drivers at the Docker level that make use of it: the original/older version named overlay and the newer version named overlay2. In OverlayFS, there is a lower-level directory which is exposed as read-only. On top of this directory is the upper-level directory, which allows read-write access. Each of these directories is called a layer. The combined view of both the lower-level and upper-level directories is presented as a single unit, called the 'merged' directory.



The newer overlay2 storage driver natively supports up to 128 such layers. The older overlay driver is only able to work with two layers at a time. Since most Docker images are built using multiple layers, this limitation is fairly significant. To work around this limitation, each layer is implemented as a separate directory that simulates a complete image.



To examine the differences on my test system, I pulled the 'ubuntu' image from Docker Hub and examined the differences in directory structure between the overlay2 and overlay drivers:



[root@testvm1 overlay2]$ ls */diff
4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231/diff:
run

4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780/diff:
var

a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214/diff:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00/diff:
etc sbin usr var


[root@testvm1 overlay]# ls */root/
001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361/root/:
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var


In the overlay representation, each layer simulates a complete image, while the overlay2 layers only contain the exact differences between layers. In the overlay driver's approach, hard links are used as a way to save space between the different layers. However, this method is still not perfect, and new inodes are required when the image data contains special files such as symbolic links and character devices. This can quickly add up to large number of inodes.



The inode distribution betwen the overlay2 and overlay drivers on my test system are as shown below.



[root@testvm1 overlay2]$ du --inodes -s *
8 4864f14e58c1d6d5e7904449882b9369c0c0d5e1347b8d6faa7f40dafcc9d231
27 4abcfa714b4de6a7f1dd092070b1e109e8650a7a9f9900b6d4c3a7ca441b8780
3311 a58c4e78232ff36b2903ecaab2ec288a092e6fc55a694e5e2d7822bf98d2c214
1 backingFsBlockDev
25 c3f1a237c46ed330a2fd05ab2a0b6dcc17ad08686bd8dc49ecfada8d85b93a00
5 l

[root@testvm1 overlay]# du --inodes -s *
3298 001311c618ad7b94d4dc9586f26e421906e7ebf5c28996463a355abcdcd501bf
783 048f81f400f7d74f969c4fdaff6553c782d12c04890ad869d75313505c868fbc
768 8060f0c647f24050e1a4bff71096ffdf9665bff26e6187add87ecb8a18532af9
765 fbdef944657234468ee55b12c7910aa495d13936417f9eb905cdc39a40fb5361


The total count of inodes on overlay2 comes to 3378 on my system. Using overlay, this count goes up to 5615. This value is considering a single image and with no containers running, so a large system with a number of docker containers and images could quickly hit the inode limit imposed by the backing filesystem (XFS or EXT4, where the /var/lib/docker/overlay directory is located).



Due to this reason, the newer overlay2 storage driver is currently the recommended option for most new installations. The overlay driver is deprecated as of Docker v18.09 and is expected to be removed in a future release.







share|improve this answer












share|improve this answer



share|improve this answer










answered 21 hours ago









HaxielHaxiel

3,56811021




3,56811021













  • Thanks Haxiel for such detailed explanation.

    – Rajnish Kumar Soni
    19 hours ago



















  • Thanks Haxiel for such detailed explanation.

    – Rajnish Kumar Soni
    19 hours ago

















Thanks Haxiel for such detailed explanation.

– Rajnish Kumar Soni
19 hours ago





Thanks Haxiel for such detailed explanation.

– Rajnish Kumar Soni
19 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510931%2foverlay-storage-driver-internals%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...