devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
831 stars 254 forks source link

how to delete in-active session, as my memory storage is getting full and k8's pod getting evicted. #197

Closed khushboo-scogo closed 3 weeks ago

khushboo-scogo commented 10 months ago

hey @allburov , I am using the plus version and running my container on k8's pod. After some hours, the memory gets full and the pod gets evicted. I have already increased the memory for the pod. But it gets full eventually. This makes Apis slow and takes time to get a response. As the pod gets evicted, it exits all sessions. How should I manage this? How can I get in-active or unused sessions and delete them and free up the space. Guide me on this please!

Thanks in advance

allburov commented 10 months ago

How much memory size we're talking about? How much sessions do you run? Is there any graphs may be with memory consumption.

allburov commented 10 months ago

If you stop sessions with /stop endpoint it releases memory immediately

khushboo-scogo commented 10 months ago

hey @allburov , so this is the memory consumption of my pod just after some sessions. image This is the total size of .session/webjs folder. image whats the solution for this?? sessions folder itself is taking all the memory. Eventually pod gets slow and evicts after some duration. Please guide me on this??

khushboo-scogo commented 10 months ago

Getting one more issue in core version, after qr event, authenticate event is not getting triggered. image I have scanned the qr but getting its status is in scan qr state image

whats the issue???

allburov commented 10 months ago

I have scanned the qr but getting its status is in scan qr state

The issue about SCAN_QR_CODE, working on that https://github.com/devlikeapro/whatsapp-http-api/issues/199

whats the solution for this??

Could you explain a bit more your case - how does the session folder affect RAM? It must not if you run it right and map .sessions to host's folder

this is the memory consumption of my pod just after some sessions.

How much exactly sessions do you run?

sessions folder itself is taking all the memory.

If I get the screenshot right, it's 670000 bytes ~ 0.67mb, shouldn't be a problem even if you put it in RAM.

allburov commented 10 months ago

Remember that WEBJ engine runs chromium instance under the hood for each session. it uses puppeter to work with that (which also have memory leak) May it's the issue here.

If you want to run more then few sessions - we'd recommend using NOWEB engine - it works via websockets and doesn't run chromium under the hood.

allburov commented 10 months ago

whats the issue???

⚠️ New version 2023.9.7 is out (both core and plus). If you're experiencing any issues with SCAN_QR state or sending messages doesn't work - please update it, restart containers and try try again!

devlikepro commented 3 weeks ago

Hi! Let us know if you're expereicing issue with latest version, it's been improved a lot sine 2023.9

patron:PRO