Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy.resources.limits.cpus not effective? #9542

Closed
vvfock3r opened this issue Jun 8, 2022 · 0 comments · Fixed by #9552
Closed

deploy.resources.limits.cpus not effective? #9542

vvfock3r opened this issue Jun 8, 2022 · 0 comments · Fixed by #9552

Comments

@vvfock3r
Copy link

vvfock3r commented Jun 8, 2022

Description
deploy.resources.limits.cpus not effective?

Steps to reproduce the issue:

  1. Create docker-compose.yml
version: "3.9"
services:
  server:
    image: centos:7
    command: sh -c "cat /dev/urandom | gzip -9 >/dev/null"
    deploy:
      resources:
        limits:
          cpus: '0.50'
          memory: 500M
        reservations:
          cpus: '0.25'
          memory: 200M
  1. Create and start container
[root@localhost demo]# docker compose --compatibility up -d
[+] Running 2/2
 ⠿ Network demo_default     Created                       0.1s
 ⠿ Container demo_server_1  Started                       0.4s
  1. stats
[root@localhost ~]# docker container stats
eac3bc5c5616   demo_server_1   156.26%   1.129MiB / 500MiB   0.23%     126B / 0B        0B / 0B           3
06bb69bb16bd   jinhui.dev      0.00%     4.684MiB / 1GiB     0.46%     2.5MB / 95.2MB   3.29MB / 8.19kB   3

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

Docker Compose version v2.5.0

Output of docker info:

[root@localhost ~]# docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  compose: Docker Compose (Docker Inc., v2.5.0)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 2
  Running: 2
  Paused: 0
  Stopped: 0
 Images: 48
 Server Version: 20.10.15
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: active
  NodeID: l6fgmu9f6u03g82ojcomrfq2o
  Is Manager: true
  ClusterID: 1bbb1x7vk0fvbbichue1n0pxi
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 10.0.8.4
  Manager Addresses:
   10.0.8.4:2377
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc version: v1.1.1-0-g52de29d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.18.0-348.7.1.el8_5.x86_64
 Operating System: CentOS Linux 8
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.774GiB
 Name: localhost
 ID: VEFC:HFK3:WVWO:JO5V:LAEB:KCJF:EAOR:UIRG:KM6X:FARK:ISRN:GIIH
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://mirror.ccs.tencentyun.com/
 Live Restore Enabled: false

Additional environment details:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant