Tips and Tweaks Plugin to possibly improve performance of Unraid and VMs


Recommended Posts

30 minutes ago, ItsRaining said:

I really hope someone will help me as this is my third post regarding this issue. I have been reading and wrapping my brain trying to to change the Max Watches 'fs.inotify.max_user_watches' variable. I started trying to use the terminal using the following command:

 

sudo sh
echo  fs.inotify.max_user_watches=4194304  >> /etc/sysctl.conf
sysctl -p


This ended up just adding fs.inotify.max_user_watches=4194304 to the sysctl.conf and did not replace the variable. After reading a bunch of forum posts regarding the issue I was directed towards using the "tips and tweaks" plugin. Setting this variable to 4194304 did not actually change anything. I also tried 999999, 1048576, and 2097152. Realizing I needed to probably restart the server for the changes to take effect I restarted. I am still showing the default value in the terminal and tips and tweaks.

 

image.thumb.png.a77afe0aa848793d8fad3bd3387c0b35.png

 

Here is my original post on the Plex Linux Docker:

https://github.com/linuxserver/docker-plex/issues/291

 

Unraid Forums Post:

 

Any assistance would be appreciated!

diagnostics-20211130-0645.zip 150.6 kB · 0 downloads

I don't know if you adding the line to sysctl.conf has changed something (of it it would even survive a reboot), but I, too, needed to change the setting and used the Tips n Tweaks plugin to do so. Mine is currently set (in the plugin gui) to 2097152, and it shows on the right side of that page under 'Current inotify settings' as the same number.

Sorry I can't be more helpful.

Link to comment

When I change the setting and hit apply. The setting does change on the right. However, it changes back on reboot. I am not sure if that is by design.

 

Finally, when set through this GUI how can you confirm it is applied? When I apply the setting, it shows in the GUI on the right side but did not show in the terminal when running sysctl.conf -p.

Edited by ItsRaining
Link to comment
1 minute ago, ItsRaining said:

When I change the setting and hit apply. The setting does change on the right. However, it changes back on reboot. I am not sure if that is by design.

 

Finally, when set through this GUI how can you confirm it is applied? When I apply the setting, it shows in the GUI on the right side but did not show in the terminal when running sysctl.conf -p.

This is beyond my ken, but I would guess it's being overwritten by something else, or else maybe conflicting settings lead the system to choose a default setting for it (this is totally a guess on my part, though). Mine just worked and stuck (at least from memory).

If you have added the line to the end of your sysctl.conf using the echo >> command, open sysctl.conf and remove the line (if there's more than one instance of the line, this may explain these problems, but leave the first instance and only remove the one at the end that was added by the echo >> command). Then reboot, set it in the plugin GUI, then reboot again and see if it sticks.

Link to comment
22 minutes ago, ItsRaining said:

I tried removing the lines via vi command in the terminal. I am fairly bad at editing files in the terminal. Is there a way to edit the sysctl.conf? This file is not there in Krusader while looking in /etc/. The config plugin also does not have this as an option.

Oh gods not vi... never vi. That's only for oldskool neckbeards and super lightweight Linux installs. I'm sorry that you ever had to deal with vi :P

Use nano - it'll make your life so much easier.

So ssh in (or web gui terminal) and run:

nano /etc/sysctl.conf

(no need for sudo, as you're already root on unraid. Note that with root comes great responsibility - so be cautious with your typing)

Nano will make soooo much more sense to you, and the shortcuts are all down the bottom to help you on your way.

If you see two entries in there for inotify, delete the second one, then ctrl-x then 'y' to save the changes.

 

EDIT: I just took a look at my sysctl.conf and up the top was:

# from https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
# increase the number of inotify watches
fs.inotify.max_user_watches=524288

Which is a totally different value to what mine is set to in tips and tweaks, so I think it'll be ok for you to leave those lines as-is, only removing any other inotify lines at the end.

Tips and tweaks must override it somewhere else.

If leaving it as default and setting a value in tips and tweaks doesn't work (or doesn't persist across reboots), though, feel free to change it to a larger value in sysctl.conf using nano.

Edited by jademonkee
Added info on my sysctl.conf
Link to comment

Just checking that you saw my edit above?

System files are moved from the system flash drive to ram at boot and won't persist after reboot, so I think leave the value in sysctl.conf as-is (I'm assuming after a reboot that it reverts to default, so looks like mine, above (with some other stuff below it). If so, reboot, then try setting it in T&T one more time, then once again rebooting to see if it sticks (this time you will be doing it just in the one place, so maybe that's just what it takes - I may be hopelessly optimistic in this case, though).

If not, I'm clean out of ideas.

The only way I know how to check is on the right side of the T&T page.

Link to comment

Here is what I tried doing. After restarting the server, tips and tweaks had it set to 4194304 but on the right it was the default. Opening the file in the terminal also showed the default (and showed a default conf file with no extra parameters - seems to have reset the conf upon restart). After inputting 4194304 again tips and tweaks showed the number on the right. This does not persist when I restart but honestly not a big deal if its working but I do not know a way to confirm this until plex tries to detect intros on an EAC3 audio file. Which was the original reason I went down this rabbit hole.

Edited by ItsRaining
Link to comment

Any changes to sysctl.conf will not persist on reboot.  What Tips and Tweaks does is to issue a sysctl command to apply the 'inotify.max_user_watches' value.  When you change the value in the UI, the value is changed as you've seen.  When the system is rebooted, the value saved in the config file is re-applied.

 

I've run several tests and it appears to be working fine, even on a reboot.  Confirm you see this line in your log:

Nov 30 11:12:37 BackupServer tips.and.tweaks: Tweaks Applied

That means that the Tips and Tweaks has been applied.  If you don't see that in the log, post your diagnostics and I'll see if there is an issue with Tips and Tweaks on reboot.

Link to comment
16 minutes ago, ItsRaining said:

Thank you for helping me confirm the tweaks applied. I see it in the logs. That is perfectly acceptable that it does not persist on reboot.

Tips and Tweaks applies the saved tweaks in the tips.and.tweaks.cfg on reboot so it does persist when using Tips and Tweaks.

Link to comment

Good to know. I will restart to confirm its persisting then. So far it has not persisted but I was messing with sysctl.conf.

 

Update: The issue I am having where plex is unable to scan the EAC3 audio files is still persisting and the inotify.max_user_watches stays at 512k. Leading me to believe the value is not setting for Unraid. Going to try and reach out to Unraid support because I have not been able to get this working since day 1 on my server.

Edited by ItsRaining
Link to comment
  • 3 weeks later...
On 11/30/2021 at 1:28 PM, ItsRaining said:

Good to know. I will restart to confirm its persisting then. So far it has not persisted but I was messing with sysctl.conf.

 

Update: The issue I am having where plex is unable to scan the EAC3 audio files is still persisting and the inotify.max_user_watches stays at 512k. Leading me to believe the value is not setting for Unraid. Going to try and reach out to Unraid support because I have not been able to get this working since day 1 on my server.

I am following up with you on this as requested by Unraid support.  512k is a bit of a strange number.  The default setting for 'fs.inotify.max_user_watches' is actually 524,288.  I suspect something is resetting the value after Tips and Tweaks sets it.

 

So let's do this:

- Post your diagnostics as they are right now.

- Reboot your server in safe mode.

- Check the value of 'fs.inotify.max_user_watches'.

Link to comment
17 hours ago, ItsRaining said:

I am sorry I meant to say 524288. The default value.

I have issued an update to the plugin.  The application of tips and tweaks values will occur now later in the start up process.  What I think might be happening is tips and tweaks applies the settings before Unraid is finished initializing.

 

Update to the latest release and see if the settings get applied correctly after a reboot.

  • Thanks 1
Link to comment

I would like to confirm that the value is persisting after restart. I have restarted my server three times during maintenance today. I have another 1 hour maintenance window tomorrow to replace a drive and will do another restart or two to confirm today wasn't a fluke.

Edited by ItsRaining
Link to comment
  • 2 weeks later...

Awesome plugin. I have tried setting my Scaling to Conservative and seen a power consumption drop, with no noticable hit to performance. Ive set it to On Demmand as a bit of a balance from the defaulted Performance mode.

 

Over on the right though, the CPU driver is listed as ACPI CPU Freq, that appears to be a generic driver? I'm running an AMD 5600G

 

CPU Frequency Scaling

Driver: ACPI CPU Freq

Governor: On Demand

Link to comment
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.