THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

Simulating High Latency and Low Bandwidth in Testing of Database Applications

High latency and low bandwidth can cause all kinds of problems. A few years ago, I was on a project experiencing difficulties with SQL Server replication over a satellite link. Many retail outlets use satellite links to communicate with corporate data centers. Offshore drilling rigs almost exclusively use satellites for communication. I frequently talk about the need for test environments to be both valid and complete. If your test environment is complete with all of the servers and client applications in place, it's not a valid environment until it matches the network characteristics of the real world instead of the test lab.

Communication satellites are in geostationary orbits about 35,790 km above the earth. A signal must travel from the earth to the satellite and back to earth covering a total distance of approximately 71,580 km while traveling at the speed of light (299,792,458 meters/sec). This introduces a one way latency of 419 milliseconds. A round trip, such as a ping, has a latency of at least 838 milliseconds.

To simulate satellite latency in my test environment, I used a product from www.shunra.com called VE Desktop. It is a simple to use application providing programmatic tweaks to the network adapter. I installed it in a Hyper-V virtual machine running 32 bit Windows XP SP3.

ShunraAdvancedTest

A ping from a client machine to a server was done to establish a baseline before starting the Shunra VE Desktop software.

C:\>ping w2008x64

Pinging w2008x64 [169.254.114.53] with 32 bytes of data:

Reply from 169.254.114.53: bytes=32 time<1ms TTL=128
Reply from 169.254.114.53: bytes=32 time<1ms TTL=128
Reply from 169.254.114.53: bytes=32 time<1ms TTL=128
Reply from 169.254.114.53: bytes=32 time<1ms TTL=128

Ping statistics for 169.254.114.53:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Next, a latency of 419 msec was introduced by clicking the Begin Test button. Another ping was done.

C:\>ping w2008x64

Pinging w2008x64 [169.254.114.53] with 32 bytes of data:

Reply from 169.254.114.53: bytes=32 time=843ms TTL=128
Reply from 169.254.114.53: bytes=32 time=833ms TTL=128
Reply from 169.254.114.53: bytes=32 time=819ms TTL=128
Reply from 169.254.114.53: bytes=32 time=828ms TTL=128

Ping statistics for 169.254.114.53:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 819ms, Maximum = 843ms, Average = 830ms

Test results are more meaningful when test conditions match the real world as closely as possible. The VE Desktop product can even introduce packet loss into your testing scenarios. Shunra also has a hardware based product with additional features.

Published Sunday, April 13, 2008 5:27 PM by John Paul Cook

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

jchang said:

rather than simulate network high latency, ie, endure the actual pain end users endure

I prefer to just examine the network round-trip count,

that is, all transmits that must be acknowledge before preceeding. which implies multiple transmits acknowledged by a single reply is not that big a problem

also look for application that get 1 row at a time, or do have SET NOCOUNT ON in the procedures with multiple steps

and look for ways to compress large data sets

April 17, 2008 12:10 PM
 

sdelmore said:

I like simulating latency as well.  I have found that increasing latency reduces overall throughput but in high latency scenarios tweaking the packet size can have large benefits as can opening multiple concurrent connections as SQL Server has a hard time using the available bandwidth in high latency environments.  There is probably gains to be had in tweaking the TCP/IP settings as well but I have not yet finished my testing in that area.

August 11, 2010 3:12 PM
 

Gustavo Varela said:

We were testing a trial version of VE desktop (for xp) in order to test emulate satelite link but we cannot place more than 200 ms of delay. We couldnt contact a dealer of this application. Can you help us?

November 13, 2013 4:42 PM

Leave a Comment

(required) 
(required) 
Submit

About John Paul Cook

John Paul Cook is a Technology Solution Professional for Microsoft's data platform and works out of Microsoft's Houston office. Prior to joining Microsoft, he was a Microsoft SQL Server MVP. He is experienced in Microsoft SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. John is also a Registered Nurse who graduated from Vanderbilt University with a Master of Science in Nursing Informatics and is an active member of the Sigma Theta Tau nursing honor society. He volunteers as a nurse at safety net clinics. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2.

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement