Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8049

Very short timeout for select() call in net listener eats up CPU time

    • Fully Compatible
    • ALL
    • Hide

      Run strace on idle mongod - see 100 select() calls each second. Top will show CPU usage.

      Show
      Run strace on idle mongod - see 100 select() calls each second. Top will show CPU usage.

      The select() call at src/mongo/util/net/listen.cpp:218 is made with a timeout of 10ms, which is unnecessarily small, and, on one of my machines, results in a constant CPU consumption of >1% when mongod is sitting idle.

      Eliminate the timeout altogether: just pass NULL and let select() block until something happens. The timeout specified here is unnecessary, as a timeout simply results in select() being called again.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jcalvinowens Calvin Owens
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: