Uploaded image for project: 'Couchbase Go SDK'
  1. Couchbase Go SDK
  2. GOCBC-1435

SDK demonstrates high memory usage and a possibility of memory leaks

    XMLWordPrintable

Details

    • Bug
    • Resolution: User Error
    • Major
    • None
    • 2.6.1
    • testing
    • 0

    Description

      Sirius is a Rest-based document loader written in GO for Couchbase-Server and utilizes the Go Couchbase SDK. 

      The Go SDK exhibit high memory usage and the possibility of memory leaks. We have performed memory profiling using pprof.

      System Architecture on which profiled:-

      {{root@sd3605-deb10:~/workspace/sirius# lscpu
      Architecture:        x86_64
      CPU op-mode(s):      32-bit, 64-bit
      Byte Order:          Little Endian
      Address sizes:       46 bits physical, 48 bits virtual
      CPU(s):              8
      On-line CPU(s) list: 0-7
      Thread(s) per core:  8
      Core(s) per socket:  1
      Socket(s):           1
      NUMA node(s):        1
      Vendor ID:           GenuineIntel
      CPU family:          6
      Model:               85
      Model name:          Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz
      Stepping:            7
      CPU MHz:             2095.144
      BogoMIPS:            4190.28
      Hypervisor vendor:   Xen
      Virtualization type: full
      L1d cache:           32K
      L1i cache:           32K
      L2 cache:            1024K
      L3 cache:            28160K
      NUMA node0 CPU(s):   0-7}}

      root@sd3605-deb10:~/workspace/sirius# free -h
                    total        used        free      shared  buff/cache   available
      Mem:           11Gi       1.3Gi        10Gi        33Mi       260Mi        10Gi
      Swap:         4.1Gi       2.2Gi       1.9Gi

      We have observed that gocbcore (*memdPipelineClient)  takes over 95% of the total memory, making Sirius out of memory and kernel kills it.

      In the logs shared :-  gocbcore (*memdPipelineClient) taking upto 5.74222826958 GB of memory indicating higher usage.

      Please have a look and cross check with the observations.

      Console Log -  https://drive.google.com/file/d/1bWXMpWc43H3EfLipmGokIJ10P63GO-cp/view?usp=drive_link

      Steps to Reproduce:-
      1. Git clone Sirius .
      2. Go through the README.md, install dependencies.
      3. Use https://github.com/couchbaselabs/sirius/tree/profiling_services_in_sirius for profiling.
      4. Sirius uses 4000 port for doc loading and 6060 for profiling.
      5. Sample curl command :-

      curl --location 'localhost:4000/bulk-create' \
      --header 'Content-Type: application/json' \
      --data '{
      "identifierToken": "manik_test_1",
      "clusterConfig":{ "username": "Administrator", "password": "password", "connectionString": " [couchbase://172.23.136.130] " },
      "bucket": "default",
      "operationConfig":{ "count": 100, "keySize": 512, "docSize": 256 },
      "insertOptions":{ "timeout": 5 }}'

      6. Repeat multiple different doc loading operation to reproduce the behaviour using different [REST Endpoints|https://github.com/couchbaselabs/sirius/blob/profiling_services_in_sirius/task-config.generated.md]
      7. Example of payload and routes :- https://documenter.getpostman.com/view/25450208/2s93sdXWeB 
      8. Use pprof tool to download heap profile for while performing different doc loading operations.

      go tool pprof http://localhost:6060/debug/pprof/heap

       

      Attachments

        1. pprof_doc.pdf
          179 kB
        2. pprof001.svg
          52 kB
        3. profile001.png
          profile001.png
          273 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            charles.dixon Charles Dixon
            manik.mahajan Manik Mahajan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty