To limit each method of com.foo.BarService
, the concurrent execution on the server side (or the number of threads in the thread pool) cannot exceed 10:
<dubbo:service interface="com.foo.BarService" executes="10" />
To limit the sayHello
method of com.foo.BarService
, the concurrent execution on the server side (or the number of threads in the thread pool) cannot exceed 10:
<dubbo:service interface="com.foo.BarService">
<dubbo:method name="sayHello" executes="10" />
</dubbo:service>
Limit each method of com.foo.BarService
to no more than 10 concurrent executions per client (or the number of requests occupying a connection):
<dubbo:service interface="com.foo.BarService" actives="10" />
or
<dubbo:reference interface="com.foo.BarService" actives="10" />
Limit the sayHello
method of com.foo.BarService
to no more than 10 concurrent executions (or the number of requests that occupy a connection) per client:
<dubbo:service interface="com.foo.BarService">
<dubbo:method name="sayHello" actives="10" />
</dubbo:service>
or
<dubbo:reference interface="com.foo.BarService">
<dubbo:method name="sayHello" actives="10" />
</dubbo:service>
If both <dubbo:service>
and <dubbo:reference>
are configured with actives, <dubbo:reference>
takes precedence, see: [Configuration override strategy](../../../reference- manual/config/principle/).
The loadbalance
attribute of the client side of the configuration service is leastactive
, and this Loadbalance will call the Provider with the smallest number of concurrency (Consumer-side concurrency).
<dubbo:reference interface="com.foo.BarService" loadbalance="leastactive" />
or
<dubbo:service interface="com.foo.BarService" loadbalance="leastactive" />