danog / MadelineProto

Async PHP client API for the telegram MTProto protocol
https://docs.madelineproto.xyz
GNU Affero General Public License v3.0
2.8k stars 636 forks source link

Memory issue #1370

Closed qwillio-live closed 1 year ago

qwillio-live commented 1 year ago

I'm using library in separate Docker container. When I send request to receive Telegram verification code it shows some jump in CPU usage, when 4-5 sessions are active I can't create new groups, it runs out of memory.

I tried with a server that has 8gb of RAM and each time when add new session it was showing jump in memory. And after adding 5 sessions container crashed with our of memory issue.

Does the library has some limitation on active sessions stored or some requirements about clearing a memory?

danog commented 1 year ago

I heavily recommend using a database like postgres or mysql to reduce memory usage: https://docs.madelineproto.xyz/docs/DOCKER.html, https://docs.madelineproto.xyz/docs/DATABASE.html