Reputation: 2018
I have a MongoDB replica set with approx. 200GB of data.
This currently exists in AWS on two medium.m3 instances (1 core, 3.7GB). I have a requirement to move this to Azure A2 instances (2 core, 3.5GB), however I am concerned about the performance.
In AWS I have a single disk per machine, 220GB SSD through EBS which delivers 660IOPS (or whatever this means in AWS speak).
According to Azure, I should get 500 IOPS per disk, so I thought performance would be comparable, however here are the results of mongoperf on Azure:
Azure mongoperf Output:
{ nThreads: 2, fileSizeMB: 1000, r: true }
creating test file size:1000MB ...
testing...
optoins:{ nThreads: 2, fileSizeMB: 1000, r: true }
wthr 2
new thread, total running : 1
read:1 write:0
64 ops/sec 0 MB/sec
82 ops/sec 0 MB/sec
85 ops/sec 0 MB/sec
111 ops/sec 0 MB/sec
95 ops/sec 0 MB/sec
106 ops/sec 0 MB/sec
96 ops/sec 0 MB/sec
112 ops/sec 0 MB/sec
new thread, total running : 2
read:1 write:0
188 ops/sec 0 MB/sec
195 ops/sec 0 MB/sec
223 ops/sec 0 MB/sec
137 ops/sec 0 MB/sec
222 ops/sec 0 MB/sec
212 ops/sec 0 MB/sec
200 ops/sec 0 MB/sec
Whilst my AWS medium.m3 instances perform totally different:
AWS mongoperf Output:
{ nThreads: 2, fileSizeMB: 1000, r: true }
creating test file size:1000MB ...
testing...
optoins:{ nThreads: 2, fileSizeMB: 1000, r: true }
wthr 2
new thread, total running : 1
read:1 write:0
3149 ops/sec 12 MB/sec
3169 ops/sec 12 MB/sec
3071 ops/sec 11 MB/sec
3044 ops/sec 11 MB/sec
2688 ops/sec 10 MB/sec
2880 ops/sec 11 MB/sec
3039 ops/sec 11 MB/sec
3020 ops/sec 11 MB/sec
new thread, total running : 2
read:1 write:0
3133 ops/sec 12 MB/sec
3044 ops/sec 11 MB/sec
3052 ops/sec 11 MB/sec
3016 ops/sec 11 MB/sec
2928 ops/sec 11 MB/sec
3041 ops/sec 11 MB/sec
3061 ops/sec 11 MB/sec
3025 ops/sec 11 MB/sec
How can I achieve the same performance through Azure as I do through AWS? I have looked at the D* instances which provide local SSD storage of 500GB, however these disks are ephemeral and so no good for hosting my database.
Edit: I can see that I can attach additional Premium Storage drives to the D* instances, however the costs for these are massive compared to AWS, looks like for high performance IO you still cannot beat AWS costs wise.
Upvotes: 1
Views: 1982
Reputation: 2018
The approach I have taken towards this is to attach the maximum drives the server can support, for an A2 Standard this is 4 drives.
I have 4 x 200GB drives, these placed in a RAID0 array giving ~800GB storage. The RAID0 allows me to combine the 500 IOPS total into 2000 IOPS theoretical max.
This now results in the following speed on the A2 machine from mongoperf, for some reason the single threaded performance is very low, including the test file write which happens at only 150 IOPS . At 10 threads the speed is exceeding the AWS instances, however I'm unsure if there is some kind of readahead caching going on here in Azure that would not apply in a real DB scenario. Performance on AWS does not alter with increased thread count.
Azure Performance:
{ nThreads: 10, fileSizeMB: 1000, r: true }
creating test file size:1000MB ...
testing...
optoins:{ nThreads: 10, fileSizeMB: 1000, r: true }
wthr 10
new thread, total running : 1
read:1 write:0
125 ops/sec 0 MB/sec
194 ops/sec 0 MB/sec
174 ops/sec 0 MB/sec
213 ops/sec 0 MB/sec
138 ops/sec 0 MB/sec
117 ops/sec 0 MB/sec
174 ops/sec 0 MB/sec
92 ops/sec 0 MB/sec
new thread, total running : 2
read:1 write:0
354 ops/sec 1 MB/sec
359 ops/sec 1 MB/sec
322 ops/sec 1 MB/sec
408 ops/sec 1 MB/sec
440 ops/sec 1 MB/sec
265 ops/sec 1 MB/sec
472 ops/sec 1 MB/sec
484 ops/sec 1 MB/sec
new thread, total running : 4
read:1 write:0
read:1 write:0
984 ops/sec 3 MB/sec
915 ops/sec 3 MB/sec
1419 ops/sec 5 MB/sec
1669 ops/sec 6 MB/sec
1934 ops/sec 7 MB/sec
1660 ops/sec 6 MB/sec
1348 ops/sec 5 MB/sec
1735 ops/sec 6 MB/sec
new thread, total running : 8
read:1 write:0
read:1 write:0
read:1 write:0
read:1 write:0
4041 ops/sec 15 MB/sec
5370 ops/sec 20 MB/sec
5643 ops/sec 22 MB/sec
5639 ops/sec 22 MB/sec
4388 ops/sec 17 MB/sec
6093 ops/sec 23 MB/sec
6350 ops/sec 24 MB/sec
6961 ops/sec 27 MB/sec
new thread, total running : 10
read:1 write:0
read:1 write:0
9684 ops/sec 37 MB/sec
11528 ops/sec 45 MB/sec
13807 ops/sec 53 MB/sec
16666 ops/sec 65 MB/sec
16306 ops/sec 63 MB/sec
24292 ops/sec 94 MB/sec
24264 ops/sec 94 MB/sec
19358 ops/sec 75 MB/sec
28067 ops/sec 109 MB/sec
43151 ops/sec 168 MB/sec
45165 ops/sec 176 MB/sec
44847 ops/sec 175 MB/sec
43806 ops/sec 171 MB/sec
43103 ops/sec 168 MB/sec
43477 ops/sec 169 MB/sec
44651 ops/sec 174 MB/sec
45365 ops/sec 177 MB/sec
41495 ops/sec 162 MB/sec
45281 ops/sec 176 MB/sec
47014 ops/sec 183 MB/sec
46056 ops/sec 179 MB/sec
45418 ops/sec 177 MB/sec
42363 ops/sec 165 MB/sec
43974 ops/sec 171 MB/sec
At the end with the high read IO this gives me very odd numbers from iostat:
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 0.00 0.00 0.00 0 0
sdb 0.00 0.00 0.00 0 0
sdd 10885.07 43540.30 0.00 87516 0
sde 10958.21 43832.84 0.00 88104 0
sdf 10960.70 43842.79 0.00 88124 0
sdc 10920.40 43681.59 0.00 87800 0
md127 43722.89 174891.54 0.00 351532 0
However: When I do a mongoperf with reads AND writes, performs falls off a cliff, AWS speeds still remain identical.
Azure with read and write mongoperf
new thread, total running : 10
read:1 write:1
read:1 write:1
126 ops/sec 0 MB/sec
84 ops/sec 0 MB/sec
150 ops/sec 0 MB/sec
123 ops/sec 0 MB/sec
84 ops/sec 0 MB/sec
190 ops/sec 0 MB/sec
179 ops/sec 0 MB/sec
108 ops/sec 0 MB/sec
171 ops/sec 0 MB/sec
192 ops/sec 0 MB/sec
152 ops/sec 0 MB/sec
103 ops/sec 0 MB/sec
163 ops/sec 0 MB/sec
116 ops/sec 0 MB/sec
121 ops/sec 0 MB/sec
76 ops/sec 0 MB/sec
Upvotes: 1