# Directio question

**URL:** <https://www.ruby-forum.com/t/directio-question/184740>\
**Category:** NGINX\
**Created:** [March 7, 2010, 7:08pm UTC](https://www.ruby-forum.com/t/directio-question/184740 "2010-03-07T19:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamstef](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/6a8cbe/32.png) [@iamstef](https://www.ruby-forum.com/u/iamstef)\
**Post date:** [March 7, 2010, 7:08pm UTC](https://www.ruby-forum.com/t/directio-question/184740/1 "2010-03-07T19:08:00Z")

</div>

Hi,

My name is Stefan P., Im working on [http://www.systemdatarecorder.org](http://www.systemdatarecorder.org)  
and I have started to test and consider replacing for our solution  
apache over nginx. Im getting to know nginx and I like the server.

Some question reading over [Module ngx\_http\_core\_module](http://wiki.nginx.org/NginxHttpCoreModule)  
about DirectIO:

“The directive enables use of flags O\_DIRECT (FreeBSD, Linux),  
F\_NOCACHE (Mac OS X) or directio() function (Solaris) for reading  
files with size greater than specified. This directive disables  
use of sendfile for this request.”

DirectIO in Solaris is a feature, when enabled lets you to bypass  
entirely the  
OS’s page cache and read/write directly from/to disk. This has some  
benefits where workloads are database servers and you want to avoid  
double caching.

Im a bit curious under what situations would like to have DirectIO  
enabled on  
nginx and are we talking about same thing when we refer to directio ?  
[Loading...](http://www.solarisinternals.com/wiki/index.php/Direct_I/O)

Usually most applications will benefit of having the OS’s page cache  
involved  
rather of going to disk.

Thanks,  
stefan

---

<div class="post-metadata">

**Author:** ![iamstef](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/6a8cbe/32.png) [@iamstef](https://www.ruby-forum.com/u/iamstef)\
**Post date:** [March 7, 2010, 7:44pm UTC](https://www.ruby-forum.com/t/directio-question/184740/2 "2010-03-07T19:44:17Z")

</div>

On Sun, Mar 07, 2010 at 08:07:13PM +0200, Stefan P. wrote:

> F\_NOCACHE (Mac OS X) or directio() function (Solaris) for reading  
> [http://www.solarisinternals.com/wiki/index.php/Direct\_I/O](http://www.solarisinternals.com/wiki/index.php/Direct_I/O)
> 
> Usually most applications will benefit of having the OS’s page cache involved  
> rather of going to disk.

Yes, nginx’s directio is what you have said. It may or may not improve  
perfomance of serving large files when a server physical memory is much  
less than summary size of the files.

–  
Igor S.

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

---

<div class="post-metadata">

**Author:** ![iamstef](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/6a8cbe/32.png) [@iamstef](https://www.ruby-forum.com/u/iamstef)\
**Post date:** [March 7, 2010, 8:19pm UTC](https://www.ruby-forum.com/t/directio-question/184740/3 "2010-03-07T20:19:25Z")

</div>

> Yes, nginx’s directio is what you have said. It may or may not improve  
> perfomance of serving large files when a server physical memory is much  
> less than summary size of the files.

aha, cool. Many thanks for clarification.

stefan
