buffer size for writing and reading

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

buffer size for writing and reading

Yue Li
I noticed that in my testing, the writing size has always been set to
131072 bytes during each write (unless the actual data size is smaller
than that), and during the reading, some times it is 131072, but
sometimes it can be changed to 65536 and other sizes.

I'm wondering are these write and read sizes controlled by user
application (in my test i used dd), or it can actually be controlled by
FUSE?

And is it possible to make these sizes fixed, say I want to stay at
131072 or even larger for each read?

Thanks,

Yue

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: buffer size for writing and reading

Nikolaus Rath
On Feb 12 2017, Yue Li <yli-wUU9E3n5/[hidden email]> wrote:
> I noticed that in my testing, the writing size has always been set to
> 131072 bytes during each write (unless the actual data size is smaller
> than that), and during the reading, some times it is 131072, but
> sometimes it can be changed to 65536 and other sizes.
>
> I'm wondering are these write and read sizes controlled by user
> application (in my test i used dd), or it can actually be controlled by
> FUSE?

Depends. read() size is controlled by the kernel, unless you use
direct_io. write() size is controlled by userspace, unless you use
writeback_cache. Your filesystem can limit the maximum size of requests
that the kernel will send.


Best,
-Nikolaus

--
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: buffer size for writing and reading

Yue Li


On 2/15/17 5:15 PM, Nikolaus Rath wrote:

> On Feb 12 2017, Yue Li <yli-wUU9E3n5/[hidden email]> wrote:
>> I noticed that in my testing, the writing size has always been set to
>> 131072 bytes during each write (unless the actual data size is smaller
>> than that), and during the reading, some times it is 131072, but
>> sometimes it can be changed to 65536 and other sizes.
>>
>> I'm wondering are these write and read sizes controlled by user
>> application (in my test i used dd), or it can actually be controlled by
>> FUSE?
> Depends. read() size is controlled by the kernel, unless you use
> direct_io. write() size is controlled by userspace, unless you use
> writeback_cache. Your filesystem can limit the maximum size of requests
> that the kernel will send.
>
Thanks Nikolaus, I prefer to control the sizes be controlled by my
filesystem, I will try to use the options you mentioned.

Best,

Yue


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel