New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multicore repo scanning #293
Comments
Are you running a recent version? calmh@21335d6 |
A single repo is still scanned on only one thread. |
Yeah, I'm running 0.8.10 gc6ba020. I suppose that the walk function used by that ScanRepo function would have to perform walkAndHashFiles using the same sort of go routine? Then again, this doesn't look like C... |
Yeah, what needs to happen to distribute load is to fire up multiple goroutines to do the reading/hashing and then distribute the files or blocks to them with a queue. It's not rocket science, just complexity that hasn't been necessary yet. |
Should probably do some benchmarking to see how much CPU a SHA256 hasher needs anyway. I think I was going by the assumption that in most cases the disks were going to be the bottleneck. Of course, fast SSDs and RAID setups shift that balance. |
Hmm. I just ran a sha256sum on some files while syncthing is running. I notice that the CPU isn't being taxed much more, but it seems like two threads helped saturate the disk I/O even more. Syncthing: CPU: 92% (this is out of 800% for 8 cores), Disk I/O: 55MB/sec The disk I/O was measured using iotop, so I'm not sure how accurate it is. It seems like multithreading can help with disk I/O more than CPU, since even sha256sum wasn't pegging the CPU too much... |
Note also that if/when this is implemented it will immediately generate a counter-bug-report saying that CPU usage is too high and this affects media playback or whatever. So it'll need to be tuneable etc. |
For too much CPU usage, is "nice" and to much IO usage is "ionice" for. So IMHO syncthing must not have any tuneable settings for this. just my 2 cents. |
Windows. |
Who says syncthing should sync as fast as possible? I want it to stay out of the way as much as possible, not turn my laptop into a battery dead heat monster :) |
^ There we go! :) |
windows has also priority for CPU and IO ;) |
I agree that it should stay out of the way, but what if we add a "Thread count" option? |
Note that this actually already exists. As part of the Go runtime, you can set the environment variable |
Syncthing doing initial scan (no index) of two repos, prior to this commit - one core per repo: With parallel hasher, many cores per repo: Note that it still doesn't manage to saturate all cores when scanning a single repo (the period from ~12 to 26 seconds). I guess it needs more threads doing I/O as well to be able to get the most data from disks. Anyway, good enough for now. As above, use |
Strange request for enhancement: Is it possible for syncthing to be multithreaded when performing a scan? My Corei7 appears to use one core to perform a scan, would probably see improvements in speed when using all 8...
The text was updated successfully, but these errors were encountered: