Can a Hyper-V machine be made slower and/or emulate a slow network connection

hyper-vnetworkingperformance

I need to reproduce an issue with a client-server asynchronous communication (a bunch of JavaScript AJAX vs. an OData api), seemingly caused by some race condition in the calculations when the server and/or the network connection slow down.

Now, the test environment I have is a local Hyper-V machine, so it's all shiny and fast … I need it to slow down to verify it.

Is there any known method to (basically) make a LAN Hyper-V machine to behave like a remote server reached though a crawling internet connection ?

Best Answer

The best method I have found for simulating a crapy internet connection is to put a pfsense router between the server and my test PC and setup the Limiter features. https://doc.pfsense.org/index.php/Traffic_Shaping_Guide#Limiter

This can be used to emulate a slow network, latency or even introduce packet loss to see how your applications react to adverse network conditions.

pfsense can run inside a hyperv virtual machine. So you can set it up then change the webserver network settings to be behind pfsense.

If you don't like pfsense you can use any BSD distro that supports Dummynet. http://cs.baylor.edu/~donahoo/tools/dummy/tutorial.htm