Restsdk-server, why is it continually running

Hi,
Yet another question. ‘restsdk-server’ is a process which is continually running with a CPU of 89% + and only 25% RAM.
My worry is that since 114 and now the latest of 5.05.111 the hdd’s do not seem to stop they continually rattle the drives and the temperatures are always in the upper38-39. If I don’t place an external fan on the PR4100 they go into the 40’s
The drives will be wearing out in a few months at this rate.
So back to the question, ‘what is restsdk-server’? and why is it so CPU greedy?

Regards
Princy557

2 Likes

My understanding is that restsdk-server is responsible for the indexing. Once the indexing process was over on my drives the CPU usage went down to 0%, while the RAM stayed high (600M with firmware 5.05.111, 1.6GB with 5.04.114). Another process that was stealing quite a lot of RAM and CPU was the ffmpeg for transcoding of shares with web access. Not sure if this helps :slight_smile:

Same here.

And I had tons of data to be indexed. But it did finish eventually:

image

It’s been fine ever since.

Did you try and ssh into the MyCloud and type “restsdk.sh stop”?

I don’t know the new method of turning off and disabling the scanning but the old way before the “OS versions” were:

/etc/init.d/wdmcserverd stop
/etc/init.d/wdphotodbmergerd stop
update-rc.d wdmcserverd disable
update-rc.d wdphotodbmergerd disable
/etc/init.d/restsdk-serverd stop
update-rc.d restsdk-serverd disable
mount -o remount,noatime,nodiratime /dev/root /

1 Like

restsdk.sh stop

Definitely does work for killing this service.

Not sure why, but it was insisting on waking the drives up every hour to do pretty much nothing. running that command has meant that my NAS has now finally been silent for about 7 hours.

I had set up something with the mobile app, but then cancelled and disabled cloud sharing, but apparently that doesn’t mean that everything gets shut off properly. Something remains misconfigured and running every hour. restsdk is determined to spin up the drives regularly to achieve nothing more than wearing out drive bearings. Then 15 minutes later it spins down until restsdk decides to wake it up again.

I had already mangled the Plex startup script to push its logs into a tmpfs system, as that software likes to write an error about how it cannot negotiate some “plex.direct” address, apparently it’ll also need this line adding too to kill some other annoying software.

3 Likes

After the new update i was plagued by my pr4100 continually trying to upload some analytics data. I ended up just deleting the wdlog.ini (/etc/nas/) and wdlog.conf (/usr/local/config/). My user.log (/var/log/user.log) is still working noting the spinup/down which is all im interested in. :slight_smile:

There’s also options inside of the wd ssh (pressing the Tab key twice and typing crontab -e). Only thing i haven’t been able to stop is an error saying:

root: cleanAlert.sh: entries expiration failed with exit code: 127

Tried deleting wd-alert.db because it apparently points to this file but that just gives me another error lol. :slight_smile:

View files with the “vi” command. Backup files in same directory by writing “cp wdlog.ini wdlog.bak”. Recover the same way but with the “mv” command. Delete with “rm”. Sometimes you need to write “cd /” first to find and view the more obscure files.

Im sure you already know but there’s also the “top” command to monitor the processes (type “q” to quit). Lastly just type “exit” to logout.

1 Like

So a bit more digging to get some more specific instructions for others who want a mostly silent system.

I don’t mind an occasional spin up of the disks, but just doing it for the sake of it is stupid in this kind of system. It should either be smart enough to only do housework when the disks are already spinning for a real reason or it shouldn’t do it at all. Waking it up every hour, then every 4 hours, and then at random times when you feel like it, is wrong.

It appears that the crontab line that spews out the hourly “errors” stating

getAgreement.sh: Get PIP 0 from cache
wdLogUploader.sh: getAgreement.sh: False
wdLogUploader: Current PIP_STATUS: false wdlog.conf STATUS: enabled

is the crontab line that runs /usr/sbin/rt_script.sh. Though not massively problematic as that log is written to tmpfs. Deleting that line stopped an hourly pointless message about uploading a log that isn’t set to be uploaded. The script itself is set to run every minute (brute force and ignorance crontab lines FTW) but internally only actually does something at a certain minutes past the hour and does other things at other times.

There is another crontab line that copies all the logs from the tmpfs filesystem that the system runs in to the hard disk as well and does it every four hours by the looks of it.

0 */4 * * * /usr/sbin/rlog -s /usr/local/modules/files/syslog_rotate.conf

which copies it to a “log_<serialnumber>” directory under /mnt/HD/HD_a2/.systemfile

It looks like the program deletes and recreates the “log_<serialnumber>” directory every time it runs every 4 hours. You might be able to tmpfs the /mnt/HD/HD_a2/.systemfile directory (doesn’t look like it should grow big or have important stuff in there) or simply delete the crontab line if you don’t care about log backup.

Now I just need an automated way to delete a line from the crontab and I can have it run when plex starts up.

1 Like

Another useful tool it can pay to learn is how to use the command atop. You’ll need a good sized ssh window and the output can be daunting at first, but with it you can see pretty much everything your system is doing and has done.

By default WD has, in what I consider to be an unusual and spectacularly helpful fashion, set atop up for permanent logging. The log is at /var/log/atop/atop_current and can be viewed by running atop -r /var/log/atop/atop_current It is reset at every day, mine “rotated” today at 7AM, but you can get a lot of information from it.

You may have to run

export TERM=xterm

before running

atop -r /var/log/atop/atop_current

You can browse backwards and forwards in time using “t” (lowercase) and backwards with “T” (uppercase), sort by disk usage using capital “D”, show only disk usage with lower case “d” and so on.

It doesn’t list tmpfs reads and writes but does all the hardware disks including the onboard flash memory.

As an example I saw a write happening to mmcblk0 every minute. Apparently the fireAlert -S command is sometimes trying to kill the onboard flash by writing and rewriting the file /usr/local/tmp_wdnas_config/config/alert_send.xml to the tune of 4kB per minute. Not a big deal, but in the world of flash memory every write counts and useless writes do more harm than good.

Bizarrely that file contains nothing more than

<config/>

in it on my system and is 10 bytes. Somehow writing that enough to make atop show 4kB is either a sign that it is badly written, or 4kB is the emmc minimum write block size, probably the latter.

A simple pkill fireAlert deals with that one. If it was important then it should be written to a better location. Soldered on flash memory is not an expendable resource and killing it is worse than killing a disk in my book. I doubt the flash memory is a “user serviceable” part.

Check out atop(1) - Linux man page (die.net) and the section “Interactive Commands”

2 Likes

So, my NAS decided to reboot at a weird time today. Turns out we have a new firmware update to 5.07.118.

I like how the first line is

  • Resolved standby issue where in certain scenarios the device wakes up every hour

Now they just need to fix fireAlert constantly writing to the emmc.

HI All
Thanks for all the suggestions, but sadly I’m too old to work out most of the commands suggested.

first being “restsdk.sh stop”?, where on earth do I type it, I have no low level entry to the drive, or maybe I do, but I don’t know where it is. ssh no idea how to use it and would be in danger of messing something else up.
atop, no idea what I’d have to do to enter that data either.
I also have another Question out about the fact that since going up to OS5 my drive has not stopped spinning
Regards
Princy557
PR4100

I used atop as mentioned. WD have set it up to log continually. I think the log resets either daily or on a particular size but it is a couple of megabytes in the log directory. As mentioned you can browse it using

export TERM=xterm
atop -r /var/log/atop/atop_current

Press “D” (shift-D) to sort by disk usage and then you can use “t” and “T” (upper and lower case t) to scroll forwards and backwards in time minute-by-minute, up to however long it has been since the log was reset.

The -r tells it to playback the log, it is not “current” activity which you get by just running atop and is on a 10 second interval. The log is literally activity per minute and is actually more useful.

I literally saw a 4KB write per minute from that process in atop.

I used a variant of

find / -mmin -15 -printf "%TY-%Tm-%Td %TH:%TM:%TS %p\n" 

I did have a version of that command that managed to exclude /sys and /proc but otherwise that will give you an idea of what files have been being changed.

Specifically atop told me, in not so clear a fashion, that it was fireAlert writing to mmcblk0. No other programs were writing to any disk, and the actual hard disks were mercifully free from activity as well. From there I run df where it shows a line for

/dev/mmcblk0p6           18803       581     16789   3% /usr/local/tmp_wdnas_config

and then using

find /usr/local/tmp_wdnas_config/ -mmin -15 -printf "%TY-%Tm-%Td %TH:%TM:%TS %p\n" 

tells me the last modified files. The file I listed above shows up and I then pkill fireAlert and notice that the file is no longer being written.

Sure it’s a process, but as you say, better tools are somewhat limited in the stripped down platform we have.

Wow, that is kinda creepy.

Is there definitely no other link between the two devices? I know I did an rsync backup between my old and new devices and could have ended up copying that directory myself but otherwise wouldn’t know how it got shared.

Do you think it was copied across the LAN or could it have been uploaded by one to WD and downloaded by the other?

Hey everybody,
I have a new WD My Cloud EX2 Ultra, I copied a lot of data onto it (over 4 terabytes). It did finish generating previews and indexing within 3-4 days. That’s a lot of time actually, considering the noise, but let’s just say, that’s okay.
But when it is connected to the cloud, the restsdk-server is continuously running and keeping the box alive, on a high noisy level. When it was either indexing or generating previews, it did tell me that in the status of the cloud access. But now, it says: connected. For me it means, finished.
How come, dear WD, that I need to be an SSH programmer genius or a hacker, to find out, what the hell is going on in the box? Why do I have to research the internet, what the fun is restsdk-server or top? Why do I have to spend my time with all this ■■■■?
I simply want to see, when something is running and when I see nothing, it should stop!
Or, if you think I am wrong, please only sell the product with a huge warning: only for IT experts with strong SSH skills!
I am a bit pissed off, sorry. I spent a lot of money on this and all I can hear all day long is the ventilator on 10344 rpm.

3 Likes

Hi Robert, any change? I also have exactly what you describe. The noise is highly irritating. It is also done indexing but since I need the cloud connection, the process keeps the CPU busy and the fans turning!
Any update from @WD?

Hi Martin,
Yes and no. I finally gave up and bought an empty NAS house from another well known company, I moved the 2 hard disks from WD to the new home and problem solved. Much lower noise, much better software.

The only update has ever been “This activity is normal and expected”

Thank you all for the information. I’ve recently bought a Cloud Ex2, and I am now sure that I will never buy a WD NAS product anymore. Given the price and the noise, it is unacceptable.

“This activity is normal and expected” is not a response, just a hint to pass on and buy something from another company.

Hello WD-Team !
Warum läuft dieser Dienst seit letztem Update am 11.02.2022 (5.20.113) und nachfolgend erforderlichen Neueinrichtungen von Cloud-Zugriffen die GANZE ZEIT ?
Nicht nur dass dadurch die Temperatur stets erhöht ist, tritt auch ein ständiger Lärmpegel vom Lüfter auf !
Das kann doch nicht normal sein.
Und warum geht die Angelegenheit bei einer “Systemprüfung” in den Normalzustand (Standby) über, um anschließend nach ein paar Minuten wieder hochzufahren ?
Ersuche um dringende Abhilfe !!! MbG ~ IWECE

1 Like

Hello,

I too started to find the sound annoying.
I suddenly remembered that I had the “Plex server” installed on my Nas.
This resulted in a CPU usage greater than 90%.
I disabled the “Plex server” … and installed the plex server on a stand-alone computer … and the problem was solved!
Now my CPU usage is between 5 and 10% :slight_smile:

Grtz
Cla