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 |