Memcached realize the advantages and disadvantages of session shared storage in a cluster

Source: Internet
Author: User
Tags memcached


Advantage Description :

1. memcached is a memory cache that can read and write faster than regular files

2. Can solve the problem of multiple server common session


Drawback Description :

1. Session data is stored in memory, persistence is deficient, but it is not a problem for session data

2. You can also use other persistent systems to store sessions, for example: Redis,ttserver

3. High-performance concurrency scenarios, the efficiency of cookies is much better than the session, so many large websites will use cookies to solve the problem of session sharing

Configuring PHP files on the ①web server, specifying the cache server as the session server

Configuration in Vim/application/php/lib/php.ini php.ini

1461:session.save_handler = Memcache

1490:session.save_path = "tcp://10.0.0.100:11211"

Using the memcached memory cache software to achieve session-preserving configuration, just modify the php.ini corresponding to the above parameters, the value of the above can be

② caching service on cache server as session server

Memcached-m 16m-p 11211-d-u root-c 8192


This article from "Write a blog Money" blog, please be sure to keep this source http://dadonggg.blog.51cto.com/12672150/1950171

Memcached realize the advantages and disadvantages of session shared storage in a cluster

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.