Molibar
Molibar

Reputation: 885

RabbitMQ doesn't close connections server side

Once a week our RabbitMQ server stops accepting new connections. We discovered this was because of old connections not being properly closed on the server-side. Client-side we close the connections, but in the RabbitMQ Management Studio (the web interface) it reports thousands of open connections.

Why isn't the connections closed automagically? Am I missing some configuration setting? Is this due to how I'm disposing connections on the client-side?

Upvotes: 3

Views: 9179

Answers (1)

Molibar
Molibar

Reputation: 885

Apparently the connection server-side never gets closed if the connection client-side isn't closed properly. The AMQP (Advanced Message Queuing Protocol) used by RabbitMQ makes sure the connection stays open for long running tasks.

The reason for my problem was of course that the connections wasn't properly closed. My solution to this was to fix the destructor in my connection factory, and I also made the connection factory serve a singleton connection instead of creating new ones. I also created a pool for the models (channels). This way I don't have to create more than one connection, and thanks to the model pool I boosted the performance greatly.

Upvotes: 4

Related Questions