I have an application that spins up a lot threads. Each thread submits the same message type via masstransit / rabbitmq. I've created a singleton to store one instance of IBus. The application only publishes messages so no endpoints are in the configuration.
Is a singleton message bus the correct thing to do when only publishing? I did performance testing by setting up a loop to constantly publish a message. When running just one thread 52000 messages where added to the queue in 60 seconds. When 5 threads where run, each doing the same loop, only 8000 messages where added to the queue in 60 seconds.
Why when running 5 threads is the performance much worse? Should each thread have its own bus instance?