Best file system for serving 1GB files using nginx, under moderate write, read performance-wise?

后端 未结 3 812
悲&欢浪女
悲&欢浪女 2021-02-01 10:36

I\'m going to build large files server, and need stack-overflow community advice for file system choice (linux).

File server is going to serve 1-2GB sized static files

3条回答
  •  终归单人心
    2021-02-01 11:18

    To provide best results with serve heavy content, there is something else to tune. Please take a look at Nginx core developer's comment below:

    1. Switch off sendfile, it works bad on such workloads under linux due to no ability to control readahead (and hence blocks read from disk).

      sendfile off;

    2. Use large output buffers

      output_buffers 1 512k

    3. Try using aio to ensure better disk concurrency (and note under linux it needs directio as well), i.e. something like this

      aio on; directio 512;

    Other recommendations:

    1. Check the filesystem swap is not used

    2. Filesystem - ext4, xfs. Good to enable data_writeback and noatime mount options

提交回复
热议问题