FreeFileSync Crash Apple Silicon Mac

Get help for specific problems
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

The only issue could be the speed, under 400MBps, while Finder is able to achieve 800MBps (in our case, reading from 4x HDDs Raid 5 and writing to a NAS). RUBEN SALAZAR, 11 Sep 2022, 20:59
And before you got 700MB/sec with FFS according to your screenshots?

I suspect disabling file system cache also disables prefetching.
Here's a version that tries to enable prefetching even with disabled OS file system caching.
Do you see an improvement?
https://www.mediafire.com/file/5xna14zw59y4qcc/FreeFileSync_11.26_beta3_macOS.zip
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

@RUBEN SALAZAR:
BTW: when you make performance measurements/comparsions, *restart* your mac between each run. Otherwise the numbers will be garbage due to buffers at various levels (OS, and hardware).

At the very least, do a
sudo purge
to clear OS cache before each test.
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Thank you so much for this beta testing chance!!

I have been testing, the app is stable in M1. Finder is still working faster, but I guess that verification between files 'is not free'. So close to 400MBps could be great for one touch process!

FFS 11.26 BETA 3 APP VS FINDER 220912.jpg
FFS 11.26 BETA 3 APP VS FINDER 220912.jpg (283.83 KiB) Viewed 4285 times
In the picture, Data sent with Finder, stopping, and syncing the same content with FFS 11.26 b3

And, yes, restarting computer before testing! THANKS! Any other improvements are welcome, and I am available for testing them!
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

I have a hunch that prefetching is enabled by default on macOS, so that enabling it explicitly does nothing.
But there's one more thing we could try:

Disable caching only for the target file.

This should partially reduce the load on the OS file system cache, and also get FFS performance back to what it was in 11.25. Can you confirm?
https://www.mediafire.com/file/fyhkzfhm6k40c3n/FreeFileSync_11.26_beta4_macOS.zip
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

FFS 11.26 BETA 4 Faster.png
FFS 11.26 BETA 4 Faster.png (351.44 KiB) Viewed 4267 times
In the picture, syncing from Raid 5 to NAS, while kernel is not in panic

It is working faster! CONGRATS! Now is achieving the speed of Finder.

I got 800MBps on weekend that the NAS was not working. I will stress it!

Curiously the 5th core is now working in its way
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Curiously the 5th core is now working in its way RUBEN SALAZAR, 12 Sep 2022, 14:19
This is probably because the input stream is still OS-buffering in this beta.
It is working faster! CONGRATS! Now is achieving the speed of Finder. RUBEN SALAZAR, 12 Sep 2022, 14:19
Interestingly, I'm not able to reproduce the perf-degradation when OS buffering is disabled. Quite contrary, FFS is significantly faster (about 30% shorter runtime) for local SSD-based file copying.

But there's a different bottleneck. FFS could get rid of needless intermediary buffers. This gives another good speed improvement in my tests. I believe we can match Finder with the following version which even has OS file cache disabled for both source and target.

What do you see in your tests? Can we have our cake and eat it, too?
https://www.mediafire.com/file/3hzxvvu0lg8gbed/FreeFileSync_11.26_beta5_macOS.zip
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Thank you for this 5th beta. The behaviour is similar to 3rd. And winner is 4th!

FFS BETA 5 vs BETA 4 220913.png
FFS BETA 5 vs BETA 4 220913.png (451.96 KiB) Viewed 4228 times
In the picture, first installed Beta 5 and test, 400MBps average. Then overwritten with old Beta 4 and run, 600MBps average, the same as Finder copying-pasting

After testing 5th, re-installing 4th and testing, I re-installed 5th again and same result, going down to 400MBps again:
FFS BETA 5 then 4 then 5 220913.png
FFS BETA 5 then 4 then 5 220913.png (452.25 KiB) Viewed 4228 times
In the picture FFS Beta 5 second round. After first round I overwrote with Beta 4 getting the best performance.
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Testing Beta 5 vs. Beta 4 with content from SSD, instead Raid 5 HDD.
Beta 4 wins!
Compared twice, both versions, with purged cache before all tests.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Hm, this clearly needs more testing. I don't have other ideas at this point, other than maybe if the terminal command "cp" is as fast as Finder, we could analyze what clever thing it does: https://freefilesync.org/faq.php#trace

File copy while skipping the OS file cache is the default on macOS (both Finder and copyfile() function), so this seems to be the right direction. Disabling cache only for one side will problably not help in scenarios where source and target devices are reversed, so it's all or nothing. Therfore I'll include beta5 for the next release. If feedback is such that performance suffers in most cases, we can still go back to OS caching + system instability.
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Yes, maybe not all users will notice the differences between 4 and 5 in terms of speed transfer but stability is the main goal!
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

After further testing it became clear that buffer size might be the remaining issue. My SMB network share advertizes an f_iosize of 7405568 bytes, but for optimal speed matching Finder this needs to be 32 MB at least! I have no idea why buffer sizes that large make a difference, but apparently each network write is unusually expensive.

I've doubled the f_iosize sizes, which gets me in the range of only 5% slower than Finder in my tests.
With 4 x f_iosize I can match Finder. But I don't want to deviate too much from what is defined as "optimal transfer block size for the file system". Not so optimal, aparently. What do you get?

https://www.mediafire.com/file/vbaqie55wh1iwx7/FreeFileSync_11.26_beta6_macOS.zip
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Beta 4 is still the faster vs. Beta 6. As in B3 or B5 the speed is 'limited', in our case, to 400MBps instead 600MBps achieved by B4:

FFS 11.26 BETA 4 vs BETA 6 220915.png
FFS 11.26 BETA 4 vs BETA 6 220915.png (224.77 KiB) Viewed 4147 times
In the picture, first block Beta 4, second round with Beta 6. A non identified peak of data there (700MBps) but average of 400MBps instead 600MBps.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Slower speed after buffer size increase doesn't make much sense. Unless prefetch is not happening, and FFS is switching back and forth between read and write.
Here's a version implementing prefetch via a FFS worker thread:
https://www.mediafire.com/file/oymxy279w0ypjks/FreeFileSync_11.26_beta7_macOS.zip

BTW is your target network connected using SMB or AFP? Are you using fast SSDs only or also slower devices?
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

The behaviour of slow / fast is proportional to the use of the main storage, or the use of a SSD for testing.

The main is 4x HDDs in Raid 5 (thunderbolt 3), to a NAS (1PB) over 10Gbps network with Mac Minis M1, with 10Gbe adapter.
Pending the test with 8-bay Raid 5 disks.

Protocol is SMB 3. We have been forcing SMB 2 in the past (till 3 days ago) to avoid crashes with M1s' data transferring to other M1s.
But NAS is using 3.1.1.

Using Big Sur and also testing Monterey and Ventura. Speed behaviour is the same with beta versions in the 3 O.S.

Only happens with Minis M1. iMacs work fine!

Also pending the tests with Jumbo MTU. Now is 1500. But have to change several switches / ports
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Tested. Beta 7 is as fast as Beta 4.
Posts: 1
Joined: 20 Sep 2022

antag

I just discovered this thread, so glad to hear this is being worked on.
I am having this issue on a Macbook Pro 16, Max 32core, 64gb ram.
My storage is a Synology 1621+ NAS over 1gbe for now.
I can help with testing from now on if needed.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Tested. Beta 7 is as fast as Beta 4. RUBEN SALAZAR, 15 Sep 2022, 21:44
And beta 4 was the fast one in your setup! Does this mean Beta 7 is as fast as Finder on your system?

To not lose track:
beta3:  Disable caching source & target + F_RDAHEAD
beta4:  Disable caching only for the target
beta5:  Disable caching source & target + less mem copies
beta6:  Disable caching source & target + larger buffers
beta7:  Disable caching source & target + larger buffers +  prefetching thread
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

I just discovered this thread, so glad to hear this is being worked on.
I am having this issue on a Macbook Pro 16, Max 32core, 64gb ram.
My storage is a Synology 1621+ NAS over 1gbe for now.
I can help with testing from now on if needed. antag, 20 Sep 2022, 08:35
Perfect! Can you test betas 6 and 7 and compare the speed with Finder? Be sure to "sudo purge" before each test!
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

A curiosity... A Mac Mini M1 running 1 instance of FFS is getting about 250 or 300MBps from an external SSD connected through USB 10Gbps to a Thunderbolt 3 4x Raid 5.
And a second instance running at the same time, from other SSD to the same Raid, different folders, is achieving close to the same speed.
The sum of 2 FFSs running at once is faster, getting the speed of the bus.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

@RUBEN SALAZAR:
Any feedback on viewtopic.php?t=8039&p=35220#p35266 ?

@antag:
Have you made any tests so far? viewtopic.php?p=35316#p35267
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR


And beta 4 was the fast one in your setup! Does this mean Beta 7 is as fast as Finder on your system?

To not lose track:
beta3:  Disable caching source & target + F_RDAHEAD
beta4:  Disable caching only for the target
beta5:  Disable caching source & target + less mem copies
beta6:  Disable caching source & target + larger buffers
beta7:  Disable caching source & target + larger buffers +  prefetching thread
Zenju, 20 Sep 2022, 08:47
Yes, Beta 7 was as fast as Finder. Not tested in depth... I will try this week.
Posts: 4
Joined: 30 Jun 2022

chris99

We tested Beta 7. Speed is mostly at 450MB witht up to 750MB (with the finder/testtool we reach 950MB via smb). We just copied 271GB to the server without crash.

Occasionally ffs is hanging with 0MB for around 3-5 seconds and then ffs goes on with good speed.
So it is much better because we have no crashes and faster speed.

Our System is an 10GB Ethernet M1 Studio Ultra with 64GB Ram copying to a synology server via SMB with write speed up to 950MB.

So big thanks for the test and betas.

Is there anything we can help to test? Then we need a little manual or to do-list, what we should test.
But thanks for this great tool and the betatesters here. You save us a lot of time!!
Chris
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

All in all this looks promising, so let's got with the "Disable caching source & target + larger buffers + prefetching thread" approach.

Here's the release candidate for FFS 11.26 including the latest changes: https://www.mediafire.com/file/d2zosp14j8f3ftg/FreeFileSync_11.26_RC_macOS.zip
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Thank you Zenju for all the betas!
Posts: 3
Joined: 30 Sep 2022

DeccaUK

I have tried all the betas and the latest 11.26. They all crash my Mac Studio when writing to my QNAP NAS. It is set up in RAID 0 for speed. File transfers quickly get slower and slower, from over 400 Mb/s to less than 100, and eventually the Mac hangs.
Posts: 3
Joined: 30 Sep 2022

DeccaUK

...so any more update on this issue?
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

...so any more update on this issue? DeccaUK, 13 Oct 2022, 12:50
Which O.S?
I solved last year forcing Samba 2 between computers (Mac minis M1). Just an idea.
Posts: 3
Joined: 30 Sep 2022

DeccaUK

Mac Studio (as I said in my post) as shipped and with the latest updates applied. Solved in 2021? Really? So why does this thread even exist?

Using the sync function of the Forklift app, there are no issues whatsoever.
Posts: 21
Joined: 7 Sep 2021

RUBEN SALAZAR

Not exactly solved, just protocol was changed to Samba 2 in several machines.