in reply to Perl http daemon with network delay

On Linux, you can do that at the kernel level, we use that feature frequently for testing purposes. I don't know the details, other than it is configured with the tc utility.

Reading the Linux Traffic Control HOWTO may help.

Replies are listed 'Best First'.
Re^2: Perl http daemon with network delay
by danmihai (Initiate) on Aug 26, 2010 at 12:46 UTC
    This can also be achieved by making webserver from netcat and use the "-i" option. The problem with these methods is the portability to various platforms
      The problem with these methods is the portability to various platforms

      Well, you said it was for a testing environment, so I suppose you want to run your application on several boxes with different operative systems in an environment of your own.

      In that case, the non-portability of my proposed solution shouldn't be a problem because you can run the web servers and the traffic shaper on different machines.

      Actually we just do that, we have a Linux box where we run the traffic shaper and via NAT we redirect some ports to other servers in the same LAN. We can connect directly to the servers or through the shaper and compare the results.