We have migrated our Tibco EMS infrastructure from the older Sun V490 servers to the newer HP ProLiant DL380 G7 servers. One of the concerns was how does the new servers perform under load compared with the older servers. I needed to create a load test that compared the performance of the two different types of servers. I turned to Clojure to help me put together this load test and here is the load test code:
Load Test Script in Clojure
; Leveraging Apache Commons to generate the random message
(def msg64 (RandomStringUtils/randomAlphanumeric 64))
(def msg128 (RandomStringUtils/randomAlphanumeric 128))
(def msg256 (RandomStringUtils/randomAlphanumeric 256))
(def msg64k (RandomStringUtils/randomAlphanumeric (* 64 1024)))
(def msg128k (RandomStringUtils/randomAlphanumeric (* 128 1024)))
(def msg256k (RandomStringUtils/randomAlphanumeric (* 256 1024)))
(def msg512k (RandomStringUtils/randomAlphanumeric (* 512 1024)))
(def msg1mb (RandomStringUtils/randomAlphanumeric (* 1024 1024)))
(def persistent-delivery (.intValue (javax.jms.DeliveryMode/PERSISTENT)))
; Send messages
(defn send-messages [server-url user password queue-name data iterations]
(with-open [connection (-> (TibjmsQueueConnectionFactory. server-url)
(.createQueueConnection user password))]
(let [session (.createQueueSession connection false Session/AUTO_ACKNOWLEDGE)
queue (.createQueue session queue-name)]
(with-open [sender (.createSender session queue)]
(dotimes [_ iterations]
(let [message (.createTextMessage session)]
(.setJMSDeliveryMode message persistent-delivery)
(.setText message data)
(.send sender message)))))))
(def test-scenarios (list
{:label "64 bytes" :msg msg64 :n 5000 }
{:label "128 bytes" :msg msg128 :n 5000 }
{:label "256 bytes" :msg msg256 :n 5000 }
{:label "64KB bytes" :msg msg64k :n 2000 }
{:label "128KB bytes" :msg msg128k :n 1000 }
{:label "256KB bytes" :msg msg256k :n 1000 }
{:label "512KB bytes" :msg msg512k :n 1000 }
{:label "1MB bytes" :msg msg1mb :n 1000 }))
(doseq [my-test test-scenarios]
(let [label (:label my-test)
message (:msg my-test)
n (:n my-test)]
(println "\n\n")
(println (str "Testing for " label " sized messages with n = " n))
(time (send-messages server-url username password test-queue message n))))
Here's the message consumer part of the load test:
Message Consumer in Clojure
; Consume Queue Text messages asynchronously
(defn get-queue-text-messages [server-url user password queue-name process-message]
(future
(with-open [connection (-> (TibjmsQueueConnectionFactory. server-url)
(.createQueueConnection user password))]
(let [session (.createQueueSession connection false Session/AUTO_ACKNOWLEDGE)
queue (.createQueue session queue-name)]
(with-open [receiver (.createReceiver session queue)]
(.start connection)
(loop [acc 0]
(process-message (.receive receiver) acc)
(recur (+ acc 1))))))))
; Dump just the message id
(defn dump-message-id [message n]
(println (str n)))
; Create function aliases with connection information embedded
(defn consume-messages [queue-name message-processor]
(get-queue-text-messages server-url username password queue-name message-processor))
; Start consuming messages asynchronously
(consume-messages queueName dump-message-id)
Here are the test results:
Load Test Result on Sun V490
| Message Size | Number of Messages | Process Time (ms) | Throughput (msg/s) | Throughput (MB/s) |
|---|---|---|---|---|
| 64 | 5,000 | 2,772.84 | 1,803.21 | 0.11 |
| 128 | 5,000 | 1,943.23 | 2,573.04 | 0.31 |
| 256 | 5,000 | 1,899.24 | 2,632.63 | 0.64 |
| 64K | 1,000 | 3,020.98 | 331.02 | 20.69 |
| 128K | 1,000 | 4,414.00 | 226.55 | 28.32 |
| 256K | 1,000 | 20,911.61 | 47.82 | 11.96 |
| 512K | 1,000 | 39,213.23 | 25.50 | 12.75 |
| 1MB | 1,000 | 80,337.55 | 12.45 | 12.45 |
Load Test Result on HP ProLiant DL380 G7
| Message Size | Number of Messages | Process Time (ms) | Throughput (msg/s) | Throughput (MB/s) |
|---|---|---|---|---|
| 64 | 5,000 | 1,340.22 | 3,730.74 | 0.23 |
| 128 | 5,000 | 1,345.18 | 3,716.99 | 0.45 |
| 256 | 5,000 | 1,040.59 | 4,804.95 | 1.17 |
| 64K | 1,000 | 2,178.69 | 458.99 | 28.69 |
| 128K | 1,000 | 3,553.02 | 281.45 | 35.18 |
| 256K | 1,000 | 7,490.54 | 133.50 | 33.38 |
| 512K | 1,000 | 35,078.26 | 28.51 | 14.25 |
| 1MB | 1,000 | 77,076.51 | 12.97 | 12.97 |
From this test result, we can conclude that HP ProLiant DL380 G7 performed better than Sun V490 under load.





