LFSCK 4: improve LFSCK performance
(LU-6361)
|
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.7.0 |
| Fix Version/s: | Lustre 2.7.0 |
| Type: | Technical task | Priority: | Critical |
| Reporter: | Richard Henwood (Inactive) | Assignee: | nasf (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | HB | ||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 7020 | ||||||||
| Description |
|
Record linkEA verification history in RAM To know which linkEA entries on the object_A have been verified, LFSCK must pin object_A in RAM and record the linkEA entries verification history. To avoid exhausting available memory, not all objects are pinned in RAM. LFSCK permanently pins the object in RAM only for the first of verified link V and number of hard links 'N' or linkEA entries 'L' is more than one, (V == 1) && (N > 1 || L > 1). Consider the following cases: L > 1 || N > 1 L == 1 && N == 1 It is possible that, the first found name entry matches the unique linkEA entry, then L == V == N == 1, we neither record the object in the lfsck_namespace or pin the object in RAM, but as the LFSCK scanning, more name entries pointing to the same object may be found, at that time, with those new linkEA entries added, the object will be pinned in RAM and recorded in the lfsck_namespace file, and will be double scanned later. For a large system, this kind "upgrading" is very rare. We prefer to double scan these objects instead of pinning most unnecessary objects in RAM. L == 0 If too many objects are pinned in RAM, it may cause server memory pressure. To avoid exhausting memory, LFSCK needs to unpin objects from RAM. The following conditions to un-pinning are applied: L == V Memory pressure |
| Comments |
| Comment by Richard Henwood (Inactive) [ 06/Mar/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is a complex optimization that was omitted from LFSCK 1.5. The design is recorded here for review during future LFSCK phases. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Dilger [ 08/Nov/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The first think to measure here is how much performance impact writing entries to lfsck_namespace actually has. There isn't any benefit to implementing this complex change if it is not going to improve performance. This can be done by running LFSCK on a good-size filesystem with some percentage of hard links, say 1%, 5%, 10%, 25%, 50% either with the current code having lfsck_namespace written to a file on disk, or a hack mode where it is recorded only in memory (e.g. linked list or similar). If there is no significant difference in the performance there is no reason to implement this change. If the performance improvement is significant when inodes are not written to disk, then I think that inodes should not be written to lfsck_namespace unless they are pushed from RAM. The vast majority of objects will not need to be written to disk. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Gerrit Updater [ 18/Nov/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/12769 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Gerrit Updater [ 20/Nov/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/12794 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Gerrit Updater [ 21/Nov/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/12809 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by nasf (Inactive) [ 26/Nov/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Here are some test: -------------------------
------------------------- -------------------------
-------------------------
------------------------- So caching linkEA verification history in RAM for most of cases may be not worth. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Dilger [ 26/Nov/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
According to http://www.pdsi-scidac.org/fsstats/ and fsstats that I've collected from other Lustre sites, the number of files with more than one hard link is very small in HPC. Of 24 sites that I have data for, 99.98% of 196M total inodes only had a single link, and 6/24 sites had no files with hard links at all. Based on the performance results shown, processing time is increased by about 1% per 1% of hard-linked files, so this optimization would typically only improve speed by about 0.02% and it doesn't seem worth the extra complexity for such a marginal improvement. Also, for very large filesystems or filesystems with many hard links the extra memory usage may also slow down normal usage due to cache pressure. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by nasf (Inactive) [ 20/Jan/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It is verified that it may be unnecessary to cache the linkEA verification history in RAM, but just as shown above, when a lot of FIDs are recorded in the namespace LFSCK trace file, the namespace LFSCK performance slows down. In fact, the the namespace LFSCK uses trace file to record the FID of the object that has multiple hard links, or has remote name entry, or contains some uncertain inconsistency, and so on. Only single namespace LFSCK trace file is not efficient, especially when there are millions of FIDs to be recorded. So it is still valuable to improve the namespace LFSCK performance via enhancing the namespace LFSCK trace file: uses multiple namespace LFSCK trace files and per trace file based semaphore to control the concurrent access of the trace file. The patch http://review.whamcloud.com/#/c/12809/ is for that. We need to land the http://review.whamcloud.com/#/c/12809/ to master before b2_7 released to avoid compatibility issues in the future. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Gerrit Updater [ 03/Feb/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/12809/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Peter Jones [ 03/Feb/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Landed for 2.7 |