问题
I've got Sring Xd running in distributed mode and now beginning to run a few JMeter tests.
My question is around how the load generated gets distributed across containers in distributed mode.
If I generate 1000 messages each for 100 users, I'd like thiis traffic to be split between two or more containers running.
Is this possible? Or does one container take on the entire load? In my current setup this is what seems to be happening.
回答1:
What is the stream definition? And, specifically, what is the source module?
If it's an http source, you will need a load balancer (as with any http application). You can use a hardware balancer or software, such as Apache (mod_proxy etc).
EDIT: I mentioned the deployment manifest in a comment below.
Deployment is different to stream definition. This is about how to deploy a stream that has been defined.
See the Reference Guide for information about the deployment manifest. That link is for the M7 document, the current documentation can be found on the Wiki (use the browser's 'find' feature to search for Deployment Manifest
).
For this stream...
xd:>stream create test1 --definition "http | transform --expression=payload.toUpperCase() | log"
you can get 3 instances of transform using
xd:>stream deploy --name test1 --properties "module.transform.count=3"
来源:https://stackoverflow.com/questions/24752465/how-does-load-balancing-in-spring-xd-get-done