If Roon Server is running as root and not a user it can cause problems

A question or two for anyone that knows. If Roon Server is running as root and not a user it can cause problems. The user root is a privileged user as as such has more access when a “user” job running fills up memory or a hard disk. 100% full for a user is not 100% full for the superuser root. So you can still log in and diagnose the problem. I run my roon under user roon. Mounts are down as root either NFS or CIFS. I don’t let roon have access to mount. All seams to work well. I don’t have that many files to catalouge. But I have tried mounting the same music partition at least ten times and asked Roon Server to access the directories the mounts are on. Linux and unix will use all the available memory on the principle that it’s available so we use it for cash and the like. Pretty pointless adding memory if only half of it gets used. So far so good. As for the system slowing down. I would have thought that this was an access time problem. throwing more CPU’s at it might help. But the server is running under mono. I don’t know how the database works though or if it’s a good one. But it does look like it runs in memory as you can see the build up.

This is going off-topic, and isn’t relevant to memory leaks. However, I will respond here, and if necessary split the discussion later.

For the majority, it is likely to cause more problems when not run as root. Indeed, the majority of apps do run with elevated permissions. This is not unusual.

It is unless you’re using quotas or you have a separate partion for / (root), user space etc. However, since file systems are mounted on /, it is possible for a user to fill the drive, e.g., when a USB drive disconnects and the user writes to /media, and renders the computer inoperable.

Making mount points immutable can solve this.

This is incorrect. Memory is allocated as applications request it. Otherwise, you’d see frequent crashes (as happens with Roon OS when the in-memory database is larger than physical memory.)

It uses .NET Core, not Mono, and has done for some time.

Moreover, more CPU may not help. Roon performs best with higher single thread performance rather than multiple cores.

I run Roon Server in a non-privileged Podman container, and this works extremely well. But this is Tinkering territory.

2 Likes

I’ve split out to it’s own topic.

2 Likes

While it’s not going to be used for application memory unless an app allocates it, there is a bit of truth in it as far as the kernel will typically use most of it for something else, such as disk caches. Of course, this will be automatically given up as soon as it’s needed.

1 Like

Yes, in my original edit I was going to say this is not strictly true, but I didn’t want to go off on Linux memory allocation.

Whilst it is true that Linux appears to use all available memory, especially on systems running on 4, 8 or 16 GB, that’s not the whole picture, and certainly not a sign of running out of memory. For instance, my server, which also runs a desktop environment, is using less than 25% of the 67 GB (including a little swap), but the cache is currently > 30 GB.

For Roon, memory is important because LevelDB is an in-memory database. Fortunately, garbage collection seems to be working well now, and memory allocation is not running away.

Incidentally, my Roon container is currently using 1.46% CPU and 3.97 GB memory while playing to a single zone with volume levelling. IOW, if I was running Roon OS on ROCK, 4 GB would be insufficient for my current library of ~1,600 albums since the OS would consume ~1 GB, too. This is why I think 16 GB is the sweet spot on price and performance for the vast majority of users (although 8 GB would probably do.)

1 Like

Yeah, I just wanted to be picky / precise because the OP might have read somewhere that the Linux kernel will use all available memory for something, and that’s strictly speaking true and a good thing in a general-purpose OS because unused RAM is pointless. (Even if much is usually just used for buffers and disk caches if there’s more RAM than applications need)

Because this discussion frequently occurs on Linux boards when newbies wonder why all RAM is always shown as used by the kernel in top or similar tools.

Of course, as you pointed out, that doesn’t mean that it’s used by applications, which allocate the memory they need, and the kernel won’t assign more to them just because it exists.

1 Like

Unix / Linux has reserved file system space for root (typically 5%). So if a user application fills a partition up then superuser root can still get in and diagnose the issue.

Since most versions do not have a root login, and require sudo, the reality is more likely booting a rescue system and mounting the root partition for maintenance. Indeed, while it may be possible to do some basic rescue actions, it is prudent to do this from a rescue system.

Moreover, the reservation is more concerned with filesystem performance, and may be tuned, depnding on disk size etc.

I should add that we are discussing a general purpose computer, and not a remote headless server where there is segregation between root processes and user applications etc.