Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-19043

Check vm.dirty_ratio at client mount time

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • Lustre 2.17.0
    • None
    • None
    • 3
    • 9223372036854775807

      Lustre's writeback support does not work well with vm_dirty_ratio set to 0.  There is ongoing work to resolve this in LU-19014, but in the meantime, we should issue a warning at mount time.

      To prevent potential write performance degradation, the mount utility should verify that the vm.dirty_ratio sysctl setting is configured to a value of 10 or greater. Values below this threshold can cause inefficient write behavior under load. If the value is found to be too low, the utility should issue a warning and suggest the following fix:

       Consider increasing vm.dirty_ratio to at least 10 using:
      sysctl -w vm.dirty_ratio=10

      Sample code to check the value in C:

      int dirty_ratio = 0;
      FILE *fp = fopen("/proc/sys/vm/dirty_ratio", "r");
      if (fp) {
          if (fscanf(fp, "%d", &dirty_ratio) == 1 && dirty_ratio < 10) {
              fprintf(stderr, "Warning: vm.dirty_ratio is set to %d, which may hurt performance\n", dirty_ratio);
              fprintf(stderr, "Consider increasing it to at least 10 using:\n");
              fprintf(stderr, "  sysctl -w vm.dirty_ratio=10\n");
          }
          fclose(fp);
      } 

      This check should be performed during the mount process to alert users before the file system is fully mounted.

            paf0186 Patrick Farrell
            paf0186 Patrick Farrell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: