开发者

Factors Affected for Low Performance of middleware Messaging Softwares

开发者 https://www.devze.com 2023-04-05 04:29 出处:网络
I am planning开发者_开发百科 to inegrate messaging middleware in my web application. Right now I am tesing different messaging middleware software like RabbitMQ,JMS, HornetQ, etc..

I am planning开发者_开发百科 to inegrate messaging middleware in my web application. Right now I am tesing different messaging middleware software like RabbitMQ,JMS, HornetQ, etc.. Examples provided with this softwares are working but its not giving as desired results.

So, I want to know that which are the factors which are responsible to improve peformance that one should keep in eyes?

Which are the areas, a developer should take care of to improve the performance of middleware messaging software?


I'm the project lead for HornetQ but I will try to give you a generic answer that could be applied to any message system you choose.

A common question that I see is people asking why a single producer / single consumer won't give you the expected performance.

When you send a message, and are asking confirmation right away, you need to wait:

  • The message transfer from client to server
  • The message being persisted on the disk
  • The server acknowledging receipt of the message by sending a callback to the client

Similarly when you are receiving a message, you ACK to the server:

  • The ACK is sent from client to server
  • The ACK is persisted
  • The server sends back a callback saying that the callback was achieved

And if you need confirmation for all your message-sends and mesage-acks you need to wait these steps as you have a hardware involved on persisting the disk and sending bits on the network.

Message Systems will try to scale up with many producers and many consumers. That is if many are producing they should all use the resources available at the server shared for all the consumers.

There are ways to speed up a single producer or single consumer:

  • One is by using transactions. So, you minimize the blocks and syncs you perform on disk while persisting at the server and roundtrips on the network. (This is actually the same on any database)

  • Another one, is by using Callbacks instead of blocking at the consumer. (JMS 2 is proposing a Callback similar to the ConfirmationHandler on HornetQ).

Also: most providers I know will have a performance section on their docs with requirements and suggestions for that specific product. You should look individually at each product

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号