Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when running a Matterbridge with Wakuv2 #4990

Closed
jakubgs opened this issue Mar 26, 2024 · 9 comments · Fixed by status-im/matterbridge#9
Closed

Memory leak when running a Matterbridge with Wakuv2 #4990

jakubgs opened this issue Mar 26, 2024 · 9 comments · Fixed by status-im/matterbridge#9

Comments

@jakubgs
Copy link
Member

jakubgs commented Mar 26, 2024

Problem

This problem was discovered while working on deployment of our Matterbridge fork developed by @endulab 👍

Despite increasing host size the memory usage keep growing until the host is full and SWAPping starts:

image

This issue is unlikely to be in the Matterbridge code as it's a well established software, and our Waku additions are minimal.

@jakubgs
Copy link
Member Author

jakubgs commented Mar 27, 2024

Granted Michał SSH access to use pperf over SSH:

@endulab
Copy link
Contributor

endulab commented Apr 2, 2024

Created pprof reports.
Already sent to @richard-ramos report with memory used.

Image

@jrainville
Copy link
Member

Could be fixed by #5012

@endulab
Copy link
Contributor

endulab commented Apr 4, 2024

I updated bridge with the latest status-go. Let's see what happens. @jakubgs please update the bridge.

status-im/matterbridge#8

@jakubgs
Copy link
Member Author

jakubgs commented Apr 16, 2024

The port 6060 was not mapped from the container:

jakubgs@node-01.do-ams3.bridge.misc:/docker/matterbridge-community % grep -A5 ports docker-compose.yml
    ports:
      - '4343:4343'

Fixed it manually for now:

jakubgs@node-01.do-ams3.bridge.misc:/docker/matterbridge-community % sudo netstat -lpnt | grep 6060
tcp        0      0 0.0.0.0:6060            0.0.0.0:*               LISTEN      911/dockerd   

It works over SSH tunnel: ssh -N -L 6060:0:6060 node-01.do-ams3.bridge.misc.status.im

 > curl -s 0:6060/debug/pprof/cmdline | cat 
/bin/matterbridge-conf=/config/matterbridge.yaml

@jrainville
Copy link
Member

release/0.177.x now contains #5061
Can we update the bridge to point to 79055f10aac2a0ed97fe022329afcab52dcfcfc6 or the HEAD of release/0.177.x? It should fix the issue.

@endulab
Copy link
Contributor

endulab commented May 6, 2024

@jakubgs I upgraded the bridge. It contains memory issue fix.
Please use again this branch and lets monitor.
FYI @jrainville

@jakubgs
Copy link
Member Author

jakubgs commented May 6, 2024

Thanks. I've built the updated enabling-pprof branch and pushed the image:

jakubgs@node-01.do-ams3.bridge.misc:/docker/matterbridge-community % d
CONTAINER ID   NAMES                    IMAGE                                       CREATED          STATUS
d294d6e741df   matterbridge-community   statusteam/matterbridge:1.26.1-dev-wakuv2   10 seconds ago   Up 8 seconds
fe68655db556   matterbridge-legacy      statusteam/matterbridge:v1.26.0-status      6 weeks ago      Up 10 days

Lets see what happens.

@endulab
Copy link
Contributor

endulab commented May 9, 2024

Last 3 days. Memory consumption on a constant level:

image

I will upgrade wakuv2 branch with a new version of status-go and turn off the profiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants