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

The maximum number of connections is significantly lower than other brokers. #453

Open
xvjialing opened this issue Feb 12, 2025 · 1 comment
Labels
question Further information is requested

Comments

@xvjialing
Copy link

xvjialing commented Feb 12, 2025

emqx能到19万,mochi-mqtt好像到8万左右就直接程序奔溃了

In a standalone setup on the same machine, the maximum number of connections is significantly lower than other brokers.

EMQX can handle up to 190,000 connections, while Mochi-MQTT crashes at around 80,000 connections.

@werbenhu werbenhu changed the title 单机同样机器的情况下,最大连接数比其他broker小很多 The maximum number of connections is significantly lower than other brokers. Feb 13, 2025
@thedevop
Copy link
Collaborator

thedevop commented Feb 25, 2025

@xvjialing , can you check what caused the crash? I suspect it's due to Out Of Memory. I run brokers that handle hundreds of thousands clients without issue, but I have to adjust the server settings appropriate for the instance I use.

There are few settings for the broker that can significantly impacts the memory requirement with large number of connections:

  1. ClientNetReadBufferSize
  2. ClientNetWriteBufferSize
  3. Capabilities.MaximumClientWritesPending (each connection will use 8 bytes * the value set for this), for large number of connections, lower this value significantly from the default. I use 128.
  4. Also if you have long MaximumMessageExpiryInterval and MaximumSessionExpiryInterval, and often publish QOS > 0 messages to subscribers offline, then this can build up large memory usage as well.

Note, there are some here that can read/write Chinese, but many may not. You may receive more responses if you post your question in English.

Thanks @werbenhu for translating the title.

@thedevop thedevop added the question Further information is requested label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants