bandwidth and traffic simulator for web apps?

后端 未结 13 1306
后悔当初
后悔当初 2021-02-04 08:57

Can you suggest how to create a test environment to simulate various types of bandwidths and traffic in a web app?

Or maybe an open source program which does this against

13条回答
  •  余生分开走
    2021-02-04 09:22

    If you are running a Linux box as your server, Linux box as your client, or have the capability to put (perhaps a VM) a Linux router between your client and server, you can use NetEm.

    NetEm is a Linux TC (Traffic Control) discipline which can delay (i.e. add latency) packets leaving a host. Although it's tricky to set up clever rules (e.g. add latency to some traffic, not to others), it's easy to add a simple "delay everything leaving the interface by 50ms" type rules and some recipes are provided.

    By sticking a Linux VM between your client and server, you can simulate as much latency as you like. And you can turn it on and off dynamically. Linux has other TC disciplines which can be combined with NetEm to restrict bandwidth (but the script to set this up can be somewhat complicated). NetEm can also randomly drop packets.

    I use it and it works a treat :)

提交回复
热议问题