#1 2014-03-28 17:10:39

foncci
Member
Registered: 2013-11-15
Posts: 53

How to simulate a low speed network locally in my laptop

I would like to simulate the delay of a wan network locally. This is my issue, I have several mORMot services in different branches talking to each others. I have some exceptions that I described in another post but when I do a simulation with the same data locally in my laptop, there are no such exceptions. It is impossible to install delphi and debug in those branches and my idea so far is that exceptions are due to the low speed of the internet connection. So any idea about that simulation?

Offline

#2 2014-03-28 17:32:11

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: How to simulate a low speed network locally in my laptop

You can for instance add a Sleep(500) on the client side:

procedure TSQLHttpClientGeneric.InternalURI(var Call: TSQLRestURIParams);
 ...
 Sleep(500); // or 100 or 200 or 1000 or 1500 or 2500
end;
 

Offline

#3 2014-03-29 14:15:08

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: How to simulate a low speed network locally in my laptop

see this new feature - http://synopse.info/forum/viewtopic.php … 103#p10103 (after AB commit patch you can try to use MaxBandwidth)
Also I use http://www.telerik.com/fiddler as a proxy - it allow to limit speed (actually in the same way AB said above - insert a timeout), but you do not need to recompile your sources

Offline

#4 2014-03-29 15:58:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: How to simulate a low speed network locally in my laptop

We have added THttpApiServer.MaxBandwidth and THttpApiServer.MaxConnections properties (for HTTP API 2.0 only)...
See http://synopse.info/fossil/info/4e61734d33

Thanks mpv for the proposal and code patch!
smile

Offline

Board footer

Powered by FluxBB