2011. 9. 3. 01:16

[Performance test 성능 테스트] Redis vs. ActiveMQ Pub/Sub

Sent 200 messages using 2 threads.
두 개의 쓰레드를 사용하여 200개의 메시지 전송 
The size of each message is approximately 500 bytes.
각 메시지의 크기는 약 500 바이트 
Used configuration of Spring.
스프링 설정을 사용

Message producer, Redis & ActiveMQ and message consumer are located on different computers.
메시지 보내는 어플리케이션, Redis 와 ActiveMQ, 메시지 받는 어플리케이션은 다른 컴퓨터에 위치함
Consumer doesn't work concurrently.
메시지 받는 어플리케이션은 동시에 여러 개 동작하지 않습니다. 한 메시지 처리하고 다른 메시지를 처리함.

In my test, ActiveMQ works twice faster than Redis.
제 테스트에서 ActiveMQ 가 2배 정도 Redis 보다 빠름
2 * t(sending to ActiveMQ + getting from ActiveMQ + consumer logic) = t(sending to Redis + getting from Redis + consumer logic)
2 * (ActiveMQ 로 데이터를 보내고 받는 시간 + 메시지 처리시간) = t(Redis 로 데이터를 보내고 받는 시간 + 메시지 처리 시간)

Moved producer, Redis, ActiveMQ, and consumer to same machine to reduce the effect of network speed. 
네트워크 속도의 영향을 줄이기 위해 메시지를 보내고 받는 어플리케이션, Redis, ActiveMQ를 같은 머신에서 실행시켰습니다.
In this case, ActiveMQ works 5 times faster than Redis.
이 경우 ActiveMQ가 Redis보다 5배 빨랐습니다.

Using push/pop of Redis is 5 times faster than ActiveMQ.
Redis 의 push/pop을 사용하면 ActiveMQ 보다 5배쯤 빠릅니다.

Tried to use topic instead of q in ActiveMQ.
ActiveMQ 에서 큐 대신 토픽 사용.
Test using topic is twice faster than test using q.
토픽을 사용한 테스트가 큐를 사용한 테스트에 비해 2배 쯤 빠름

In result, performance: Redis q > ActiveMQ pub/sub > ActivqMQ q > Redis pub/sub
결론적으로 성능은 Redis q > ActiveMQ pub/sub > ActiveMQ q > Redis pub/sub

I'll try to test using large message
대용량 메시지 테스트를 하려고 합니다