Nov 24, 2009

Limiting your Internet connection speed with Fiddler.

In some cases you may need to limit your connection for testing purposes.
This is / should be extremely easy using Fiddler.
Here is a simple walkthrough on how to do this:

1. Go to Fiddler site and download Fiddler latest version (http://www.fiddler2.com/fiddler2/)
2. Install it and start it.
3. Click on Rules -> Customize Rules:

4. An instance of notepad should open. Find the line that says something like "oSession["request-trickle-delay"]":

This setting tells Fiddler how much milliseconds should halt the request. (not quite sure how a request halt will help you though)
5. Find the line that says "oSession["response-trickle-delay"]" and change it:


Save the file.
You should have a connection limitation.
Now, when you want your connections slowed down, you will need to check the following option:

6. Rules -> Performance -> Simulate Modem Speeds (should be checked):


Please do not forget to switch off fiddler when you don't need it as you may find yourself wondering why is your connection significantly slower than usual ;).
Hope it helps someone out there.

6 comments:

SudheerBabu said...

Thanks for the tip, it helped!!

540 said...

If one copies the rules, they can create other speeds which may be useful.

something like
// Cause Fiddler to delay HTTP traffic to simulate typical 56k modem conditions
public static RulesOption("Simulate &Modem speeds", "Per&formance")
var m_SimulateModem: boolean = false;

// Cause Fiddler to delay HTTP traffic to simulate typical 256k dsl conditions
public static RulesOption("Simulate &256k speeds", "Per&formance")
var m_SimulateDSL: boolean = false;

// Cause Fiddler to delay HTTP traffic to simulate typical 256k dsl conditions
public static RulesOption("Simulate &1MB speeds", "Per&formance")
var m_SimulateOneMB: boolean = false;


and then

if (m_SimulateModem){
// Delay sends by 300ms per KB uploaded.
oSession["request-trickle-delay"] = "333";
// Delay receives by 150ms per KB downloaded.
oSession["response-trickle-delay"] = "142";
}
if (m_SimulateDSL){
// Delay sends by 50ms per KB uploaded.
oSession["request-trickle-delay"] = "50";
// Delay receives by 1000ms/(256kbit/8) per KB downloaded.
oSession["response-trickle-delay"] = "31";
}

if (m_SimulateOneMB){
oSession["request-trickle-delay"] = "16";
oSession["response-trickle-delay"] = "8";
}

540 said...

One can add other "speeds" as well. copy the rules related to m_SimulateModem and set something like the following

// Cause Fiddler to delay HTTP traffic to simulate typical 56k modem conditions
public static RulesOption("Simulate &Modem speeds", "Per&formance")
var m_SimulateModem: boolean = false;

// Cause Fiddler to delay HTTP traffic to simulate typical 256k dsl conditions
public static RulesOption("Simulate &256k speeds", "Per&formance")
var m_SimulateDSL: boolean = false;

// Cause Fiddler to delay HTTP traffic to simulate typical 256k dsl conditions
public static RulesOption("Simulate &1MB speeds", "Per&formance")
var m_SimulateOneMB: boolean = false;

and then



if (m_SimulateModem){
// Delay sends by 300ms per KB uploaded.
oSession["request-trickle-delay"] = "333";
// Delay receives by 150ms per KB downloaded.
oSession["response-trickle-delay"] = "142";
}
if (m_SimulateDSL){
// Delay sends by 50ms per KB uploaded.
oSession["request-trickle-delay"] = "50";
// Delay receives by 1000ms/(256kbit/8) per KB downloaded.
oSession["response-trickle-delay"] = "31";
}

if (m_SimulateOneMB){
oSession["request-trickle-delay"] = "16";
oSession["response-trickle-delay"] = "8";
}

Vast said...

It allow us to have 2Mbps of download speed and 1Mbps of upload speed if to set like:
// Cause Fiddler to delay HTTP traffic to simulate typical 1MB dsl conditions
public static RulesOption("Simulate &1MB speeds", "Per&formance")
var m_SimulateOneMB: boolean = false;

if (m_SimulateOneMB){
oSession["request-trickle-delay"] = "16";
oSession["response-trickle-delay"] = "8";
}
----------------------------

To emulate maximum 1Mbps of download & 1Mbps of upload speed :

// Cause Fiddler to delay HTTP traffic to simulate typical 1MB dsl conditions
public static RulesOption("Simulate &1MB speeds", "Per&formance")
var m_SimulateOneMB: boolean = false;

if (m_SimulateOneMB){
oSession["request-trickle-delay"] = "16";
oSession["response-trickle-delay"] = "16";
}

Anonymous said...

I know this is an old post but is there anyway to tweak the rule to only filter for a specific browser. I would like to have my streaming music, and be able to simulate slower speeds :)

learnerplates said...

nice one. works for me. thanks.