After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773826 - daemon: Bump maximum read channel buffer size
daemon: Bump maximum read channel buffer size
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2016-11-02 11:53 UTC by Bastien Nocera
Modified: 2017-01-03 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon: Bump maximum read channel buffer size (1.01 KB, patch)
2016-11-02 11:53 UTC, Bastien Nocera
none Details | Review
daemon: Bump maximum read channel buffer size (1.28 KB, patch)
2016-12-07 13:12 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2016-11-02 11:53:18 UTC
.
Comment 1 Bastien Nocera 2016-11-02 11:53:21 UTC
Created attachment 338949 [details] [review]
daemon: Bump maximum read channel buffer size

256k isn't in the "stupid" buffer size for network reads, so bump the
maximum size of the read buffer.

See https://bugzilla.gnome.org/show_bug.cgi?id=773632
See https://bugzilla.gnome.org/show_bug.cgi?id=773823
Comment 2 Bastien Nocera 2016-11-02 11:54:22 UTC
From https://bugzilla.gnome.org/show_bug.cgi?id=773632

> Indeed, and that does boost the speed further, 29.65 MB/s over 10 separate runs > of 1GB downloads with a maximum of 31.6 MB/s.
Comment 3 Ondrej Holy 2016-11-02 12:19:05 UTC
Review of attachment 338949 [details] [review]:

Makes sense to me, however, truly, I have no idea whether it is reasonable, or not. It helps to smb, but it may cause troubles somewhere else. Probably, it is worth to ask Alex, who added the comment about the "stupid" sizes...

I would also change the following:
@@ -120,4 +120,6 @@ modify_read_size (GVfsReadChannel *channel,
     real_size = 32*1024;
-  else
+  else if (channel->read_count <= 5)
     real_size = 64*1024;
+  else
+    real_size = 128*1024;
Comment 4 Alexander Larsson 2016-11-11 10:35:30 UTC
Well, its complicated, but for a sufficiently smart lower level, using a large buffer (like libsmb apparently is) would let it do multiple rad requests in parallel, this avoiding multiple roundtrips.

However, at some point you loose out to pipelining on the write side. As an extreme example, in a file copy say you read the 10 megs before you writing, then you'll block on the write side because the write cache is full, so you won't start the next read operation until that is written.

An *ideal* pipelined copy would have outstanding reads and writes in parallel, but the gio apis make this a bit hard, you typically end up doing "do { read; write } until done;".
Comment 5 Bastien Nocera 2016-12-07 13:12:21 UTC
(In reply to Alexander Larsson from comment #4)
> Well, its complicated, but for a sufficiently smart lower level, using a
> large buffer (like libsmb apparently is) would let it do multiple rad
> requests in parallel, this avoiding multiple roundtrips.
> 
> However, at some point you loose out to pipelining on the write side. As an
> extreme example, in a file copy say you read the 10 megs before you writing,
> then you'll block on the write side because the write cache is full, so you
> won't start the next read operation until that is written.
> 
> An *ideal* pipelined copy would have outstanding reads and writes in
> parallel, but the gio apis make this a bit hard, you typically end up doing
> "do { read; write } until done;".

That sounds like a separate enhancement. I'll try to find a bug for it, or file a new one.
Comment 6 Bastien Nocera 2016-12-07 13:12:30 UTC
Created attachment 341541 [details] [review]
daemon: Bump maximum read channel buffer size

256k isn't in the "stupid" buffer size for network reads, so bump the
maximum size of the read buffer.

See https://bugzilla.gnome.org/show_bug.cgi?id=773632
See https://bugzilla.gnome.org/show_bug.cgi?id=773823
Comment 7 Bastien Nocera 2017-01-03 12:33:03 UTC
Attachment 341541 [details] pushed as 59f9c6a - daemon: Bump maximum read channel buffer size