1
votes

We have a SignalR push server using Mono/Owin on a Linux Debian server.

We perform a load test and we get a different behaviour according to how the push is started on systemd

Working: ExecStart=/bin/su root -c '/usr/bin/mono --server mydaemon.exe -l:/var/run/mydaemon.pid'

Hanging after around 1k connections: ExecStart=/usr/bin/mono --server mydaemon.exe -l:/var/run/mydaemon.pid

We may reproduce the different behaviour anytime: in the second case, the test client stay in SignalR negotiate call, without receiving any answer. We actvated as well the export of the environment varables "max thread" for Mono for both case.

So the question is, what could be the difference in resource system usage/avaliability in these 2 cases?

1
Use a tool like plimit to see what resource limits are being applied in each case - it's most likely that there are limits in place for the ordinary user that aren't there for root.Petesh
Hi Thanks for the suggestions. Even if we run in both case as root, using "su" we got larger openFile limit (65536) and without is limited to 1024. So we found that systemd default open file limit is 1024, but this limit is not applied when we start the process in systemd using "su". Thats the solution. I don't know if you may put your comment as an answer, I'll be more than happy to mark as anwered. Thanks a lot!Robert

1 Answers

2
votes

In the systemd service definition, you can specify the limit for the number of open files, so if you add a line:

LimitNOFILE=65536

in the [Service] section of the service definition file, it should set the limit to that value, rather than the default which comes through systemd as 1024.

The systemd-system.conf file defines the parameters for defaults for the limits (e.g. DefaultLimitNOFILE), and the systemd.exec manual page defines the parameters that can be used to set overrides on the various limits.