MaZder

btsync inhibits disk hibernation / Interaction with .SyncID-File

Recommended Posts

Hi Guys!

Heads up for such a wonderful sync-technique, it almost feels like finally the 21st century is knocking on the doors.

I did set up btsync 1.0.134 ARM version on a Synology DS413j and it works like a charm. There's one issue though:

The btsync app reads/writes the .SyncID file every ~5 Seconds which inhibits the harddisks from going to hibernation. This is reported from the hibernation debug log:


May 25 20:41:47 kernel: [2959743.330000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:41:52 kernel: [2959748.330000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:41:59 kernel: [2959755.320000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:42:02 kernel: [2959758.330000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:42:04 kernel: [2959760.310000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:42:08 kernel: [2959764.320000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:42:20 kernel: [2959776.320000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:42:23 kernel: [2959779.330000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:42:50 kernel: [2959806.330000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]
May 25 20:43:02 kernel: [2959818.330000] [/volume1/data/BTSync/.SyncID] opened by pid 9971 [u:(/usr/local/btsync/bin/btsync), comm:(btsync)]

Is there any reason why the app needs to interact with this file so often? Wouldn't it be possible to use the kernel's inotify interface to monitor the file (for read access) or postpone write access until a client connects (and a wakeup is unavoidable)?

Not beeing able to go to hibernation greatly increases energy consumption, noise and heat generated by the NAS device.

If there's anythin I can help with,

just let me know.

Regards, Peter

Share this post


Link to post
Share on other sites

Hi all,

I guess this not a hot topic, because everybody is happy that "it just syncs" -- and that's all right.

I'd be happy with that if this was an issue tracker and I'd knew my change-request would not get lost.

But I don't get the feeling, that in forseable future anyone would remember this posting. So besides any clarification on the .SyncID-File I'd be interested in a Issue Tracker to post this change-request.

Regards, Peter

Share this post


Link to post
Share on other sites
Guest

Hi, I'm very interested in this topic, too! The prevention of the hibernation and deep sleep states of our Synology DS-213+ is a deal breaker. We are not going to use BTSync until this problem will be fixed.

Share this post


Link to post
Share on other sites

Maybe this is a solution for you (untested):

In DSM 4.x you have a Jobplanner where you can create a plan for a user script.

The Code for the Script:


#!/bin/sh
ping -c 1 YOUR-PC-NAME >/dev/null
if [ $? == 1 ]; then
echo "offline"
sh /var/packages/btsync/scripts/start-stop-status stop
else
echo "online"
sh /var/packages/btsync/scripts/start-stop-status start
fi

Replace the Computername.

Start daily at 0:00; repeat every hour; end at 23:00.

Run script as user root.

Please tell us if with this solution your HDDs can sleep.

Share this post


Link to post
Share on other sites

Hi christian,

thank you for the code and your PM.

Well, when the btsync service is stopped the disks obviously can go to sleep - but that's not a solution.

I actually testet it: stopping the service makes the disks sleep again.

BTSync can only work when at least two parties are online, so it is a *must* for btsync to run 24/7 in order to be able to recognize changes in the data of other parties.

Peter

Share this post


Link to post
Share on other sites

BTSync doesn't follow symlinks.

For files to sync it doesn't, but how about "internal" files? (I only have Windows boxes, I can't test it)

Accessing the symlink would also keep the disk awake, would it not?

I was hoping that would be cached, but you could be right. It was just a wild idea.

Share this post


Link to post
Share on other sites

There's nothing that I can think of that would disable this feature -- it's simply the way that BTSync is able to check the service to see if there are new files to download; hence, 'It's simply the way the program operates' would be the answer for right now.

As the lifecycle is still in alpha I'm sure something could be worked out for ARM based NAS in the future -- however, I don't suspect anything would be worked on for a long time (~11-12 months).

Share this post


Link to post
Share on other sites

Hi. I installed BTSync a few weeks ago but just noticed this issue. Why is the SyncID file constantly accessed? Like every second!? It's a tiny little file, why can't it be held in RAM? I first installed this on computers with SSDs so I didn't notice the issue, but now that it's syncing to a computer with a hard drive the hard drive is constantly being accessed. It keeps making access noises and can not go to sleep! This is a deal-breaker. I thought I had finally found a replacement for the good old Windows Live Sync but this one issue is really killing the program. I see no reason why one file needs to be accessed over and over and over.

Share this post


Link to post
Share on other sites
Guest

Ok, I've installed the 1.1.12 build on our Synology DS-213+.

Result: The DS does not enter hibernation or deep sleep state, so this issue is not fixed.

Share this post


Link to post
Share on other sites
Guest

Thanks for your hint regarding rescan time. Now I've adjusted this value (1 week instead of 10 minutes) and our DS now goes to hibernation/deep sleep. :)

But it does not wake up automatically when another BTSync node goes online. Is there anything we can do to get this working, too? Or is the only solution to send wake-on-lan packets to our DS, as soon as other BTSync nodes go online?

Share this post


Link to post
Share on other sites
Guest

Well, the hibernated DS wakes up automatically from hibernation/deep sleep, when e.g. somebody mounts a nfs- or samba-share. So I thought it should be possible to get this working with BTsync, too. At least in our LAN.

Share this post


Link to post
Share on other sites

My qnap 210 also does not go to sleep, event with the new version and rescan interval set to 7200 seconds.

The reason is the sync.log that is continously written with connection attempts from other sync clients.

,,

[20130513 15:56:35.624] Incoming connection from 10.1.5.20:52799

[20130513 15:56:45.317] Incoming connection from 10.1.5.20:52799

[20130513 15:56:55.625] Incoming connection from 10.1.5.20:52799

[20130513 15:57:05.313] Incoming connection from 10.1.5.20:52799

[20130513 15:57:15.514] Incoming connection from 10.1.5.20:52799

[20130513 15:57:25.286] Incoming connection from 10.1.5.20:52799

..

an option to relcate sync log to another location or an option to disable connection logging (while keeping the other stuff)

should help in this case.

related, but different question:

why this connection attempt every 10 seconds, to find changed files or to search clients?

why not rely on notification from the source of the change, so no polling is necessary?

Share this post


Link to post
Share on other sites

btsync (1.1.48 and 1.1.70) still doesn't allow my synology box to hibernate the HDD

Switching on the debugging option in the synology box and checking the logs.

btsync seems to write sync.data and sync.dat new every 10 minutes (the minimum disk idle time before the synology hibernates the HDDs is 10 minutes) even if sync.dat hasn't changed.

Also it seems to write settings.dat every 30 minutes, again even if these haven't changed.

I assume that these timed writes are just a precaution and these files are also saved should change actually happen.

Could the times when btsync automatically saves these failed be configured?

Matthew

Share this post


Link to post
Share on other sites

I have (to 6 hours), but that does not seem to influence how often btsync automatically saves settings.dat or sync.dat (which is still 30 minutes and 10 minutes respectively).

Matthew

Share this post


Link to post
Share on other sites

btsync (1.1.48 and 1.1.70) still doesn't allow my synology box to hibernate the HDD

Switching on the debugging option in the synology box and checking the logs.

btsync seems to write sync.data and sync.dat new every 10 minutes (the minimum disk idle time before the synology hibernates the HDDs is 10 minutes) even if sync.dat hasn't changed.

Also it seems to write settings.dat every 30 minutes, again even if these haven't changed.

I assume that these timed writes are just a precaution and these files are also saved should change actually happen.

Could the times when btsync automatically saves these failed be configured?

Matthew

Try to increase folder_rescan_interval in advanced settings.

Share this post


Link to post
Share on other sites

I created this topic:

http://forum.bittorrent.com/topic/22318-bittorrent-sync-and-disk-spin-down/#entry62044

And I was seeing the same behaviour as you. What I didn't know is that the 30 minutes period was for reading the settings.dat file (and not rescaning the shared folders, as I thought). In my case I could move it to the sd card, but I still think that the application is not working as it should.

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.