The MockServer is build to support massive scale from a single instance. The following frameworks / tools are used to maximise scalability:

  • Netty an asynchronous event-driven network application framework to maximise the scalability of HTTP and TLS
  • LMAX Disruptor a high performance inter-thread messaging library to maximise the scalability of recording events (i.e. state) and logging
  • ScheduledThreadPoolExecutor a thread pool that can scheduled delayed tasks is used to execute delay response to avoid blocking threads

The MockServer has been performance tested using locust using the following scenario:

  • four basic expectations, including method, path and headers
  • basic GET request matching third expectation (i.e. three matches are attempted for each request)

The code for the performance test is in github in mockserver-performance-test.

The results are as follows:

req/s Min Avg Max 50% 66% 75% 80% 90% 95% 98% 99% 100%
50 1 2 12 2 3 3 3 3 4 5 5 12
99 0 4 18 3 4 5 5 6 7 8 9 18
496 0 7 65 6 7 9 10 12 15 19 22 65
995 0 20 236 6 13 19 25 57 97 140 160 240
1243 0 113 434 110 140 160 170 210 250 290 300 430