2. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
The VETRO pattern
Single host architectures
Message queue architecture
Outline
3. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Integration pattern – receive
input; process; send output.
Discrete components.
Well suited to distributed
processing.
How parallel can you go?
The VETRO Pattern
Validate
Enrich
Transform
Route
Operate
4. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Synchronous, sequential processing
Single host process
Demo – App V1.0
5. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
1K messages: <1 min
10K messages: 4.5 min
App V1.0
0
50
100
150
200
250
300
1K msg 10K msg
6. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
1K messages: <1 min
10K messages: 4.5 min
1M messages: 7-8 hours
App V1.0
0
5000
10000
15000
20000
25000
30000
1K msg 10K msg 1M
7. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Asynchronous, parallel processing
Using Tasks and DataFlow
Single host process
Demo – App V1.1 & 1.2
8. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
App V1.2
1K messages: <0.5 min
10K messages: 3.5 min
0
50
100
150
200
250
1K msg 10K msg
9. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
App V1.2
1K messages: <0.5 min
10K messages: 3.5 min
1M messages: 5.5 hours
0
2000
4000
6000
8000
10000
12000
14000
16000
18000
20000
1K msg 10K msg 1M
10. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
App V1.2: In the Real World
1K messages: 1 min
10K messages: 10 min
1M messages: 17.5 hours
0
10000
20000
30000
40000
50000
60000
70000
1K msg 10K msg 1M
11. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Single host receives input &
runs processing.
v1.2 runs at 16msg/sec =
17.5 hours for 1M messages.
Cannot run extra hosts without
contention over input.
Needs rewrite to scale.
Scaling Limitations
12. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Single host receives input &
sends 'do processing'
messages to queues.
Hosts can read from queues
without contention.
Allows multiple hosts to run
processing concurrently.
More scale – add hosts.
Message Queue Architecture
13. Asynchronous message sending
Single producer process
Multiple consumer processes
Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Demo: App V2
14. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
App V2
1K messages: <1 min
10K messages: 10 min
0
100
200
300
400
500
600
700
1K msg 10K msg
15. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
App V2
1K messages: <1 min
10K messages: 10 min
1M messages: 16.5 hours
0
10000
20000
30000
40000
50000
60000
70000
1K msg 10K msg 1M
16. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Remote DB & API
1x VM @ 1x host reading input & producing messages
3x VMs, each @ 9x hosts consuming messages
Demo – App V2 on Multiple VMs
18. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
App V2 on Multiple VMs
1K messages: <1 min
10K messages: 8 min
1M messages: 13.5 hours
0
5000
10000
15000
20000
25000
30000
35000
40000
45000
50000
1K msg 10K msg 1M
19. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
Scaling with App V2
1M messages
3 VMs: 13.5 hours
6 VMs: 6.5 hours
10 VMs: 1.5 hours0
2
4
6
8
10
12
14
3 6 10
Duration/hours
Consumer VMs
20. Introduction to ServiceInsight for NServiceBusScaling with Asynchronous Messaging
• Single processor always limited
• Split work and distribute
• Bottlenecks – dependencies not app logic
• Downside – more moving parts
• More upsides
Summary