Skip to content
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

Installing on Raspberry Pi with swapfile #167

Open
ALTracer opened this issue Jan 16, 2022 · 1 comment
Open

Installing on Raspberry Pi with swapfile #167

ALTracer opened this issue Jan 16, 2022 · 1 comment

Comments

@ALTracer
Copy link

When installing the runtime from master branch, I tried to time it and noticed a couple major inefficiencies.
Hardware: Raspberry Pi 3B with 1G RAM & microSD showing 30MB/s seq.read, should achieve sub-1h build time on Raspbian buster armhf.

  1. 1000MB swapfile for dnp3 compilation was being dd-ed longer than the actual compilation ran
  2. make not parallel -- dnp3 builds in 9 minutes with make -j$(nproc) on 4 cores @1200mhz.
  3. Never cleaned after builds&installs -- the matiec and dnp3 leave A LOT of .o, .ii, .s build artifacts behind. (e.g. make -C matiec_src mostlyclean, make -C dnp3_src clean)

I already have set up ZRAM of ~500MB just in case.

#13 mentions install failures on 512MB RAM boards, so I tried to profile memory eaten -- dnp3 cmake make -j4 build in fact does require almost ~500MB once during linking stage. But you really should check for available memory before wasting half the build time on creating a temporary swapfile, potentially failing the build altogether on insufficient space (instead of insufficient RAM).

free -mt | grep "Total:" | awk '{print $4}' will return free RAM+SWAP as a decision point for requiring more swap (or ZRAM).

#62 mentions an install failure inside a Docker container on swapon, and I think, too, kernel-level manipulations should be avoided when possible.

I might do a PR later with make -j$(nproc) || make -j1, make clean after ALL installs and mem/swap checks. I am somewhat proficient in shell.

@thiagoralves
Copy link
Owner

Great points! Fixing those would indeed improve the installation process time a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants