Right after upgrading to SCALE I hit a max open files limit in Unreal Editor, causing crashes, and sometimes assets weren’t loading.
I had to enter the TrueNAS cli and set the following:
[TrueNAS SCALE]> service smb update smb_options="max open files = 1048576"
FYI the TrueNAS cli is a command line client to the sqlite database, open it by running cli in the shell.
The other thing I changed was that I created an override to the SMBD Systemd service file systemctl edit smbd.service
The limit of the number of open files is usually set by the UNIX per-process file descriptor limit rather than this parameter so you should never need to touch this parameter.
On another machine I tried setting only the override in the service file, and this appears to be enough. But on this one I don’t use smb shares, it’s my backup, so smbd runs without users.
Where I actually use SMB shares, no matter what I did the limit remained 16k until I also changed the hidden smb_options parameter.
This hit again after upgrading to fangtooth. I was expecting it and recreated the service override file and now everything is OK.
The LimitNOFILESoft is not a thing by the way, only LimitNOFILE is needed.
I am not sure if you folks have noticed trying to actually utilize anywhere near to the upper bound on open file descriptors you’ve set (1048576) in the in the smbd.service or via the cli’s smb service update smb_options will not work…
once your SMB daemon starts to exceed the 59392 open file descriptors it’s limited not by the operating system configuration, but by a hard coded value in truenas samba repo which came from upstream based on the fact that samba mainly uses uint16_t pointers because of some old school Windows limitation from what I understand…
When you begin to exceed 59392 file handles you’ll notice smbd log the following message:
root@truenas:/var/log/samba4# grep “file_init_global” log.smbd
[2025/02/26 00:15:05.186764, 1] …/…/source3/smbd/files.c:1919(file_init_global)
file_init_global: Information only: requested 196608 open files, 59392 are available.
[2025/02/26 17:39:51.297349, 1] …/…/source3/smbd/files.c:1919(file_init_global)
file_init_global: Information only: requested 5898240 open files, 16344 are available.
[2025/02/26 18:07:41.898912, 1] …/…/source3/smbd/files.c:1919(file_init_global)
file_init_global: Information only: requested 5898240 open files, 59392 are available.
[2025/02/26 18:07:53.499161, 1] …/…/source3/smbd/files.c:1919(file_init_global)
file_init_global: Information only: requested 5898240 open files, 59392 are available.
[2025/02/26 18:24:09.726056, 1] …/…/source3/smbd/files.c:1919(file_init_global)
file_init_global: Information only: requested 5898240 open files, 59392 are available.
root@truenas:/var/log/samba4#
Well that’s awkward! I hope Unreal won’t start opening that many files. Wouldn’t this lead to issues with other file servers though? So after all, this might be an considered an Unreal Editor bug.