Core Server
  1. Core Server
  2. SERVER-4407

Log warnings on startup if (hard) rlimits are no good

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor - P4 Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.2
    • Component/s: Logging
    • Labels:
      None
    • Backport:
      No
    • # Replies:
      5
    • Last comment by Customer:
      true

      Description

      Some Linux distros have unusably low limits for things like number of processes or file descriptors. It would be handy if we checked the rlimits on startup and complained if the limits were too low for typical MongoDB uses.

        Issue Links

          Activity

          Hide
          auto
          added a comment -

          Author:

          {u'login': u'matulef', u'name': u'Kevin Matulef', u'email': u'matulef@gmail.com'}

          Message: SERVER-4407 check rlimits on startup
          Branch: master
          https://github.com/mongodb/mongo/commit/2fa3f79aeb5185053541be4e1412bcf97399c6dc

          Show
          auto
          added a comment - Author: {u'login': u'matulef', u'name': u'Kevin Matulef', u'email': u'matulef@gmail.com'} Message: SERVER-4407 check rlimits on startup Branch: master https://github.com/mongodb/mongo/commit/2fa3f79aeb5185053541be4e1412bcf97399c6dc
          Hide
          Richard Kreuter
          added a comment -

          The rlimit warnings are being printed at the beginning of main(), before argument parsing and logpath setup, and so (a) they're cluttering up the --version output, and, more importantly (b) they won't end up in the user's log file. Cf.

          $ ./mongod --logpath /tmp/log --fork
          Thu Feb 9 17:20:52 Warning: soft rlimits too low. Number of files is 256, should be at least 1000
          forked process: 10729
          all output going to: /tmp/log
          log file [/tmp/log] exists; copied to temporary file [/tmp/log.2012-02-09T22-20-52]
          child process started successfully, parent exiting

          Show
          Richard Kreuter
          added a comment - The rlimit warnings are being printed at the beginning of main(), before argument parsing and logpath setup, and so (a) they're cluttering up the --version output, and, more importantly (b) they won't end up in the user's log file. Cf. $ ./mongod --logpath /tmp/log --fork Thu Feb 9 17:20:52 Warning: soft rlimits too low. Number of files is 256, should be at least 1000 forked process: 10729 all output going to: /tmp/log log file [/tmp/log] exists; copied to temporary file [/tmp/log.2012-02-09T22-20-52] child process started successfully, parent exiting
          Hide
          Richard Kreuter
          added a comment -

          Please add a test for this. Something like

          ulimit <something low>
          mongod --logpath <path to log>
          <check for startup warnings or something>

          Show
          Richard Kreuter
          added a comment - Please add a test for this. Something like ulimit <something low> mongod --logpath <path to log> <check for startup warnings or something>
          Hide
          auto
          added a comment -

          Author:

          {u'login': u'matulef', u'name': u'Kevin Matulef', u'email': u'matulef@gmail.com'}

          Message: SERVER-4407 moved rlimit check to better place
          Branch: master
          https://github.com/mongodb/mongo/commit/f729d0c69bbaae99c38d56e8711c3ca9acb5c8c9

          Show
          auto
          added a comment - Author: {u'login': u'matulef', u'name': u'Kevin Matulef', u'email': u'matulef@gmail.com'} Message: SERVER-4407 moved rlimit check to better place Branch: master https://github.com/mongodb/mongo/commit/f729d0c69bbaae99c38d56e8711c3ca9acb5c8c9
          Hide
          Kevin Matulef
          added a comment -

          I moved the rlimit check so that it happens in a much saner place, along with other checks that happen at startup. However, the check is currently only performed on certain platforms. I need to do some research to figure out how to perform the check on the other platforms (i.e. windows), so I'm leaving this ticket open for now, but will reschedule it for the next version.

          Show
          Kevin Matulef
          added a comment - I moved the rlimit check so that it happens in a much saner place, along with other checks that happen at startup. However, the check is currently only performed on certain platforms. I need to do some research to figure out how to perform the check on the other platforms (i.e. windows), so I'm leaving this ticket open for now, but will reschedule it for the next version.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 6 weeks, 4 days ago
                Date of 1st Reply: