You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local file discovery should be done at most once per run, use file watcher events to seed Discovery #2297
Currently the client runs a full local discovery every five minutes due to limitations in our file watching code (see #2268 for previous discussion). These limitations should be removed to allow the client to be reliable with only a single run of the local file discovery or without it entirely.
On Mac: We don't get notifications for changes our own process caused, so a single run should be enough. We may be able to hook into the filesystem change journal to even skip that.
On Linux: We get full path information about changes and that could be used to filter out the changes on files we cause ourselves.
On Windows: Similar to Linux (have to use ReadDirectoryChanges instead of FindFirstChangeNotification) and could even possibly skip the single discovery by using "Change Journals".
These kind of stuff becomes important as we see people having 50K+ files in their sync folder. If you manage to sort this out to work at scale of a few 100K files in a sync directory then you will have extreme competitive advantage. But that's some way to go, still....
Please also consider that in some cases an (advanced) user may require to keep the ability of periodic full scans of the local sync folder (on per folder-pair basis). This is if someone have their local folders on mounted filesystems which do not always reliably provide the notifications (e.g. in some cases the AFS). In that case a setting in the folders config file could be sufficient.
The issue one of our user had in Linux was that the sync would not finish before the next sync would start. This was with around 1 million files and broke sync for these use cases completely.
Hopefully full sync every hour will not impact too much in those cases?
@dragotin Not exactly sure, but I noticed that with 2.4.3 when the initial sync finished, the ichon was green only for one or two seconds, then it became blue again and was busy for another 15 seconds. My guess is, it then already did, what the other two would do only on the first resync. Tried twice with same behaviour.
@moscicki yes, we warn the user when we run out of inotify listeners. See #6119 for details.
I am curious what exact limit is needed for 1M files, and how much kmem that adds.
My 10k files test did not hit the limit 8000.
200k files - a demonstrator that shows good speedup in 2.5.0
Summary: 200.000 files scattered in 2.000 folders on the server are in sync with a 2.4.1 and a 2.5.0 desktop client. When editing, adding or deleting a single file, the 2.4.1 client needs less than 10 seconds.
for ii in $(seq 1 100); do for i in $(seq 1 100); do echo "$i/$ii"; mkdir -p "t$i/$ii"; for j in $(seq 1 100); do cp /etc/samba/smb.conf t$i/$ii/f$j; done; done; done
have enough inotify watches for 1M files.
echo 200000 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
client 2.5.0daily20181014
vmstat-m.20180815-13:03:56.txt
selective sync with t1 t2 t3 t4 t5 t6 t7 t8 t9 10 (100k file).
initial 'sync' with sqlite removed: 2:05.1 sec
enabling folders t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 (new total 200k files)
(false warning printed, that unchecked folders will be removed. they are not removed.)
second 'sync' with more folders added:
Thousands of false messages scroll through the activity log: 'Datei ist seit der Entdeckung geändert worden'
Files are being downloaded from the server although identical files exist locally.
The client process grows to 1.8GB memory footprint.
Duration: 38:34.0 sec (all 4 CPUs of a quadcore busy with client and server activity)
5 sec idle, then another sync: 10:28.3 sec (one CPU busy, no server activity seen)
The client process drops to 1.1GB memory footprint.
vmstat-m.20180815-14:28:33.txt
client stop; start: 45.5 sec
small local file change: 6.6 sec, 5.1 sec (including 3 sec before the sync starts)
small remote file change: 3.4 sec, 4.4 sec
client quit: vmstat-m.20180815-14:29:55.txt
client 2.4.1
selective sync with t1 t2 t3 t4 t5 t6 t7 t8 t9 10 (100k file).
initial 'sync' with sqlite removed: 3:20.2 sec
enabling folders t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 (new total 200k files)
second 'sync' with more folders added:
The client process grows to 2.4GB memory footprint.
80 messages correclty name the remaining unsynced folder. (Nothing scrolls wildly.)
Duration: 10:15.6 sec
The client process remains at to 2.4GB memory footprint.
1M files - a demonstrator that shows moderate speedup in 2.5.0
Summary: 1.000.000 files scattered in 10.000 folders on the server are in sync with a 2.4.1 and a 2.5.0 desktop client. When editing, adding or deleting a single file, the 2.4.1 client needs between 1 and 2 minutes, but 2.5.0 only needs 20 to 30sec to sync to the server.
client 2.5.0daily20181014
client stop; rm db; client start: ca 15 min (1M files are now included)
small local file change: 30.1 sec, 22.0 sec, 20.3 sec
small remote file change: 1:05.5 sec, 27.4 sec, 51.9 sec
client 2.4.1
client stop; rm db; client start: ca 15 min (1M files are now included)
small local file change: 2:48.8 sec, 1:04.7 sec, 1:02.6 sec
small remote file change: 1:02.1 sec, 1:45.3 sec, 1:03.2 sec
@moscicki Good news about inotify watch limits:
With a test tree of exactly 1010010 files in 10103 folders, the official number of watches appears to be 10390.
This number was found by bisecting /proc/sys/fs/inotify/max_user_watches settings.
Compared with earlier tests, this confirms the impression that we have one watch per folder plus ca. 200 -- the number of files seems irrelevant.
Linux slabinfo (via vmstat -s and slabtop, using echo 3 > /proc/sys/vm/drop_caches) did not seem to be accurate enough to actually measure additional kernel memory consumption for the watches. In some cases kernel memory footprint even appeared to be smaller while the client was watching the tree.
AGAIN the current value is 65536, this confirms my assumption, that the usual load-order specification has two digits for a reason: According the docs
All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. It is recommended to prefix all filenames with a two-digit number and a dash, to simplify the ordering of the files.
Activity
moscicki commentedon Oct 10, 2014
These kind of stuff becomes important as we see people having 50K+ files in their sync folder. If you manage to sort this out to work at scale of a few 100K files in a sync directory then you will have extreme competitive advantage. But that's some way to go, still....
guruz commentedon Oct 22, 2014
Linking #880 since it's related.
I still have some ideas for Windows directory traversal..
ckamm commentedon Nov 6, 2014
@moscicki points out in #2451:
70 remaining items
Trefex commentedon Aug 14, 2018
jnweiger commentedon Aug 14, 2018
@Trefex I'll need to avoid the initial sync for that, otherwise we get results next month. Will try.
Trefex commentedon Aug 14, 2018
dragotin commentedon Aug 14, 2018
Why is 2.4.3 so much faster on 'first force resync:' compared to the other two? Typo?
moscicki commentedon Aug 15, 2018
What about inotify watch limits? Also with 1M files it will take around 1GB of kernel memory according to: https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached
Will the sync client actually warn the user that there are more files to watch than the current limit?
Also, I would be good to check/document what would be the practical limits for oc sync client per platform (OSX, Win, Linux)?
jnweiger commentedon Aug 15, 2018
@dragotin Not exactly sure, but I noticed that with 2.4.3 when the initial sync finished, the ichon was green only for one or two seconds, then it became blue again and was busy for another 15 seconds. My guess is, it then already did, what the other two would do only on the first resync. Tried twice with same behaviour.
jnweiger commentedon Aug 15, 2018
@moscicki yes, we warn the user when we run out of inotify listeners. See #6119 for details.
I am curious what exact limit is needed for 1M files, and how much kmem that adds.
My 10k files test did not hit the limit 8000.
jnweiger commentedon Aug 15, 2018
200k files - a demonstrator that shows good speedup in 2.5.0
Summary: 200.000 files scattered in 2.000 folders on the server are in sync with a 2.4.1 and a 2.5.0 desktop client. When editing, adding or deleting a single file, the 2.4.1 client needs less than 10 seconds.
have enough inotify watches for 1M files.
echo 200000 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
client 2.5.0daily20181014
(false warning printed, that unchecked folders will be removed. they are not removed.)
client quit: vmstat-m.20180815-14:29:55.txt
client 2.4.1
jnweiger commentedon Aug 15, 2018
1M files - a demonstrator that shows moderate speedup in 2.5.0
Summary: 1.000.000 files scattered in 10.000 folders on the server are in sync with a 2.4.1 and a 2.5.0 desktop client. When editing, adding or deleting a single file, the 2.4.1 client needs between 1 and 2 minutes, but 2.5.0 only needs 20 to 30sec to sync to the server.
client 2.5.0daily20181014
client 2.4.1
jnweiger commentedon Aug 16, 2018
@moscicki Good news about inotify watch limits:
With a test tree of exactly 1010010 files in 10103 folders, the official number of watches appears to be 10390.
This number was found by bisecting
/proc/sys/fs/inotify/max_user_watchessettings.Compared with earlier tests, this confirms the impression that we have one watch per folder plus ca. 200 -- the number of files seems irrelevant.
Linux slabinfo (via
vmstat -sandslabtop, usingecho 3 > /proc/sys/vm/drop_caches) did not seem to be accurate enough to actually measure additional kernel memory consumption for the watches. In some cases kernel memory footprint even appeared to be smaller while the client was watching the tree.gnanet commentedon Sep 2, 2018
@jnweiger i consider switching from 2.4.3 to a 2.5 client on Ubuntu 14.04.5,
while checking /proc/sys/fs/inotify/max_user_watches the value is: 65536
So i looked into /etc/sysctl.d and found these settings with
grep inotify.max_user_watches *.confAGAIN the current value is 65536, this confirms my assumption, that the usual load-order specification has two digits for a reason:
According the docs
The #4107 (comment) suggesting to set the owncloud-inotify.conf load-order to 100, and the resulting commit owncloud/administration@8218eb3 created a bug.
guruz commentedon Sep 3, 2018
@gnanet Thanks for debugging. Your suggestion would be 99-*-inotify.conf?
ogoffart commentedon Sep 3, 2018
owncloud/administration#156 created