Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1106

Memory leaks seen while using python 3 SDK while running the system tests using Gideon

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 3.0.6, 3.0.10
    • None
    • None
    • 1

    Description

      While running the server system tests, we noticed that the updated gideon tool(a data loading tool) was leaking a lot of memory. Upon investigation, we see that the cause of the leaks are the python 3 couchbase SDK.
      Steps to reproduce the issue:
      1. Create a 7.0 cluster and create a bucket (default) in it. Create a scope (test) and collection (coll0) in the bucket.
      2. Clone https://github.com/bharath-gp/gideon.git on to a client machine with python 3. Install required dependencies using pip install (pip install pyyaml gevent requests eventlet httplib2 couchbase) (alternatively this can be run using a docker container by pulling the image from sequoiatools/gideon2:tracemalloc)
      4. Run gideon data loader with following command:
      python gideon.py kv --ops 1000 --create 80 --delete 20 --get 82 --sizes 64 96 --expire 100 --ttl 3600 --hosts <cluster-ip> --bucket default --scope test --collection coll0
      5. Let the script run for few minutes. Observe the memory consumption of the top modules that's consuming the most memory (this gets printed onto the console by the script using tracemalloc)

      We have seen that the memory consumption of the couchbase sdk calls keep increasing in a linear fashion and gets to enormous amounts pretty quickly. This is blocking the system testing of couchbase-server since the machines eventually runs out of memory.

      Note that the same script when run against python 2 sdk, runs without any memory leaks. The only difference between python 2 and python 3 scripts is the added support for collections and using the latest python sdk. The python 2 scripts can be found at https://github.com/couchbaselabs/gideon

      Attaching the logs from 2 of the runs we did with the python 3 script mentioned above.

      Attachments

        1. asyncio_20cycles_consumer.log
          16 kB
        2. asyncio_20cycles_tracemalloc.txt
          32 kB
        3. gideon2_1.log
          297 kB
        4. gideon2-2.log
          482 kB
        5. multi_20cycles_consumer.log
          13 kB
        6. multi_20cycles_tracemalloc.txt
          33 kB
        7. simple_example_async.py
          14 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jared.casey Jared Casey
            bharath.gp Bharath G P
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty