# What does sendfile\_max\_chunk do?

**URL:** <https://www.ruby-forum.com/t/what-does-sendfile-max-chunk-do/188590>\
**Category:** NGINX\
**Created:** [May 14, 2010, 12:53pm UTC](https://www.ruby-forum.com/t/what-does-sendfile-max-chunk-do/188590 "2010-05-14T12:53:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Costello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@Costello](https://www.ruby-forum.com/u/Costello)\
**Post date:** [May 14, 2010, 12:53pm UTC](https://www.ruby-forum.com/t/what-does-sendfile-max-chunk-do/188590/1 "2010-05-14T12:53:30Z")

</div>

Hello,

Once again I am in need of your help!  
I’m looking to document directives that are missing from the Wiki.  
I found loads in the source code, especially thanks to Manlio P…

I’ve stumbled upon “sendfile\_max\_chunk” declared in  
ngx\_http\_core\_module.c.  
I investigated what this does, here is what I found:

- it’s a size value directive
- it’s set to 0 by default (presumably this means no maximum size)

I’m not sure what it does.  
It is probably somewhat connected to the use of sendfile, my  
understanding is as follows:  
“This directive defines the maximum size of chunks to be read from the  
storage system when using sendfile”.  
Is this a correct and accurate definition? Could anyone provide more  
information?

Thanks a lot in advance for helping me clear it out!

Best regards,  
Costello

Posted at Nginx Forum:

> **[What does sendfile\_max\_chunk do?](https://forum.nginx.org/read.php?2,86566,86566#msg-86566)**
>
> Hello, Once again I am in need of your help! I'm looking to document directives that are missing from the Wiki. I found loads in the source code, especially thanks to Manlio Perillo. I've stumbled upon "sendfile\_max\_chunk" declared in...

---

<div class="post-metadata">

**Author:** ![Costello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@Costello](https://www.ruby-forum.com/u/Costello)\
**Post date:** [May 14, 2010, 2:13pm UTC](https://www.ruby-forum.com/t/what-does-sendfile-max-chunk-do/188590/2 "2010-05-14T14:13:41Z")

</div>

On Fri, May 14, 2010 at 06:52:29AM -0400, Costello wrote:

> I’m not sure what it does.  
> It is probably somewhat connected to the use of sendfile, my understanding is as follows:  
> “This directive defines the maximum size of chunks to be read from the storage system when using sendfile”.  
> Is this a correct and accurate definition? Could anyone provide more information?

On fast local connection sendfile() in Linux may send tens of megabytes  
per one syscall blocking other connections. sendfile\_max\_chunk allows  
to limit the maximum size per one sendfile() operation.

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**
