blob: 9c62b50e63dc6e2f8aecf4da94606cf0740e6b2d [file] [log] [blame]
type=page
status=published
title=configure-lb-weight
next=configure-ldap-for-admin.html
prev=configure-jms-cluster.html
~~~~~~
= configure-lb-weight
[[configure-lb-weight-1]][[GSRFM00009]][[configure-lb-weight]]
== configure-lb-weight
Sets load balancing weights for clustered instances
[[sthref85]]
=== Synopsis
[source]
----
asadmin [asadmin-options] configure-lb-weight [--help]
--cluster cluster_name
instance-name=weight[:instance-name=weight]
----
[[sthref86]]
=== Description
The `configure-lb-weight` subcommand assigns weight to the server
instances in a cluster. Weights can be used for HTTP, RMI/IIOP and JMS
load balancing. For the HTTP load balancer, the weights are used only if
the load balancer's policy is set to `weighted-round-robin`. The load
balancer policy is set in the `create-http-lb-ref` subcommand or `set`
subcommand.
Use the weight to vary the load going to different instances in the
cluster. For example, if an instance is on a machine with more capacity,
give it a higher weight so that more requests are sent to that instance
by the load balancer. The default weight is 100. If all instances have
the default weight, the load balancer performs simple round robin load
balancing.
[NOTE]
====
This subcommand is only applicable to {productName}. This
subcommand is not applicable to {productName}.
====
[[sthref87]]
=== Options
asadmin-options::
Options for the `asadmin` utility. For information about these
options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page.
`--help`::
`-?`::
Displays the help text for the subcommand.
`--cluster`::
The name of the cluster.
[[sthref88]]
=== Operands
instance-name=weight::
The name of the instance and the weight you are assigning it. The
weight must be an integer. The pairs of instances and weights are
separated by colons. For example `instance1=1:instance2=4` means that
for every five requests, one goes to instance1 and four go to
instance2. A weight of 1 is the default.
[[sthref89]]
=== Examples
[[GSRFM454]][[sthref90]]
==== Example 1   Assigning Load Balancer Weights to Cluster Instances
The following subcommand assigns weights of `1`, `1`, and `2` to
instances `i1`, `i2`, and `i3` in the `cluster1` cluster.
[source]
----
asadmin> configure-lb-weight --cluster cluster1 i1=1:i2=1:i3=2
Command configure-lb-weight executed successfully.
----
[[sthref91]]
=== Exit Status
0::
subcommand executed successfully
1::
error in executing the subcommand
[[sthref92]]
=== See Also
link:asadmin.html#asadmin-1m[`asadmin`(1M)]
link:create-http-lb-ref.html#create-http-lb-ref-1[`create-http-lb-ref`(1)]link:create-cluster.html#create-cluster-1[`create-cluster`(1)]