# EXT4文件系统优化

EXT4文件系统性能比较中庸，如果出于稳定性和兼容性考虑选择了EXT4文件系统，可以尝试使用如下方法做一些优化

```
#increase number of requests:
echo 4096 > /sys/block/sdb/queue/nr_requests
#use aggressive mount options:
mount  -oremount,noatime,nodiratime,logbufs=8,logbsize=256k,largeio,inode64,swalloc,allocsize=131072k,nobarrier /dev/sdb /data
```

上述命令重新使用新的优化参数挂载了EXT4文件系统。

对于数据库+SSD存储，建议使用XFS文件系统。

* 其他EXT4文件系统挂载参数组合

```
defaults,noatime,nodiratime,nodelalloc,barrier=0,dioread_nolock,grpjquota=aquota.group,jqfmt=vfsv1
```

> 具体我再撰文解析

## 参考

* [High load average, but low CPU/IO figures - how to diagnose? ](http://serverfault.com/questions/757546/high-load-average-but-low-cpu-io-figures-how-to-diagnose-dmesg-output-inclu)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://huataihuang.gitbook.io/cloud-atlas-draft/os/linux/storage/filesystem/ext/ext4_tunning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
