2 identical websites in Azure, they have identical setup. Both are running in Standard mode with instance size Small. There are no auto-scaling.
One website is running in region North Europe, the other in West Europe.
I experience about 25% difference in performance on websites. West Europe being the "slow one".
- Anyone have any information on this?
- Hands on experience with difference in performance from region to region?
- Someone with same setups that could try the same test?
Bellow is the simple stress test I ran to check performance.
public ActionResult StressTest(int loopCount, int dbLoopCount)
{
var sw = new System.Diagnostics.Stopwatch();
sw.Start();
if (user.IsAdmin)
{
var hashTable = new Hashtable();
var list = new List<int>();
var random = new Random();
for (var x = 0; x <= loopCount; x++)
{
list.Add(x);
for (var i = 0; i <= loopCount; i++)
{
hashTable[i] = list.Where(d => d == random.Next(0, x)).Count(); ;
hashTable[i] = list.Where(d => d == random.Next(0, x)).Count(); ;
hashTable[i] = list.Where(d => d == random.Next(0, x)).Count(); ;
hashTable[i] = list.Where(d => d == random.Next(0, x)).Count(); ;
hashTable.Remove(i);
}
}
}
sw.Stop();
var loopTime = sw.ElapsedMilliseconds;
sw.Restart();
#region DBLoop
.........
#endregion
sw.Stop();
var dbTime = sw.ElapsedMilliseconds;
return Json(new
{
WS = new
{
Loops = loopCount.ToString("N0"),
Seconds = (loopTime / 1000.0),
Milliseconds = loopTime
},
DB = new
{
Loops = dbLoopCount.ToString("N0"),
Seconds = (dbTime / 1000.0),
Milliseconds = dbTime
}
}, JsonRequestBehavior.AllowGet);
}
The data base servers are VM's with Linux and MongoDB. The VM's in West Europe are about 35% slower than North Europe counterpart. Due to different Linux distribution, partitioning and replica setup, the test are not as valid as the website tests. It's hard to explain a 35% reduction in DB performance by any of the setup factors. It's tempting to think that 25% of that speed reduction are the same reduction I see on websites.
I have removed the DB stress test code, it's just consists of simple reads/counts. For the record: I have created 2 different websites in West Europe, and the slower performance is consistent. Also over several days, I first tested this on Tuesday, same results today.