abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.78k stars 397 forks source link

colima oracle-xe very slow #463

Open jhswedeveloper opened 2 years ago

jhswedeveloper commented 2 years ago

Description

Hi I might be doing something wrong but i have a full spec mac m1 max and I ran following

colima start --arch x86_64 --cpu 8 --memory 8 --disk 5

docker run -d -p 1521:1521 --cpus="8" --memory=4096M -e ORACLE_PASSWORD=test -e APP_USER=test -e APP_USER_PASSWORD=test -v oracle-volume:/opt/oracle/oradata gvenzl/oracle-xe

When I run my java app it basically cleans all table and add new tables, whole thing used to take 20 sec on my windows machine. Now takes 2 minutes.

I've tried increasing cpu because when i run

docker stats

I see the cpu is spiking under load, 100-500%, ive tried increasing to 16 cpus but no difference in total time execution.

I'm starting to suspect if it's network related?

Screenshot 2022-11-02 at 20 47 59

Version

Colima Version: Lima Version: Qemu Version:

Operating System

Reproduction Steps

1. 2. 3.

Expected behaviour

No response

Additional context

No response

abiosoft commented 2 years ago

That is because you are emulating x86_64 on your m1 device. That is expected.

quom commented 1 year ago

@abiosoft does colima use 'fast' or 'slow' mode for running the linux host? https://github.com/lima-vm/lima/blob/master/docs/multi-arch.md

abiosoft commented 1 year ago

@quom you decide.

According to the linked Lima doc, if you start colima with non-native architecture, it is slow mode.

# m1
colima start --arch x86_64 # slow mode

# intel
colima start --arch aarch64 # slow mode

If you start colima with native architecture, but only specify custom arch with docker (or containerd), it is fast mode.

# m1
docker run --platform linx/amd64 gvenzl/oracle-xe # fast mode

# intel
docker run --platform linx/amd64 gvenzl/oracle-xe # fast mode

Kindly bear in mind that there is no fast mode per se on cross-architecture, the performance will be notably degraded. What is however faster is the VM performance.

The slow mode will have a slow container and VM, while the fast mode will have only a slow container but a performant VM.

tzahari commented 1 year ago

@abiosoft fixed a small typo in platform paramter:

# m1
docker run --platform linux/amd64 gvenzl/oracle-xe # fast mode

# intel
docker run --platform linux/amd64 gvenzl/oracle-xe # fast mode