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

Goroutines use a lot of RAM memory after this error #602

Open
hunsky14 opened this issue May 31, 2024 · 2 comments
Open

Goroutines use a lot of RAM memory after this error #602

hunsky14 opened this issue May 31, 2024 · 2 comments

Comments

@hunsky14
Copy link

There are thousands of logs like this

I send thousands of messages a day, but some messages give an error like this, one attempt to send a message can generate tens of thousands of goroutines that do not close and take up RAM memory, so I have to restart server to clear goroutines

Pls help, how can I solve this RAM memory usage?

11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.406 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.407 [Client WARN] Handler queue is full, message ordering is no longer guaranteed
11:16:36.408 [Client WARN] Handler queue is full, message ordering is no longer guaranteed

@a5r0n
Copy link

a5r0n commented Jun 13, 2024

One of your event handlers is likely to respond too slow

@SoursopID
Copy link

From what I can see in the log timestamp, the log lines differ by almost only 1 ms or even less. I believe that currently, you are running goroutines without any limits (max workers). When you run the client after it has been turned off for a while, many incoming messages are processed almost simultaneously without delay, filling up the goroutine queue.

You need to set a maximum limit on the number of goroutines running in the event handler that you added to client.AddEventHandler(), manage it by your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants