Docker LVM Metadata Calibration

I use the thin LVM pool for storing dockers (dm.thinpooldev), and so far I have run out of metadata space. Itโ€™s easy to fight, as I can just recreate a thin pool with great metadata, but I just know (and probably guess) how much this can be done.

Does anyone have any suggestions regarding the relative size of metadata for Docker? It seems that the default values โ€‹โ€‹in lvcreate are not enough:

- poolmetadatasize MetadataVolumeSize [bBsSkKmMgG] Sets the size of the logical pool metadata volume. Supported values โ€‹โ€‹range between 2MiB and 16GiB for a thin pool, and up to 16GiB for a cache pool. The minimum value is calculated from the size of the pool data. The default value for the thin pool (Pool_LV_size / Pool_LV_chunk_size * 64b). The default unit is megabytes.

The main commands that I use:

DISK=/dev/xvdf
VG=docker_vg
LV=docker_pool
pvcreate $DISK
vgcreate $VG $DISK
lvcreate -l 100%FREE --thinpool $LV $VG

Or replace custom metadata size

lvcreate -l 100%FREE --poolmetadatasize 200M --thinpool $LV $VG

[EDIT] Well, no answer, so now I'm going with 1%. This has worked for us so far, although it is probably still too prepared.

  DISK=/dev/xvdf
  VG=docker_vg
  LV=docker_pool
  DOCKER_POOL_METADATA_PERCENTAGE=1

  DISK_SIZE=$(blockdev --getsize64 ${DISK})
  META_DATA_SIZE=$(echo "scale=0;${DISK_SIZE}*${DOCKER_POOL_METADATA_PERCENTAGE}/100" | bc)
  pvcreate ${DISK}
  vgcreate ${DOCKER_VG} ${DISK}
  # This metadata sizing is in k because bytes doesn't seem to translate properly
  lvcreate -l 100%FREE --poolmetadatasize $((${META_DATA_SIZE}/1024))k --thinpool ${DOCKER_POOL} ${DOCKER_VG}
+4
source share

Source: https://habr.com/ru/post/1624862/


All Articles