tsudoko / anki-sync-server

Self-hosted Anki sync server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Long media sync times

genedan opened this issue · comments

Is anyone noticing a long sync time for media changes, for those of you who have a large collection? It's 15 minutes on my end. Sometimes it fails, so I have to resync and wait another 15 min, etc.

To reproduce the issue, simply have a large media collection (I have 40k files), make some media changes, and then sync.

I'm not sure if the issue is on the side of AnkiDroid or ankisyncd, just my observations.

Off the top of my head, found what I think are a few bugs with upstream code that might be related. What is the server thread doing during this time? Do you have any logs you could share?

Even with ~3k media in my collection I encounter this too, but only on AnkiDroid. It's quite fast on the desktop version. I have my collection on an external SD card, though, which is not officially supported on AnkiDroid1, so I decided not to report it.

What is the server thread doing during this time?

It appears to be idle. On the AnkiDroid side, the collection log is being filled with media comparison results, e.g.:

[1551932370] MediaSyncer.java:sync(): check: lsum=ce18 rsum=ce18 ldirty=0 rusn=3518 fname=[snip]
[1551932370] MediaSyncer.java:sync(): have same already
[1551932370] MediaSyncer.java:sync(): check: lsum=39b2 rsum=39b2 ldirty=0 rusn=3518 fname=[snip]
[1551932370] MediaSyncer.java:sync(): have same already
[1551932370] MediaSyncer.java:sync(): check: lsum=961f rsum=961f ldirty=0 rusn=3518 fname=[snip]
[1551932370] MediaSyncer.java:sync(): have same already
[1551932370] MediaSyncer.java:sync(): check: lsum=d665 rsum=d665 ldirty=0 rusn=3518 fname=[snip]
[1551932370] MediaSyncer.java:sync(): have same already
[1551932371] MediaSyncer.java:sync(): check: lsum=9988 rsum=9988 ldirty=0 rusn=3518 fname=[snip]
[1551932371] MediaSyncer.java:sync(): have same already
[1551932371] MediaSyncer.java:sync(): check: lsum=0d5a rsum=0d5a ldirty=0 rusn=3518 fname=[snip]
[1551932371] MediaSyncer.java:sync(): have same already
[1551932371] MediaSyncer.java:sync(): check: lsum=f43a rsum=f43a ldirty=0 rusn=3518 fname=[snip]
[1551932371] MediaSyncer.java:sync(): have same already
[1551932371] MediaSyncer.java:sync(): check: lsum=ad2f rsum=ad2f ldirty=0 rusn=3518 fname=[snip]
[1551932371] MediaSyncer.java:sync(): have same already

Same happens to me too and like tsudoko, only on AnkiDroid! :)

My collection log file looks like @tsudoko's, except mine has about 70,000 lines of media checks, so I suppose it goes through the entire media folder one file at a time.

Is this an issue worth raising at AnkiDroid? I have my collection stored in internal storage.

Workaround: #44