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

'--device-read-bps' '--device-write-bps' does not work #5321

Closed
jongwu opened this issue Aug 7, 2024 · 0 comments · Fixed by #5323
Closed

'--device-read-bps' '--device-write-bps' does not work #5321

jongwu opened this issue Aug 7, 2024 · 0 comments · Fixed by #5323

Comments

@jongwu
Copy link
Contributor

jongwu commented Aug 7, 2024

Description

using the latest docker/cli to test --device-write-bps does not work. It can't limit the IO bps.

Reproduce

docker run --device-read-bps /dev/sda2:10M busybox sh -c 'dd if=/dev/zero of=/tmp.img bs=10M count=10 oflag=direct conv=fsync'

Expected behavior

the speed of "dd" should be around 10M/s

docker version

# docker version
Client: Docker Engine - Community
 Version:           26.1.2
 API version:       1.45
 Go version:        go1.21.10
 Git commit:        211e74b
 Built:             Wed May  8 14:01:00 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.2
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.10
  Git commit:       ef1912d
  Built:            Wed May  8 13:59:54 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    26.1.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 26.1.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: false
  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 splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e377cd56a71523140ca6ae87e30244719194a521
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 5.10.134-16.2.an8.x86_64
 Operating System: Anolis OS 8.9
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 3.64GiB
 Name: k8s-master
 ID: 70439c98-8dad-4204-a5e3-effe155435af
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

No response

thaJeztah pushed a commit to thaJeztah/cli that referenced this issue Aug 9, 2024
Test "--device-read-bps" "--device-write-bps" will fail. The root
cause is that GetList helper return empty as its local variable
initialized to zero size.

This patch fix it by setting the related slice size to non-zero.

Signed-off-by: Jianyong Wu <[email protected]>
Fixes: docker#5321
(cherry picked from commit 73e78a5)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah pushed a commit to thaJeztah/cli that referenced this issue Aug 9, 2024
Test "--device-read-bps" "--device-write-bps" will fail. The root
cause is that GetList helper return empty as its local variable
initialized to zero size.

This patch fix it by setting the related slice size to non-zero.

Signed-off-by: Jianyong Wu <[email protected]>
Fixes: docker#5321
(cherry picked from commit 73e78a5)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah pushed a commit to thaJeztah/cli that referenced this issue Aug 9, 2024
Test "--device-read-bps" "--device-write-bps" will fail. The root
cause is that GetList helper return empty as its local variable
initialized to zero size.

This patch fix it by setting the related slice size to non-zero.

Signed-off-by: Jianyong Wu <[email protected]>
Fixes: docker#5321
(cherry picked from commit 73e78a5)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant