How to put a limit (Memory Max=) on a systemd service in a Raspberry Pi?
-
edjalmo -
February 9, 2019 at 2:48 AM -
Thread is Resolved
-
-
After add, CPU: 233ms shows, but memory don't.
-
My hardware is a Raspberry Pi 3b, your is the same?
But this don't interfere in anything, right?
-
Because the system partition of LibreELEC is a read-only partition, which is for a good reason. LibreELEC is set up for use as a HTPC environment, it's not meant for the typical tweaking & fiddling IT tinkerer.
You can edit things of you mount the partition as writeable first.
Just know that all edits will be gone with the next LibreELEC downgrade/upgrade.
How can I make it writable? To test this
there.
-
I'm using x86_64.
-
-
This don't worked too
-
I installed LE on another sd card and it's the same. I'm starting to think it's because I use in RPi version.
@Klojum , Can you help me?
-
Must be RPi difference then. Maybe some kernel config... Some CGROUP or MEMCG parameter.
-
Must be RPi difference then. Maybe some kernel config... Some CGROUP or MEMCG parameter.
Anyway, thank you very much for trying to help!
-
Ok, try adding cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to /flash/config.txt (or wherever boot parameters are set). Reboot and check systemctl status of kodi or whatever service.
-
I added, but don't worked too
-
-
I will open a new thread specifically asking about how to put a limit (Memory Max=) in a systemd service in a Raspberry Pi.
Thank you very much again for help me!
-
I will open a new thread specifically asking about how to put a limit (Memory Max=) in a systemd service in a Raspberry Pi.
Thank you very much again for help me!
Sorry, the page had not yet refresh when I posted it.
I added this and put MemoryMax=100M in the service, but it still does not show in status.
-
-
I'm doing something wrong?
Why is not working?
No idea. Don' have any RPi to test that.
thoradia: thanks. Not familiar with RPi boot files that's why I wrote "or wherever boot parameters are set"
-
Worked!!!
When you said
at the end of /flash/cmdline.txt
I thought it was to put in the line below, as this did not work. Today I add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 in the end of the line that already exists. So, staying that way
Codeboot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
and worked!
-