juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
194 stars 111 forks source link

SocketQueue Performance/Benchmark #20

Closed indper closed 6 years ago

indper commented 6 years ago

Hi Igor,

Could you share the performance of SocketQueue in production? I still have a problem about TCP Socket performance for concurrent transaction (low response per second, low CPU & RAM usage).

Thank you..

juks commented 6 years ago

Hi Indper!

The answer for your question is to be found just like this:

nodejs socketQueue.js --upstreamHost=localhost --upstreamPort=5000 --listenPort=2014 --vv --echoServerPort=5000 --testTargetHost=localhost --testTargetPort=2014 --testClients=1000 --maxQueue=1000

:-)

juks commented 6 years ago

What i wanted to say is 1000 simultaneous clients/connections, processing transactions is not a big deal.

indper commented 6 years ago

Benchmark result: i3 core, 4G, echo message ab -p test.json -T application/json -c 1000 -n 10000 http://10.107.11.111:2014/ This is ApacheBench, Version 2.3 <$Revision: 1528965 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.107.11.111 (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requests

Server Software: Server Hostname: 10.107.11.111 Server Port: 2014

Document Path: / Document Length: 139 bytes

Concurrency Level: 1000 Time taken for tests: 54.880 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 2670000 bytes Total body sent: 2530000 HTML transferred: 1390000 bytes Requests per second: 182.21 [#/sec] (mean) Time per request: 5488.049 [ms] (mean) Time per request: 5.488 [ms] (mean, across all concurrent requests) Transfer rate: 47.51 [Kbytes/sec] received 45.02 kb/s sent 92.53 kb/s total

Connection Times (ms) min mean[+/-sd] median max Connect: 0 146 574.0 0 3012 Processing: 316 5184 1067.7 5522 5946 Waiting: 311 5183 1067.6 5521 5945 Total: 340 5331 1095.9 5547 8756

Percentage of the requests served within a certain time (ms) 50% 5547 66% 5655 75% 5834 80% 5868 90% 5907 95% 5933 98% 7653 99% 8221 100% 8756 (longest request)

I think your gateway is very fast. Currently, I develop a JSON to ISO gateway using express, bull (Queue) and your ISO8583 convertion but it still doesn't reach 10 RPS. Please give me an advice to maximize socket performance. Thanks

juks commented 6 years ago

Hi!

Your test seem to produce no actual load on the server, only new connections. Not a big deal.

There is no perfomance secret: just plain JS, no blocking operations, few timers, event driven.

indper commented 6 years ago

ok thank you very much