Tuning OpenAMQ means ensuring the broker runs without too many interruptions from the operating latency.
First of all you should take your OS into consideration. The OS can schedule other tasks to run instead of OpenAMQ, thus making the latency extremely high at moments. The only way to get worst-case latency guarantees is to use full-blown realtime OS, however, even with a system like Linux you can do several things to to get realtime-like behaviour:
- Recompile your kernel with kernel preemption on (either CONFIG_PREEPT=y or CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT_BKL=y).
- Use such a scheduling policy that gives OpenAMQ priority over other processes (say use round-robin scheduling).
- Lock OpenAMQ into physical memory to avoid page faults.
- Try experimenting with CPU affinities, CPU shielding etc.
Network interface card
You can lower latency by changing the settings of your NIC, if this is allowed.
- If there's a possibility to set max. interrupt rate in your NIC, turn it off for best latency. Interrupts should be issued immediately after data are received.
- Try experimenting with different settings of your NIC and chipsets. Many systems have various "accelerators" for network traffic that may or may not improve the latency.
- Use direct connections instead of switched ones.