New N100 server setup

A couple days ago, I migrated my DVR server from a Synology DS916+ over to a N100 mini PC; the primary goal was to improve transcoding performance for when I'm remote. The Synology can do it, but it a) takes a while to start, and to start back up after you skip forward, such as through commercials, and b) really seemed to struggle at higher bit rates/resolutions (like even 6Mbps 1080p) and would often stop to catch up.

I went with a FireBat AM02, chosen over Beelink and others primarily because it has USB-C and DisplayPort, which made it more convenient for me to set up.

I wiped the machine and installed Ubuntu server 22.04, then Channels into Docker, and everything is working great. As a random data point, commercial detection time with a MPEG-2 source, using 2 threads, seems to be roughly 2 min per hour of recording (give or take a bit depending on the specific source). As I recall, it was around 10 minutes per hour (with 1 thread) on the Synology.

A few notes that may possibly be helpful for others going down this route -

  1. After installing and updating Ubuntu server 22.04, it seems /dev/dri was not available. A newer kernel is required for the chipset hardware in this machine (and other N100's I believe); when installing the current server build, the kernel is something like 5.15-ish (I don't recall exactly, but definitely 5.x), and we want 6.5.x or later. Anyway, an easy way to update the kernel to get the necessary hardware support (this installed 6.8.0-45 for me):
    sudo apt-get install linux-generic-hwe-22.04
  1. I wanted to keep the DVR media files on the NAS, so I made a CIFS mount to them. You can do this by adding something like the following to the /etc/fstab file:
     //192.168.100.100/media /nas1/media cifs username=thedvruser,password=supersecretpassword 0 0

There are better ways to do this without saving a NAS username/password into this file that anyone can see, but in my particular case, I don't care, as this user only has access to the DVR files.

Also NFS might have been a better choice, but I already had SMB enabled on the NAS so this was easy.

  1. And finally, in the docker compose file, I made two changes (aside from the volume paths) to the recommended version in the installation instructions. First, the instructions recommend
    restart: on-failure:10

The problem with this is, while it will restart if the DVR crashes, it will not restart the container if the docker daemon restarts (such as with a system reboot). So instead I'm using

    restart: unless-stopped

And the other change I made was to add a TZ environment variable (an alternative would be to mount the /etc files for timezone and time, but I chose not to do this):

    environment:
      - TZ=America/Denver

For the networking mode, I left it as "host" for the moment, which does indeed allow bonjour to find the server as expected (need to wait a little while for this to happen if you're migrating from a different server on a different IP).

And finally, a big shout-out to the Channels team - the process for migrating the server was really easy and well thought out. I especially like that you save the database backups alongside the DVR recordings - it seemed like a non-obvious choice when I first noticed it a long time ago, but after doing a migration it's exactly where you would want them to be!

5 Likes

I'm setup much like you with a Beelink N100 mini PC yet mine is running Windows. My NAS is TrueNAS Scale also with a SMB connection. My commercial detection is at about 10 minutes per hour of video and I use 3 cores. 2 cores is fast and the third makes it a little faster. If you don't have SMB Multi Channel set up, I suggest you do so as there will be multiple threads running on the CPU so it fills the network better.

Wow, I had no idea SMB multichannel was even a thing! Doing some research, looks pretty cool. For Windows, looks like a super easy implementation. For Ubuntu, a bit more difficult - from what I've been able to gather, it requires a) a separate subnet for the second link on both client and server sides, and b) using DNS rather than an IP for the CIFS mount. The first is not a big deal, the second would require a bit different configuration than I'm doing now. But to top it all off, I don't have enough spare network ports :joy: - so I'll have to revisit this later. Thanks again for pointing this out, though - TIL!

Most people don't know that SMB Multichannel does not require a second port. There are advantages with a single port. Without Multichannel, one CPU core will be used for all SMB traffic and this can limit throughput. If you enable Multichannel, then multiple cores will be used and multiple streams even between two hosts so the TCP rotate window is utilized better resulting in less latency and better throughput. What surprised me when I enabled SMB Multichannel was when I watch a video, the commercial skips are noticeably faster and the link between my clients and the server is the same.

1 Like

Huh. I see what you're referring to - although this is much better documented for Windows than it is for linux. I tried enabling on the NAS, and if it made any difference it was unmeasurable. And it's unclear if the NIC driver in my N100 supports RSS - I'm guessing it does, but all the ways I found to check led nowhere.

In any case, though, thanks again for mentioning this, and I'll keep it in the back of my mind, and possibly try it with multiple network interfaces. And in the meantime, my N100->NAS link nearly saturates at around 950Mbps during large file copies, so I'm guessing the benefits with a single NIC would likely be fairly minimal.

SMB Multichannel? Never heard of it. I have heard of Jumbo Frames, and if set right, and switches support it, can increase performance and throughput between PC's.

It seems that SMB multichannel is already enabled for me on both my main desktops, in Win 11 Pro. I never manualy enabled it, so no idea.

U can check if it enabled by checking in Admin PowerShell
Get-SmbServerConfiguration | Select EnableMultiChannel

You are correct that SMB Multichannel is enabled by default in Windows 11. For a 1-Gb link, jumbo frames were once necessary before NICs had TCP offload and CPUs were much slower. They still can help for 10-Gb though be aware that they can also cause some issues for hosts with older TCP stacks.

Samba is more universal. Performance of either is fast enough for any video. Your storage (NAS) might make a difference.