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

XMLWordPrintableJSON

    • 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.
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
              Reporter:
              Calvin Owens
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: