Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-679

Add option socketKeepAlive to Python driver

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.8, 3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      centos 6.1

      In certain heavily overloaded environments, it is possible to have socket communications undergo timeouts.

      While there are sockettimeout options available in the python driver, setting these very high has downsides for socket availability and recycling, etc.

      To avoid these situations, normal Python socket communications allow for an option of setting a socket option of 'socketKeepAlive', which results in the sending of keep-alive packets that reset the timeout timers on the server side. This is a common practice in heavily loaded applications that transmit large amounts of data and where the CPU of the client may be overloaded for various reasons.

      Setting this option is relatively trivial. Enabling this option involves passing the option through from mongo_client instantiation. Base behavior can be unaffected, since it is an option that only is active when explicitly set.

      Files affected should be:

      • mongo_client.py (pass option thru)
      • pool.py (actually set socket option)
      • common.py (validators)

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            justanyone Kevin J. Rice
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: