To ensure stability of stateful applications, load balancers implement persistence which directs all related connections to the same server. Different types of persistence are supported to address different types of application needs.

Some applications maintain the server state such as, shopping carts. Such state might be per client and identified by the client IP address or per HTTP session. Applications might access or modify this state while processing subsequent related connections from the same client or HTTP session.

The source IP persistence profile tracks sessions based on the source IP address. When a client requests a connection to a virtual server that enables the source address persistence, the load balancer checks if that client was previously connected, if so, returns the client to the same server. If not, you can select a server pool member based on the pool load balancing algorithm. Source IP persistence profile is used by Layer 4 and Layer 7 virtual servers.

The cookie persistence profile inserts a unique cookie to identify the session the first time a client accesses the site. The client forwards the HTTP cookie in subsequent requests and the load balancer uses that information to provide the cookie persistence. Layer 7 virtual servers can only use the cookie persistence profile.

Procedure

  1. From your browser, log in with admin privileges to an NSX Manager at https://<nsx-manager-ip-address>.
  2. Select Networking > Load Balancing > Profiles > Persistence > Add Persistence Profiles.
  3. Select Source IP to add a source IP persistence profile and enter the profile details.
    You can also accept the default Source IP profile settings.
    Option Description
    Name and Description Enter a name and a description for the Source IP persistence profile.
    Share Persistence Toggle the button to share the persistence so that all virtual servers this profile is associated with can share the persistence table.

    If the persistence sharing is not enabled in the Source IP persistence profile associated to a virtual server, each virtual server that the profile is associated to maintain a private persistence table.

    Persistence Entry Timeout Enter the persistence expiration time in seconds.

    The load balancer persistence table maintains entries to record that client requests are directed to the same server.

    • If no new connection requests are received from the same client within the timeout period, the persistence entry expires and is deleted.
    • If a new connection request from the same client is received within the timeout period, the timer is reset, and the client request is sent to a sticky pool member.

    After the timeout period has expired, new connection requests are sent to a server allocated by the load balancing algorithm. For the L7 load balancing TCP source IP persistence scenario, the persistence entry times out if no new TCP connections are made for some time, even if the existing connections are still alive.

    Purge Entries When Full Toggle the button to purge entries when the persistence table is full.

    A large timeout value might lead to the persistence table quickly filling up when the traffic is heavy. When the persistence table fills up, the oldest entry is deleted to accept the newest entry.

    HA Persistence Mirroring Toggle the button to synchronize persistence entries to the HA peer.
    Tags Enter tags to make searching easier.

    You can specify a tag to set a scope of the tag.

  4. Select a Cookie persistence profile and enter the profile details.
    Option Description
    Name and Description Enter a name and a description for the Cookie persistence profile.
    Share Persistence Toggle the button to share persistence across multiple virtual servers that are associated to the same pool members.

    The Cookie persistence profile inserts a cookie with the format, <name>.<profile-id>.<pool-id>.

    If the persistence shared is not enabled in the Cookie persistence profile associated with a virtual server, the private Cookie persistence for each virtual server is used and is qualified by the pool member. The load balancer inserts a cookie with the format, <name>.<virtual_server_id>.<pool_id>.

    Cookie Mode Select a mode from the drop-down menu.
    • INSERT - Adds a unique cookie to identify the session.
    • PREFIX - Appends to the existing HTTP cookie information.
    • REWRITE - Rewrites the existing HTTP cookie information.
    Cookie Name Enter the cookie name.
    Cookie Domain Enter the domain name.

    HTTP cookie domain can be configured only in the INSERT mode.

    Cookie Fallback Toggle the button so that the client request is rejected if cookie points to a server that is in a DISABLED or is in a DOWN state.

    Selects a new server to handle a client request if the cookie points to a server that is in a DISABLED or is in a DOWN state.

    Cookie Path Enter the cookie URL path.

    HTTP cookie path can be set only in the INSERT mode.

    Cookie Garbling Toggle the button to disable encryption.

    When garbling is disabled, the cookie server IP address and port information is in a plain text. Encrypt the cookie server IP address and port information.

    Cookie Type Select a cookie type from the drop-down menu.

    Session Cookie - Not stored. Will be lost when the browser is closed.

    Persistence Cookie - Stored by the browser. Not lost when the browser is closed.

    Max Idle Time Enter the time in seconds that the cookie type can be idle before a cookie expires.
    Max Cookie Age For the session cookie type, enter the time in seconds a cookie is available.
    Tags Enter tags to make searching easier.

    You can specify a tag to set a scope of the tag.