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

Add option socketKeepAlive to Python driver

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 2.8, 3.0
    • None
    • None
    • centos 6.1

    Description

      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)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: