Load testing

For load testing EMG, we recommend using our tools emgload and emgsink. These tools provide minimal implementations of various protocols used by EMG, perhaps most importantly SMPP. The emgload tool sends messages over the selected protocol, respecting the given window size not to overflow the network buffers. The emgsink tool sits at the other end, accepting incoming messages and discarding them.

The emgload tool

The emgload tool supports lots of options to configure the behaviour. They are all shown and described by running “emgload --help“. Some best practices are as follows.

  • Traffic generated by emgload should typically be routed to a connector which connects to emgsink. This ensures that it never reaches a real network operator. The user used by emgload should therefore either be one defined in a USERS file, or having the allowpostpaid column set to true.
  • Use the --senders prefix:len and --recipients prefix:len to get random addresses. This is more realistic then using fixed values, and may perform better. By using a prefix not used by any other routing rule in your configuration, the normal EMG routing logic can be tested.
  • Start by setting --threads and --windowsize to 1. These can then be increased slowly, using a sequence such as 1, 2, 4, 10, 20 and so on. The number of threads must be at most as high as the number of instances of the EMG connector that it connects to. Using a window size larger than 10 usually has no positive effect.
  • Use the --duration parameter to set the number of seconds the test should run, instead of trying to find a good value for --messages. This way the test always takes a reasonable amount of time. It also provides a nicer output, using a text version of a “box and whiskers” diagram. Such a diagram shows the minimum, the 25% percentile, the mean, the 75% percentile and the maximum.

The emgsink tool

The emgsink tool accepts all bind and submit requests, returning the appropriate response for “ok”. It has only a few things that can be configured, as shown by “emgsink --help“. The –protocol parameter is mandatory. The number of threads must be at least as high as the number of parallel connections. When using EMG, this is the value of the INSTANCES connector option. You can normally just use 10 threads or so, and keep it running in the background.

Throughput

By default, emgload is restricted to 10 messages per second. When run on a machine with a valid EMG license, it uses the throughput limitation of that license. There is no throughput limitation in emgsink.