qemu-user-static icon indicating copy to clipboard operation
qemu-user-static copied to clipboard

Unnatural feeling slowdowns with process sleeping during build or other cpu intensive jobs inside ubuntu arm64 container

Open Root-voidX opened this issue 4 years ago • 7 comments

/kind question

Description:

Hello, so I'm running the latest version of qemu-user-static available from the Fedora 34 repo (v5.7 i believe) and in using it to run an Ubuntu 21.04 image inside a docker (moby-engine) container (v. 21). My system has an i7 5960x cpu (8c, 16t) and i noticed that when I'm compiling or running any cpu intensive (even in single core) application like openfoam snappyHexMesh tool, the process will sometimes sleep at 100% usage and not do anything. Surprisingly when it decides to do something its decent at its speed. But I'm wondering why is there a delay and if thats something normal.to be expected? Like it seems the terminal outputs are delayed.

Steps to reproduce the issue:

  1. Use any compiler or any openfoam solver

Describe the results you received:

Process will run for a bit, but then no output for some time while cpu is still being hit 100% and then after a pause it resumes, then repeat.

Describe the results you expected:

I guess, I expect the job to be either consistently slow or normal in terms of speed, the delay seems to feel like it shouldn't even happen, even with emulation

Environment:

  • QEMU version: (if you can know it): 5.7
  • Container application: Docker

Output of docker version, podman version or singularity version

[ai-fe@ai-workstation ~]$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.5.1)
 
Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 26
 Server Version: 20.10.8
 Storage Driver: btrfs
  Build Version: Btrfs v5.13.1 
  Library Version: 102
 Logging Driver: journald
 Cgroup Driver: systemd
 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: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: /usr/libexec/docker/docker-init
 containerd version: 
 runc version: 06fb178
 init version: 
 Security Options:
  seccomp
   Profile: default
  selinux
 Kernel Version: 5.13.12-200.fc34.x86_64
 Operating System: Fedora 34 (Thirty Four)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 11.77GiB
 Name: ai-workstation
 ID: 3NNL:LY6Y:VAGV:4YEB:GLOW:MDVZ:CRLY:TZXO:O3EI:UOHG:SZ2I:N3BL
 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
 Live Restore Enabled: true
 
[ai-fe@ai-workstation ~]$ 

Additional information optionally:

Root-voidX avatar Aug 29 '21 08:08 Root-voidX

@Root-voidX hi. I have updated the image of fedora right now. The latest versions of qemu and Fedora 33 and 34 are now used here. Could you try this? Maybe this will solve something.

lafin avatar Aug 29 '21 20:08 lafin

@Root-voidX hi. I have updated the image of fedora right now. The latest versions of qemu and Fedora 33 and 34 are now used here. Could you try this? Maybe this will solve something.

So do I just docker pull the latest image? Or do I need to update my qemu-user-static too?

Also updated my docker info

Root-voidX avatar Aug 30 '21 05:08 Root-voidX

Maybe I don't quite understand what you are doing. do you have a fedora 34 host system and are trying to run something inside an ubuntu image? Which image are you using ubuntu-core or ubuntu-debootstrap?

lafin avatar Aug 30 '21 20:08 lafin

Maybe I don't quite understand what you are doing. do you have a fedora 34 host system and are trying to run something inside an ubuntu image? Which image are you using ubuntu-core or ubuntu-debootstrap?

So the host is Fedora 34 x86_64. I am running an Ubuntu 21.01 (aarch64/arm64). I am using the official arm64 image from here (https://hub.docker.com/r/arm64v8/ubuntu/). So when I run cmake or any cpu intensive workload inside the ubuntu container, the progression of the process is not consistent. Like it will slowly move between tasks (i.e for cmake, like it will make maybe 5 targets) and then there is no update at all (all the while cpu is still being used) and then it progress again, then it hangs for bit, etc. I wanted to know if that is what to expect? Or is it something to do with my installation.

Root-voidX avatar Aug 30 '21 20:08 Root-voidX

oh i think this is not exactly the right place to do this, because this project is just a shell of what the qemu team is doing. If this is a regression then it is best to report it here https://www.qemu.org/contribute/report-a-bug/ btw, as far as I remember, each compilation for arm architecture is at least twice as slow as x64. This is the price of emulation.

lafin avatar Aug 30 '21 20:08 lafin

oh i think this is not exactly the right place to do this, because this project is just a shell of what the qemu team is doing. If this is a regression then it is best to report it here https://www.qemu.org/contribute/report-a-bug/ btw, as far as I remember, each compilation for arm architecture is at least twice as slow as x64. This is the price of emulation.

Okay nice, i submitted a report there. Is there away to point the multiarch image to a different installed qemu-user-static, i built the latest one from source and I want to try it. its located in /usr/local/qemu-user-static, so if I export it to PATH, will the mutli-arch container find it?

Root-voidX avatar Aug 31 '21 04:08 Root-voidX

It is very slow!

# uname -m
aarch64

# time apt install -yqq curl

real	1m27.875s
user	0m22.288s
sys	0m3.826s

waybackarchiver avatar Oct 23 '21 14:10 waybackarchiver