Registry GC源码分析
2017-01-22 00:00
239 查看
摘要: Registry GC源码分析
The Stpes to GC in product
###Steps:
detect and make sure
docker stop $registry
docker run -it --name gc --rm --volumes-from registry registry:2.5.0 garbage-collect --dry-run /etc/registry/config.ym
delete truely
docker run -it --name gc --rm --volumes-from registry registry:2.5.0 garbage-collect /etc/registry/config.yml
docker start $registry
###Code Analysis of Registry GC
hello-world
hello-world: marking manifest sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf
hello-world: marking blob sha256:03f4658f8b782e12230c1783426bd3bacce651ce582a4ffb6fbbfa2079428ecb
hello-world: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
hello-world: marking configuration sha256:690ed74de00f99a7d00a98a5ad855ac4febd66412be132438f9b8dbd300a937d
ubuntu
4 blobs marked, 5 blobs eligible for deletion
blob eligible for deletion: sha256:28e09fddaacbfc8a13f82871d9d66141a6ed9ca526cb9ed295ef545ab4559b81
blob eligible for deletion: sha256:7e15ce58ccb2181a8fced7709e9893206f0937cc9543bc0c8178ea1cf4d7e7b5
blob eligible for deletion: sha256:87192bdbe00f8f2a62527f36bb4c7c7f4eaf9307e4b87e8334fb6abec1765bcb
blob eligible for deletion: sha256:b549a9959a664038fc35c155a95742cf12297672ca0ae35735ec027d55bf4e97
blob eligible for deletion: sha256:f251d679a7c61455f06d793e43c06786d7766c88b8c24edf242b2c08e3c3f599
the blobs marked are
In the example above, you can see 4 blobs marked, 5 blobs eligible for deletion. When we make GC scheme in pro, we can decide whether to trigger GC according the number of blobs marked eligible. for example, when the number of blobs marked eligible more than 500, trigger the Registry GC cmd.
The Stpes to GC in product
###Steps:
detect and make sure
docker stop $registry
docker run -it --name gc --rm --volumes-from registry registry:2.5.0 garbage-collect --dry-run /etc/registry/config.ym
delete truely
docker run -it --name gc --rm --volumes-from registry registry:2.5.0 garbage-collect /etc/registry/config.yml
docker start $registry
###Code Analysis of Registry GC
run-dry GC demo
run-dry will print the blobs to be deleted, but will not be deleted truely.hello-world
hello-world: marking manifest sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf
hello-world: marking blob sha256:03f4658f8b782e12230c1783426bd3bacce651ce582a4ffb6fbbfa2079428ecb
hello-world: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
hello-world: marking configuration sha256:690ed74de00f99a7d00a98a5ad855ac4febd66412be132438f9b8dbd300a937d
ubuntu
4 blobs marked, 5 blobs eligible for deletion
blob eligible for deletion: sha256:28e09fddaacbfc8a13f82871d9d66141a6ed9ca526cb9ed295ef545ab4559b81
blob eligible for deletion: sha256:7e15ce58ccb2181a8fced7709e9893206f0937cc9543bc0c8178ea1cf4d7e7b5
blob eligible for deletion: sha256:87192bdbe00f8f2a62527f36bb4c7c7f4eaf9307e4b87e8334fb6abec1765bcb
blob eligible for deletion: sha256:b549a9959a664038fc35c155a95742cf12297672ca0ae35735ec027d55bf4e97
blob eligible for deletion: sha256:f251d679a7c61455f06d793e43c06786d7766c88b8c24edf242b2c08e3c3f599
the blobs marked are
not to deleted, the blobs eligible are
to delete.
In the example above, you can see 4 blobs marked, 5 blobs eligible for deletion. When we make GC scheme in pro, we can decide whether to trigger GC according the number of blobs marked eligible. for example, when the number of blobs marked eligible more than 500, trigger the Registry GC cmd.
相关文章推荐
- SSCLI中GC垃圾回收源码分析(3) - GarbageCollectGeneration()与SuspendEE
- SSCLI中GC垃圾回收源码分析(2) - GarbageCollect()与Spin Lock
- 源码分析HotSpot GC过程(一)
- Dubbo源码分析(四):Dubbo之Registry
- 源码分析HotSpot GC过程(三):TenuredGeneration的GC过程
- SSCLI中GC源码分析(1) - EE与BCL之间的调用接口FCall
- lua 5.2 GC 源码分析 二
- GC 源码分析
- docker1.9源码分析(四):docker daemon下载镜像时与registry交互
- Distribution源码分析(四):registry push操作详细流程
- SSCLI中GC垃圾回收源码分析(3) - GarbageCollectGeneration()与SuspendEE
- lua 5.2 GC 源码分析 二
- Ruby的GC机制源码分析(2)
- Ruby的GC机制源码分析(4)
- JVM源码分析之SystemGC完全解读
- SSCLI中GC垃圾回收源码分析(2) - GarbageCollect()与Spin Lock
- Ruby的GC机制源码分析(3)
- zend_registry 源码分析
- lua 5.2 GC 源码分析 一
- Java GC 源码分析(2)