Jul 312019
 

If you’re like me and use a Synology NAS as an NFS or iSCSI datastore for your VMware environment, you want to optimize it as much as possible to reduce any hardware resource utilization.

Specifically we want to disable any services that we aren’t using which may use CPU or memory resources. On my DS1813+ I was having issues with a bug that was causing memory overflows (the post is here), and while dealing with that, I decided to take it a step further and optimize my unit.

Optimize the NAS

In my case, I don’t use any file services, and only use my Synology NAS (Synology DS1813+) as an NFS and iSCSI datastore. Specifically I use multipath for NFSv4.1 and iSCSI.

If you don’t use SMB (Samba / Windows File Shares), you can make some optimizations which will free up substantial system resources.

Disable and/or uninstall unneeded packages

First step, open up the “Package Center” in the web GUI and either disable, or uninstall all the packages that you don’t need, require, or use.

To disable a package, select the package in Package Center, then click on the arrow beside “Open”. A drop down will open up, and “Disable” or “Stop” will appear if you can turn off the service. This may or may not be persistent on a fresh boot.

To uninstall a package, select the packet in Package Center, then click on the arrow beside “Open”. A drop down will open up, and “Uninstall” will appear. Selecting this will uninstall the package.

Disable the indexing service

As mentioned here, the indexing service can consume quite a bit of RAM/memory and CPU on your Synology unit.

To stop this service, SSH in to the unit as admin, then us the command “sudo su” to get a root shell, and finally run this command.

synoservice --disable pkgctl-SynoFinder

The above command will probably not persist on boot, and needs to be ran each fresh boot. You can however uninstall the package with the command below to completely remove it.

synopkg uninstall SynoFinder

Doing this will free up substantial resources.

Disable SMB (Samba), and NMBD

I noticed that both smbd and nmbd (Samba/Windows File Share Services) were consuming quite a bit of CPU and memory as well. I don’t use these, so I can disable them.

To disable them, I ran the following command in an SSH session (remember to “sudo su” from admin to root).

synoservice --disable nmbd
synoservice --disable samba

Keep in mind that while this should be persistent on boot, it wasn’t on my system. Please see the section below on how to make it persistent on booth.

Disable thumbnail generation (thumbd)

When viewing processes on the Synology NAS and sorting by memory, there are numerous “thumbd” processes (sometimes over 10). These processes deal with thumbnail generation for the filestation viewer.

Since I’m not using this, I can disable it. To do this, we either have to rename or delete the following file. I do recommend making a backup of the file.

/var/packages/FileStation/target/etc/conf/thumbd.conf

I’m going to rename it so that the service daemon can’t find it when it initializes, which causes the process not to start on boot.

cd /var/packages/FileStation/target/etc/conf/
mv thumbd.conf thumbd.conf.bak

Doing the above will stop it from running on boot.

Make the optimizations persistent on boot

In this section, I will show you how to make all the settings above persistent on boot. Even though I have removed the SynoFinder package, I still will create a startup script on the Synology NAS to “disable” it just to be safe.

First, SSH in to the unit, and run “sudo su” to get a root shell.

Run the following commands to change directory to the startup script, and open a text editor to create a startup script.

cd /usr/local/etc/rc.d/
vi speedup.sh

While in the vi file editor, press “i” to enter insert mode. Copy and paste the code below:

case "$1" in
    start)
                echo "Turning off memory garbage"
                        synoservice --disable nmbd
                        synoservice --disable samba
                        synoservice --disable pkgctl-SynoFinder
                        ;;
    stop)
                        echo "Pertend we care and are turning something on"
                        ;;
        *)
        echo "Usage: $1 {start|stop}"
                exit 1
esac
exit 0

Now press escape, then type “:wq” and hit enter to save and close the vi text editor. Run the following command to make the script executable.

chmod 755 speedup.sh

That’s it!

Conclusion

After making the above changes, you should see a substantial performance increase and reduction in system resources!

In the future I plan on digging deeper in to optimization as I still see other services I may be able to trim down, after confirming they aren’t essential to the function of the NAS.

Feel like you can add anything? Leave a comment!

  14 Responses to “Synology System Resource Optimization for NFS/iSCSI”

  1. […] I also further optimized the NAS and memory usage by disabling other unneeded services in a post here, targeted for other users like myself, who only use it for […]

  2. […] Synology System Resource Optimization for NFS/iSCSI […]

  3. disable thumbs service with synoservice –disable synomkthumbd

  4. Hi Stephen,

    Was wondering if when your synology locked up there were any logs prior to the crash. We have 4 x RS3617xs+ all suffering from intermitent lock ups and only soulution is power cycle. Synology want to RMA devices after doing memory checks which all pass. Looking at logs on Linux they is nothing in any log file prior to the crash and new logs entries only appear on reboot.

    We like you are only using as an ISCSI host.

    Kind Regards

    Steve

  5. Hi Steve,

    Since then I’ve moved to NFS and the issue is occurring with NFS as well.

    Post reboot, there are no logs on both the Synology interface side as well as the Linux side (Linux log files).

    In an effort to find out what’s going on, one day I actively monitored the box (SSH’ed in, and tailed the kernel Linux messages). I found that what happens is all memory is used up and then the kernel goes in to a panic trying to clear RAM.

    I believe this is completely software related and related to an update around the time I did this post.

    Let me know what Synology says.

    Cheers
    Stephen

  6. Hi Stephen,

    We actually purchased brand new device just before christmas to allow us to migrate data to it and RMA one of the original devices with the issue. Was racked and given an IP address and raid10 volume created but then left during change freeze. With no connections/utilisation we found the device unresponsive this week when we went back to use it with same symptoms. This has ruled out many of our possible theories for the cause as was base factory config with no load on whatsoever.

    Waiting on response from Synology currently. Will let you know the outcome. I am not holding my breath for a solution. Very dissapointed especially as devices perform very well apart from this issue.

    Cheers

    Steve

  7. Hey Steve,

    Out of curiosity, are you using more than one network interface on the unit? The only thing I noticed on my side that around the time the issue started was: 1) new firmware upgrade 2) started using 4 NICs instead of 1.

    In all honesty, it was because of issues like this I switched from the Synology unit as my main storage device. I still use the Synology as a backup device, but I don’t put any critical data on it anymore.

    Stephen

  8. Hi Stephen,

    All other devices had multiple NICs in use. New device only had management nic connected. We were wondering if the additional 10gb cards we installed in other units may have been cause but the hang on this new devices rules that out.

    Steve

  9. Hi,
    I just found this thread because I am having the same “freezing” issues on my DS218J.
    It has been working fine for 3 months and just after the update to 6.2.2-24922-3 this started to happen, every 1-2 days the system froze. I do not know which version was before the update (I imagine it would be 6.1)
    Considering this is a remote station, it makes it completely useless.
    I have done the memory test but I think you are right, this is an software issue.
    I am opening a support ticket today and most probably return the device as it is still on warranty.
    Thanks for the posts.

  10. I just wanted to chime in that I’m experiencing the same problem with a RS3614xs+ that’s only being used for iSCSI, all other services are disabled – SMB, etc. Everything is on the compatibility list and I’m running the latest DSM – 6.2.2-24922 update 6. I’m experiencing intermittent lockups where the only solution is to power cycle. Synology support just asked me to run RAM tests which I am planning to do soon but I really don’t suspect RAM to be the issue.

  11. Hi Stephen,

    I saw that post, did you end up resolving the issue? I read it as the latest update was “I’m officially going to start planning on retiring this device as this is unacceptable, especially in addition to all the issues over the years.”, are you still planning on that or did you find disabling and uninstalling SynoFinder to be the root cause?

  12. Hi Mike,

    It turned out that disabling the SynoFinder resolved another issue that was occurring. As per the latest update the issue is still happening. I’m also having more and more people reach out to me mentioning the same thing is happening to them.

    I’d recommend reading this post as it has the latest information in my efforts: https://www.stephenwagner.com/2019/07/31/synology-memory-issues-and-crashing/

    I’m now trying to actually install my own OS on the Synology unit, you can read about it here: https://www.stephenwagner.com/2020/05/07/hacking-synology-diskstation/

    Cheers,
    Stephen

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)