openJDK 17.0.4 and 17.0.6 behave differently for docker --cpu-shares
andyz
zhanglc77 at gmail.com
Mon Apr 8 06:59:24 UTC 2024
Hi All,
Recently I tried to upgrade my project from openjdk 17.0.4 to 17.0.6, and
after upgrading, I found that one of the opensearch containers had doubled
the number of threads it was using. After investigating, I found that it
seems that --cpu-shares is not working for 17.0.6, But I haven't seen any
relevant updates in the release notes for 17.0.6.
I have attempted a reproduction(see below), Does openjdk no longer support
--cpu-shares? If I want to use a newer version of openjdk, do I have to use
some other parameter like cpu-limit ?
thank you all .
*docker run -it --cpu-shares=5120 azul/zulu-openjdk:17.0.4.1-jre-headless
bash -c 'java -Xlog:os+container=trace -version'*
[0.000s][trace][os,container] OSContainer::init: Initializing Container
Support
[0.000s][debug][os,container] Detected optional pids controller entry in
/proc/cgroups
[0.000s][debug][os,container] Detected cgroups hybrid or legacy hierarchy,
using cgroups v1 controllers
[0.000s][trace][os,container] Path to /memory.use_hierarchy is
/sys/fs/cgroup/memory/memory.use_hierarchy
[0.001s][trace][os,container] Use Hierarchy is: 1
[0.001s][trace][os,container] Path to /memory.limit_in_bytes is
/sys/fs/cgroup/memory/memory.limit_in_bytes
[0.001s][trace][os,container] Memory Limit is: 9223372036854771712
[0.001s][trace][os,container] Non-Hierarchical Memory Limit is: Unlimited
[0.001s][trace][os,container] Path to /memory.stat is
/sys/fs/cgroup/memory/memory.stat
[0.001s][trace][os,container] Hierarchical Memory Limit is:
9223372036854771712
[0.001s][trace][os,container] Hierarchical Memory Limit is: Unlimited
[0.001s][trace][os,container] Path to /cpu.cfs_quota_us is
/sys/fs/cgroup/cpu/cpu.cfs_quota_us
[0.001s][trace][os,container] CPU Quota is: -1
[0.001s][trace][os,container] Path to /cpu.cfs_period_us is
/sys/fs/cgroup/cpu/cpu.cfs_period_us
[0.001s][trace][os,container] CPU Period is: 100000
[0.001s][trace][os,container] Path to /cpu.shares is
/sys/fs/cgroup/cpu/cpu.shares
[0.001s][trace][os,container] CPU Shares is: 5120
[0.001s][trace][os,container] CPU Share count based on shares: 5
[0.001s][trace][os,container] OSContainer::active_processor_count: 5
[0.001s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 5
[0.001s][debug][os,container] container memory limit unlimited: -1, using
host value
[0.001s][debug][os,container] container memory limit unlimited: -1, using
host value
[0.002s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 5
[0.007s][debug][os,container] container memory limit unlimited: -1, using
host value
[0.015s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 5
[0.019s][debug][os,container] container memory limit unlimited: -1, using
host value
openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment Zulu17.36+17-CA (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu17.36+17-CA (build 17.0.4.1+1-LTS, mixed mode,
sharing)
*docker run -it --cpu-shares=5120 azul/zulu-openjdk:17.0.6-jre-headless
bash -c 'java -Xlog:os+container=trace -version'*
[0.000s][trace][os,container] OSContainer::init: Initializing Container
Support
[0.000s][debug][os,container] Detected optional pids controller entry in
/proc/cgroups
[0.000s][debug][os,container] Detected cgroups hybrid or legacy hierarchy,
using cgroups v1 controllers
[0.001s][trace][os,container] Path to /memory.use_hierarchy is
/sys/fs/cgroup/memory/memory.use_hierarchy
[0.001s][trace][os,container] Use Hierarchy is: 1
[0.001s][trace][os,container] Path to /cpu.cfs_quota_us is
/sys/fs/cgroup/cpu/cpu.cfs_quota_us
[0.001s][trace][os,container] CPU Quota is: -1
[0.001s][trace][os,container] Path to /cpu.cfs_period_us is
/sys/fs/cgroup/cpu/cpu.cfs_period_us
[0.001s][trace][os,container] CPU Period is: 100000
[0.001s][trace][os,container] OSContainer::active_processor_count: 12
[0.001s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 12
[0.001s][trace][os,container] total physical memory: 25085235200
[0.001s][trace][os,container] Path to /memory.limit_in_bytes is
/sys/fs/cgroup/memory/memory.limit_in_bytes
[0.001s][trace][os,container] Memory Limit is: 9223372036854771712
[0.001s][trace][os,container] Non-Hierarchical Memory Limit is: Unlimited
[0.001s][trace][os,container] Path to /memory.stat is
/sys/fs/cgroup/memory/memory.stat
[0.001s][trace][os,container] Hierarchical Memory Limit is:
9223372036854771712
[0.001s][trace][os,container] Hierarchical Memory Limit is: Unlimited
[0.001s][debug][os,container] container memory limit unlimited: -1, using
host value 25085235200
[0.002s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 12
[0.014s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 12
openjdk version "17.0.6" 2023-01-17 LTS
OpenJDK Runtime Environment Zulu17.40+19-CA (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM Zulu17.40+19-CA (build 17.0.6+10-LTS, mixed mode,
sharing)
*docker run -it --cpu-shares=5120 azul/zulu-openjdk:17-jre-headless-latest
bash -c 'java -Xlog:os+container=trace -version'*
[0.000s][trace][os,container] OSContainer::init: Initializing Container
Support
[0.000s][debug][os,container] Detected optional pids controller entry in
/proc/cgroups
[0.000s][debug][os,container] Detected cgroups hybrid or legacy hierarchy,
using cgroups v1 controllers
[0.001s][trace][os,container] Path to /memory.use_hierarchy is
/sys/fs/cgroup/memory/memory.use_hierarchy
[0.001s][trace][os,container] Use Hierarchy is: 1
[0.001s][trace][os,container] Path to /cpu.cfs_quota_us is
/sys/fs/cgroup/cpu/cpu.cfs_quota_us
[0.001s][trace][os,container] CPU Quota is: -1
[0.001s][trace][os,container] Path to /cpu.cfs_period_us is
/sys/fs/cgroup/cpu/cpu.cfs_period_us
[0.001s][trace][os,container] CPU Period is: 100000
[0.001s][trace][os,container] OSContainer::active_processor_count: 12
[0.001s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 12
[0.001s][trace][os,container] total physical memory: 25085235200
[0.001s][trace][os,container] Path to /memory.limit_in_bytes is
/sys/fs/cgroup/memory/memory.limit_in_bytes
[0.001s][trace][os,container] Memory Limit is: 9223372036854771712
[0.001s][trace][os,container] Non-Hierarchical Memory Limit is: Unlimited
[0.001s][trace][os,container] Path to /memory.stat is
/sys/fs/cgroup/memory/memory.stat
[0.001s][trace][os,container] Hierarchical Memory Limit is:
9223372036854771712
[0.001s][trace][os,container] Hierarchical Memory Limit is: Unlimited
[0.001s][debug][os,container] container memory limit unlimited: -1, using
host value 25085235200
[0.002s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 12
[0.017s][trace][os,container] CgroupSubsystem::active_processor_count
(cached): 12
openjdk version "17.0.10" 2024-01-16 LTS
OpenJDK Runtime Environment Zulu17.48+15-CA (build 17.0.10+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.48+15-CA (build 17.0.10+7-LTS, mixed mode,
sharing)
--
Across the Great Firewall, you can reach every corner in the world.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/container-discuss/attachments/20240408/838a13ad/attachment-0001.htm>
More information about the container-discuss
mailing list