Giter Site home page Giter Site logo

Reduce memory footprint about base-image HOT 7 OPEN

rgaudin avatar rgaudin commented on August 30, 2024
Reduce memory footprint

from base-image.

Comments (7)

rgaudin avatar rgaudin commented on August 30, 2024 1

@rgaudin I'm worried to read that metrics would be a mandatory package. I think it should not.

You misread. I mentioned “baseline of tools” listing it in opposition to content. Neither those kiwix tools nor content are of concerned in this repo. I just want to emphasis that the bare system is already using a lot of RAM

from base-image.

rgaudin avatar rgaudin commented on August 30, 2024 1

Now that we're based off bookworm, podman is available in a recent-enough (4.3.1) package. We may look into #7 again if docker turns out to be an issue on Pi Zero2W

from base-image.

rgaudin avatar rgaudin commented on August 30, 2024 1

@rgaudin Being impatient. Anything stopping us to make right now a wikimed image and test on this HW?

I don't have time to investigate but every time I booted on Pi2ZW with a working docker-compose (and the rest), it froze. When the compose failed to start (missing binding folder for instance) the system worked. I have bigger fishes to fry first but I'll come to this and post updates.

from base-image.

kelson42 avatar kelson42 commented on August 30, 2024

@rgaudin I'm worried to read that metrics would be a mandatory package. I think it should not.

from base-image.

kelson42 avatar kelson42 commented on August 30, 2024

@rgaudin Being impatient. Anything stopping us to make right now a wikimed image and test on this HW?

from base-image.

rgaudin avatar rgaudin commented on August 30, 2024

This is not looking very good.

I've looked into switching our docker stack to podman but ran into issues around networking.
Podman's typical use case is very different from ours and nobody appears to be using it on arm64.
Still a good option to consider in the future but given how fast it evolves and the fact that there's no vendor-provided repo is an issue ATM.

I've also looked into switching to balena-engine. Balena has the advantage of being tailored for IoT and low-memory and is stable (or doesn't evolve much depending on how you look at it). It's a fork of docker (moby) and is thus relatively close to the real thing albeit a bunch of missing features… which we are not depending on at the moment.

Works well for our use case but unfortunately, it's not enough for the Pi0-2W (or the Pi3A).

From what I observed, I believe this HW could support a moderate hotspot usage (limited number of apps, limited number of users) but the main blocker is the start-up phase: initializing the containers all at once create a spike in memory usage that forces for the engine and the system to kill process for OOM.

This could probably be worked around to some extent, and at the expense of maintenance. Some example:

  • force an order on the compose
  • individualize the services (instead of compose) to ensure all of them are started one by one
  • reduce the base-system memory usage: removing services we dont need
  • rewrite our scripts in bash or even sh
  • use lighter base docker images for all services (not sure we can do more here)
  • remove some containers based on target device and/or other conditions: hwclock could be spared on system with read-only packages
  • better configure/optimize services inside our containers
  • bundle some services together (kind of an anti-pattern): have the reverse-proxy serve homepage instead of proxying home service.

All of those require significant efforts for which gain is unknown upfront.

For this reason, I suggest we keep this ticket open but:

  • Don't support 512M RAM devices (Pi0-2W, Pi3A) in v1
  • Use balena as OCI engine. Forces us to stick to their features support. Switching back to docker is a breeze
  • Discuss a strategy and open more focused tickets for next version

from base-image.

kelson42 avatar kelson42 commented on August 30, 2024

Don't support 512M RAM devices (Pi0-2W, Pi3A) in v1

This is the path to follow IMHO.

from base-image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.