How to handle cluster session sharing issues

Source: Internet
Author: User

Currently, cluster login sessions are handled in the following ways:

 

1. Session broadcast mode, that is, sessions in each Web container are copied to each other. When a container session changes, all other containers in the cluster are notified,

This method is easy to cause a broadcast storm (similar to a hub, depending on the implementation method, for example, the two methods). It is easy to configure and can be used for small-scale users in small clusters.

 

2. Centralized session management, modify container configurations, and centralize all sessions on the Cache Server (such as memcached, redis, or database). The memory processing efficiency is high, but all sessions will be lost when the server goes down,

The storage efficiency of databases is low, and most sessions can still be saved when the database goes down. For databases, choose MySQL or Berkeley dB. For example:

2.1 In some cases, the session cache server can only store login information, and write other data into cookies. However, the cookie is restricted and the design can be changed based on the actual situation.

 

 

3. Default session stickiness, that is, all requests are forwarded to one server until the browser is closed. Disadvantage: server downtime leads to the loss of all user sessions served on the server,

Applicable scenarios: Suitable for medium-sized enterprises (for example, TPS is 300-500 ).

How to handle cluster session sharing issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.