Replies: 8 comments 5 replies
-
What's the speed accessing the file share with other methods? For example, copying with PowerShell, explorer and some third-party file manager? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Sequential reading costs network round trips. You can probably increase the speed by using larger buffers, and performing reads in parallel. |
Beta Was this translation helpful? Give feedback.
-
How fast is FileStream when the source and destination are local? |
Beta Was this translation helpful? Give feedback.
-
Well you talk about And as @tmds suggested larger transfers typically yield better results. You can increase send/receive socket buffers and your should disable Nagle's e.g |
Beta Was this translation helpful? Give feedback.
-
So, here's another hash run with a 1 gigabyte buffer. You can see the spikes up and down when the system has to wait for the buffer to get refilled. This is with Asynchronous, SequentialScan, and FileFlagNoBuffering (which actually helps a lot). @wfurt The only thing I left out of the code earlier was the stream open, so here you go:
And yes, I've tried every Options flag. |
Beta Was this translation helpful? Give feedback.
-
I spent yesterday writing a POC to use buckets instead. This is the same run on the same file, using 32x512kb buckets instead of a linear buffer. The results were staggering and went far beyond my expectations, and even sped up local SSD hashing with only a total of 16mb of buffer space: I'm not posting the code (yet, it's still really green), but I basically just "wrapped" filestream, and put my bucketreader on top of it.
|
Beta Was this translation helpful? Give feedback.
-
Local SSD hashing the same file, performance gains ... BucketStreamReader w/ 32x512kb buckets:
FileStream w/ a single 16mb buffer:
So, the bucketstream reader cut about 6 seconds off the read portion of the file hashing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've spent a few days trying to figure out how to speed up FileStream a bit and wondered if anyone else has run into these issue(s) I've been having ...
On 10gbit ethernet, I can't get FileStream to go above about 3.5gbit/sec on its own. No buffer changes, no open flags, no combination will get FileStream up high enough to saturate a 10gbit connection.
On powershell for example, if you run Get-FileHash on a network file over 10gbit, you won't go over 3.5. On local SSD it's fairly speedy, but over a network it's a dog.
My conclusion so far has been that the FileStream implementation, buffered or unbuffered, just isn't keeping read requests queued up enough to saturate the wire. Below it took over 1 minute to SHA256 hash a 21gb file over the network. It spent only 13 seconds in the hash algorithm, the rest was FileStream. For comparison, it normally takes roughly 25 seconds to physically copy the file from the network to local.
The code's fairly simple, I've tried dozens of iterations, from async to non-async,
Memory<T>
Span<T>
you name it. Results vary only slightly.Beta Was this translation helpful? Give feedback.
All reactions