ZFS+NGINX, directio or sendfile or aio?

Hi all,

I read some articles about nginx optimization. Lots of articles are using below settings:

Code:
  aio  sendfile;
  sendfile  on;
  tcp_nopush  on;
  directio  4m;
  directio_alignment  4096;

But according to this article (https://calomel.org/nginx.html), zfs does't support directio, and sendfile on zfs will cause redundant data caching.

Now I'm confused. on FreeBSD-10.1 with ZFS and nginx, which option should I use?

Option 1

Code:
  aio  sendfile;
  sendfile  on;
  tcp_nopush  on;
  tcp_nodelay on;
  directio  4m;
  directio_alignment  4096;

Option 2

Code:
  aio  sendfile;
  sendfile  on;
  tcp_nopush  on;
  tcp_nodelay on;

Option 3
Code:
  aio  on;
  sendfile  off;
  tcp_nopush  on;
  tcp_nodelay on;
 
I'm saying that, out of all those options, only the third one is about ZFS. I only looked at it briefly this morning. I, too, use it as a reference for doing my set up but I don't use ZFS. The first two, iirc, aren't for ZFS set ups.

When I first set up my servers, I knew more about this but haven't touched them in a year. Just read what they have to say more closely. If he says turn it off then turn it off. You won't blow anything up.
 
For ZFS/nginx performance, I remember reading allanjude@'s Managing FreeBSD @ Scale presentation and I believe his experience (and hopefully configuration snippets) may be helpful in answering your question.

If not, try them all the run benchmarks. Hunches and guess only go so far. Prove what works best and document your findings for the benefit of others.
 
Back
Top