-
Notifications
You must be signed in to change notification settings - Fork 17
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
Very slow read speed on the qemu image #13
Comments
You're right, running Docker within QEMU can significantly impact disk read/write speeds, leading to longer build and pull times. This is often due to the virtualization overhead and how QEMU emulates disk access. While using a Additionally, ensure that your host system (where you're running QEMU) has sufficient resources available. If the host system is already under heavy load, it will further impact QEMU's performance. Here are some things you can try:
Let me know if these suggestions help improve your build speeds within QEMU. If you find any specific configurations that work well, please share them with the community so others can benefit! |
I feel sad that you had to use AI to write this. However I hope someone can provide configuration that can mitigate the speed issue because this trick is completely useless to run mid-large docker containers. |
AI 💀💀💀 💀💀 |
I understand your concern about AI use in this project. While I do leverage AI to improve my writing (as a non-native English speaker) and make my communication clearer, I assure you that the core functionality of this repo is not solely reliant on AI-generated code. I appreciate your feedback on the speed issue. It's definitely a valid concern, and I'm actively working on optimizing the configuration to improve performance for larger Docker containers. I'm open to suggestions and contributions from the community. Let's work together to make this project as efficient and helpful as possible! Note: this is AI generated too |
Maybe use arm64 architecture instead of x86-64. The latter is emulated on Android and ARM is native speed. |
How can you do that in the terminal exactly I couldn't make it run. pkg install qemu-system-arm
qemu-img create -f raw alpine-arch64.img 2G
wget https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/aarch64/alpine-virt-3.20.0-aarch64.iso
qemu-system-arm \
-machine virt \
-m 1024 \
-smp cpus=2 \
-drive if=pflash,format=raw,read-only=on,file=$PREFIX/share/qemu/edk2-aarch64-code.fd \
-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 \
-device virtio-net,netdev=n1 \
-drive file=alpine-arch64.img,format=raw,if=virtio \
-cdrom alpine-virt-3.20.0-aarch64.iso \
-nographic But it just does nothing I waited 30 mins |
Typo ? Or maybe try this: |
There is no typo it's the filename of the virtual disk that I have created with |
You can try the link above from hub.docker.com and pick the second entry which is aarch64. |
I don't why are you referencing the Termux Docker image, the purpose of this repository is to run docker inside termux(non rooted android) not the other way around. |
Is this not a Docker image for Termux which you can deploy under Termux on a non-rooted Android ? |
No, Try to read or translate the README.md file https://github.com/cyberkernelofficial/docker-in-termux/blob/main/README.md |
Ok I have reached to the Mailing list of Qemu https://lists.nongnu.org/archive/html/qemu-arm/2024-06/msg00026.html to get help in regards to running it in aarch64, I have made a mistake by using pkg install qemu-system-aarch64
qemu-img create -f raw alpine-arch64.img 2G
wget https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/aarch64/alpine-virt-3.20.0-aarch64.iso
qemu-system-aarch64 -cpu cortex-a55 \
-machine virt \
-m 1024 \
-smp cpus=2 \
-drive if=pflash,format=raw,read-only=on,file=$PREFIX/share/qemu/edk2-aarch64-code.fd \
-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 \
-device virtio-net,netdev=n1 \
-cdrom alpine-virt-3.20.0-aarch64.iso -nographic alpine-arch64.img
When I did the benchmark again nothing changed... I still get 4Mb/s read speed on the disk which is disappointing. Thanks anyways @freebrowser1 for the idea. |
The problem is that the arm64 variant is also emulated (which is slow) rather than virtualized. Most Android devices require hardware virtualization which may require root. |
The problem is in I/O performance, If we can figure a way to boost disk speed half of the problem is fixed.
Consumer smartphones don't have kvm module in their kernel out of the stock, you have to flash a custom rom with root. this is not hard in Pixel devices but I want something that works even without rooting. |
I noticed massive read speed reduction (like 10-20 times) when inside qemu this makes building/pulling images take hours.
Do you have any improvements that can be made here?
I tested with this script https://github.com/thodnev/MonkeyTest/blob/master/monkeytest.py
inside termux i get normal 90MB/s but inside qemu i get 4MB/s.
I tried my best to fix this bottlneck best i got is 10MB/s by using .raw image format instead of Qcow2
The text was updated successfully, but these errors were encountered: