Multiple servers for session sharing

Source: Internet
Author: User
We know that the session is a mechanism for maintaining the session connection between the client and the server by the limitations of the HTTP protocol.
Visitors to the site are assigned a unique identifier, the so-called session ID. It is either stored on the client's cookie or passed through the URL.
The session is stored by default as a file in a local hard disk directory, so when the session is relatively long, the disk will be slower to read files. Another point is that for large sites, it is not possible to share multiple server sessions.
One solution is to use a database to access the session, so that the session information can be shared between different servers.
Implementing Code Downloads
The engine MyISAM is best replaced with a memory engine, because memories are made in the form of a Ram table, all the data is stored in memory, and the operation is fast, which applies to the data of the Session.
In the high-traffic website, the session storage is inefficient, occupying the database connection resources and so on. In this case, high-concurrency, large-traffic Session storage can be achieved using key-value data storage schemes such as Memcached and Redis.
  • 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.