How does load balancing in Spring XD get done?

倖福魔咒の 提交于 2020-01-05 12:30:58

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!