Performance

zfs 慢 - 池 76% 已滿。性能問題的可能原因?

  • October 17, 2022

我們有一個 zfs 文件伺服器,它的速度已經大大降低(伺服器將映像託管到生產環境,並且下載在大約 50% 的時間裡超時)……速度很慢的特定池使用了大約 76% 的容量。這是導致 zfs 性能不佳的已知場景(容量接近 80%)嗎?如果是這樣,關於最大容量百分比的最佳實踐是什麼,應該允許池使用?

eddie@oz:/u/home/jeff$ zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP    HEALTH  ALTROOT
rpool  7.12T  5.46T  1.66T  76%  1.00x  DEGRADED  -
u      7.12T  5.46T  1.66T  76%  1.00x  DEGRADED  -
eddie@oz:/u/home/jeff$ zpool status -v u
pool: u
state: DEGRADED
status: One or more devices has been removed by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scan: scrub repaired 0 in 2h38m with 0 errors on Fri Apr  3 12:48:25 2015
config:
NAME          STATE     READ WRITE CKSUM
u             DEGRADED     0     0     0
raidz2-0      DEGRADED     0     0     0
c1t0d0s1      ONLINE       0     0     0
c1t1d0s1      ONLINE       0     0     0
c1t2d0s1      ONLINE       0     0     0
c1t3d0s1      ONLINE       0     0     0
c1t4d0s1      ONLINE       0     0     0
c1t5d0s1      ONLINE       0     0     0
c1t6d0s1      REMOVED      0     0     0
device details:
errors: No known data errors
eddie@oz:/u/home/jeff$ zfs list                                                                                                                            NAME                                USED  AVAIL  REFER  MOUNTPOINT
rpool                              16.9G   563G  69.3K  /rpool
rpool/ROOT                         16.6G   563G  69.3K  legacy
rpool/ROOT/solaris                 5.93M   563G   744M  /
rpool/ROOT/solaris-0               16.0G   563G  2.80G  /
rpool/ROOT/solaris-0/var           7.88G   563G  1.32G  /var
rpool/ROOT/solaris-1                179M   563G   744M  /
rpool/ROOT/solaris-1/var            176M   563G   145M  /var
rpool/ROOT/solaris-2                146M   563G   749M  /
rpool/ROOT/solaris-2/var            141M   563G   148M  /var
rpool/ROOT/solaris-3               90.6K   563G   749M  /
rpool/ROOT/solaris-3/var           2.13K   563G  70.0M  /var
rpool/ROOT/solaris-4                128M   563G   754M  /
rpool/ROOT/solaris-4/var            125M   563G   135M  /var
rpool/ROOT/solaris-5                120M   563G   756M  /
rpool/ROOT/solaris-5-backup-1       240K   563G   756M  /
rpool/ROOT/solaris-5-backup-1/var   100K   563G  75.6M  /var
rpool/ROOT/solaris-5/var           93.1M   563G  75.5M  /var
rpool/ROOT/solaris-6                260K   563G  1.22G  /
rpool/ROOT/solaris-6/var            151K   563G   852M  /var
rpool/ROOT/solaris/var              528K   563G  68.2M  /var
rpool/VARSHARE                      303M   563G  82.9M  /var/share
rpool/VARSHARE/pkg                  553K   563G  71.4K  /var/share/pkg
rpool/VARSHARE/pkg/repositories     207K   563G  69.3K  /var/share/pkg/repositories
rpool/export                       4.85M   563G  71.4K  /export
rpool/export/home                  4.52M   563G  73.6K  /export/home
rpool/export/home/jeff              375K   563G  77.8K  /export/home/jeff
u                                  3.69T   563G  1.88T  /u
u/backups                           156G   563G  72.5K  /u/backups
u/backups/cms                      60.6G   563G  7.29G  /u/backups/cms
u/backups/eureka                    263M      0   263M  /u/backups/eureka
u/backups/gitlab-backups           58.2G   563G  58.2G  /u/backups/gitlab-backups
u/backups/misc                     4.67G   563G  4.67G  /u/backups/misc
u/backups/prog_epicor              32.3G   563G  21.6G  /u/backups/prog_epicor
u/eng                              14.0G   563G  9.41G  /u/eng
u/eng/datasheets                   2.09G   563G  2.04G  /u/eng/datasheets
u/fm                                244K   563G  89.6K  /u/fm
u/gitlab                            153G   147G   112G  /u/gitlab
u/log                               278K   563G  56.5K  /u/log
u/ltsp                             1.84G   563G  1.16G  /u/ltsp
u/maildir                           351G   563G   380K  /u/maildir
u/maildir/accounting               6.24G   563G  4.41G  /u/maildir/userX
... 
approximately 65 entries
...
u/maildir/wiki                      664K   563G  52.3K  /u/maildir/userY
u/protected                        50.1M   563G  71.4K  /u/protected
u/protected/allocmac                350K  99.7M   141K  /u/protected/allocmac
u/quality                          1.32G   563G  1.08G  /u/quality
u/sales                            10.6M   563G  58.7K  /u/sales
u/sales/customer-scans             10.3M   563G  9.02M  /u/sales/customer-scans
u/var                              2.51G   563G  60.8K  /u/var
u/var/log                          2.51G   563G  1.24G  /u/var/log
u/var/log/httpd                     103M   563G  2.77M  /u/var/log/httpd
u/var/spool                         327K   563G  52.3K  /u/var/spool
u/zfs                              56.4G   563G  56.4G  /u/zfs

我不知道 ZFS 池在某個百分比已滿時會降低性能的這種情況。我使用的池使用率 > 95%,性能沒有顯著下降。

但是由於缺少磁碟,您的池處於 DEGRADED 狀態。由於這是 RAIDZ2(非常接近 RAID6),因此您可以讓處理器計算每個操作的校驗和。您可以做的最好的事情是更換刪除的磁碟c1t6d0s1並等待一段時間以獲得一致的池。

引用自:https://serverfault.com/questions/1113304