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

Tweak for Low-Memory usage. Make compatible with raspberry pi. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Phaiax
Copy link

@Phaiax Phaiax commented Oct 7, 2020

Hello Convergence Team

The current convergence-omnibus image is very memory hungry. It is almost impossible to run more than this application on a less powerful machine.

This PR is not intended for merging but as a proposal for an additional, less hungry docker image.
Maybe you could also add a third alternative container that can be used on a raspberry pi.

Please see the commit message for details.

Best Regards, Daniel

(See also https://github.com/Phaiax/django-convergence-ace/ )

The orientDB tries to allocate too much memory for a small raspberry pi.
This commit reduces the RAM usage of the internally used orientdb.

Important: Start the docker container with
    --env ORIENTDB_OPTS_MEMORY="-Xms200M -Xmx200M -XX:MaxDirectMemorySize=200M"
to further reduce memory usage.

The settings for the orientdb have been found by try and error.
This is a list of all [db parameters](http://www.orientdb.com/docs/last/admin/Configuration.html).
I used some suggestions from
[this](https://stackoverflow.com/questions/37016787/orientdb-2-1-11-java-process-consuming-too-much-memory/46023793)
stack overflow question and just went through all the config parameters of the documentation
and tweaked those that sounded like they would affect memory consumption.

The original base image did not have any binaries for the arm32 architecture on docker hub.
In fact, I did not found a single arm32 image with openjdk 12 jre/jdk. (why?)
So I tried openjdk 14 and it seems to work.

The new image is larger and based on ubuntu, but that's better than nothing.

In the orientdb server.sh there is this piece of code:

    # Raspberry Pi check (Java VM does not run with -server argument on ARMv6)
    if [ `uname -m` != "armv6l" ]; then
      JAVA_OPTS="$JAVA_OPTS -server "
    fi

I don't know if this workaround is still needed for the architecture `armv7l` of
the newer Raspberry Pis, but I simply replaced armv6l by armv7l. Seems to work.
@alalonde
Copy link

alalonde commented Oct 7, 2020

Thanks for doing this legwork and sharing! Would you mind sharing a bit about your use case? After making these changes, how many simultaneous users do you need to support? How large are your models? Which features of Convergence are you using (e.g. the modules at the right in our API docs)?

I agree that there are likely many smaller deployments of Convergence that could benefit from this smaller memory footprint.

@Phaiax
Copy link
Author

Phaiax commented Oct 8, 2020 via email

@mmacfadden
Copy link
Contributor

Wanted to check back in and see if you had any progress. We are re-tooling our containers and I am wondering if this configuration worked for you in the long run.

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

Successfully merging this pull request may close these issues.

3 participants