You are not logged in.

#1 2021-03-13 23:18:48

m00nman
Member
Registered: 2013-01-21
Posts: 12

Can't get systemd service to respect LimitNOFILESoft limit [solved]

Hello,

I've run into a problem with transmission where I constantly get an error "Too many open files"

First thing I tried is add LimitNOFILE=49152.

[Unit]
Description=Transmission BitTorrent Daemon
After=network.target media-4TB\x2dSecond.mount media-4TB.mount media-2TB.mount media-Files.mount

[Service]
User=transmission
Group=torrents
Type=notify
LimitNOFILESoft=49152
Environment=TRANSMISSION_WEB_HOME="/usr/share/transmission/web-control/"
ExecStart=/usr/bin/transmission-daemon -f --log-error
ExecReload=/bin/kill -s HUP $MAINPID

[Install]
WantedBy=multi-user.target

I checked the limits for transmission PID after reloading and restarting the service and it hasn't changed

Max open files            1024                 524288               files

Then I tried changing the systemd defaults by editing /etc/systemd/system.conf and still no change

DefaultLimitNOFILE=49152:524288

And still the soft limit stays at 1024

Anyone have a clue?

Last edited by m00nman (2021-03-15 04:51:46)

Offline

#2 2021-03-14 01:02:06

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 636

Re: Can't get systemd service to respect LimitNOFILESoft limit [solved]

/etc/systemd/system.conf

#DefaultLimitNOFILE=1024:524288

edit0: also
https://superuser.com/questions/1200539 … 200818#_=_

Last edited by Zod (2021-03-14 01:37:35)

Offline

#3 2021-03-14 06:46:15

m00nman
Member
Registered: 2013-01-21
Posts: 12

Re: Can't get systemd service to respect LimitNOFILESoft limit [solved]

Thanks @Zod, but as I mentioned in the OP I had already tried uncommenting and changing

#DefaultLimitNOFILE=1024:524288

to

DefaultLimitNOFILE=49152:524288

In the link you provided they also mention changing limits in /etc/systemd/user.conf. "transmission" user is a system user and my understanding is that user.conf only affects normal users. Nevertheless I tried changing limits there as well and it had no effect, unfortunately. I also tried adjusting /etc/security/limits.conf and added

* soft nofile 49152

which had no effect, which I guess is expected since it's not supposed to affect systemd services.

I can easily adjust the hard limit and can see the change for the hard limit reflected, however it's the soft limit that's always 1024 no matter what I change. So I'm still stuck. sad

Last edited by m00nman (2021-03-14 06:47:53)

Offline

#4 2021-03-15 04:51:00

m00nman
Member
Registered: 2013-01-21
Posts: 12

Re: Can't get systemd service to respect LimitNOFILESoft limit [solved]

It appears to be a Transmission limitation: https://github.com/transmission/transmission/pull/893
Proposed patch was merged, but then reverted for some reason.

I suppose the solution is to reduce global peer limit to below 1024, I set mine to 800.

Last edited by m00nman (2021-03-15 04:54:01)

Offline

Board footer

Powered by FluxBB