PacktPublishing / Cloud-Native-Observability

Cloud Native Observability with OpenTelemetry, Published by Packt
https://www.packtpub.com/product/cloud-native-observability-with-opentelemetry/9781801077705
MIT License
96 stars 48 forks source link

chapter 02: Application exit due to OOM on MacBook Pro M1 #24

Open jiekun opened 1 year ago

jiekun commented 1 year ago

I think it's fine to re-open this issue https://github.com/PacktPublishing/Cloud-Native-Observability/issues/19. I am using Macbook Pro M1 16' with Ventura 13.2.1.

It seems the example application is consuming more resources than expected. They are easy to exit due to OOM.

I think it's more likely to be the issue of the M1 processor and arm64/amd64. The application itself should be fine enough to be an example.

So it might be better to demonstrate the known issue in README.md in chapter02, and lift the memory limit a little bit higher.

CONTAINER ID   NAME                      CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O        PIDS
55b6edc83153   shopper                   0.51%     84.52MiB / 3.841GiB   2.15%     682kB / 1.41MB    0B / 360kB       9
c8bba4c53200   grocery-store             14.43%    209.1MiB / 256MiB     81.70%    1.21MB / 1.91MB   0B / 381kB       19
aeba0817fdbe   inventory                 12.79%    199.7MiB / 256MiB     78.01%    739kB / 1.19MB    190kB / 385kB    19
0abd7428313d   grafana                   0.03%     25.57MiB / 3.841GiB   0.65%     27.9kB / 9.72kB   594kB / 217kB    9
90f93f3fe692   promtail                  0.97%     14.59MiB / 3.841GiB   0.37%     3.24kB / 1.82kB   307kB / 377kB    11
2785d432f8e2   prometheus                0.69%     25.89MiB / 3.841GiB   0.66%     654kB / 141kB     36.9kB / 463kB   11
a59b518fbc3f   opentelemetry-collector   1.52%     37.02MiB / 3.841GiB   0.94%     2.65MB / 3.48MB   0B / 0B          10
c3bda125a3b1   loki                      0.13%     20.86MiB / 3.841GiB   0.53%     429kB / 73.5kB    184kB / 106kB    9
48f806f3fdc3   jaeger                    0.21%     21.04MiB / 3.841GiB   0.53%     2.04MB / 187kB    0B / 0B          10
docker version ```bash ➜ chapter02 git:(main) ✗ docker version Client: Cloud integration: v1.0.31 Version: 20.10.24 API version: 1.41 Go version: go1.19.7 Git commit: 297e128 Built: Tue Apr 4 18:21:21 2023 OS/Arch: darwin/arm64 Context: default Experimental: true Server: Docker Desktop 4.18.0 (104112) Engine: Version: 20.10.24 API version: 1.41 (minimum version 1.12) Go version: go1.19.7 Git commit: 5d6db84 Built: Tue Apr 4 18:17:07 2023 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.18 GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0 ```
docker compose version ```bash ➜ chapter02 git:(main) ✗ docker compose version Docker Compose version v2.17.2 ```
jiekun commented 1 year ago

BTW 80M works totally fine in my Ubuntu16.04 VM.

Memory usage of those applications can be stabilized at around 180-200 MiB (even if I raise the limit to 1 GiB, to see if there is a memory leak or something similar) on my laptop.

It's still hard to predict how they acquire memory in other OS/environments, I think the better way is to add a few sentences in README.md so that our readers won't feel frustrated at their first deployment (chapter02)