简体   繁体   中英

Memcached and PHP Sessions

Okay Im working on a school project. The idea is a HA/LB Setup. The Setup is 3 Webservers running Apache and PHP. A MySQL Cluster Running 4 Datanodes, 2 MySQL Nodes and 2 Management Nodes.

Is there any way to make it so the php-sessions balance across servers without running them from the MySQL Cluster?

In theory I'd have a Memcache server and have Memcache running on each webserver. Is this feasible?

Thank You for your time. (the test enviroment is Virtual Machines before I do proof of concept on physical machines)

Yes, I think that will work.

Think of it this way: Your 3 web servers are threads running on a processor, and your Memcache instance(s) are the memory they are sharing between them. As long as they all have access to it, you should be able to share sessions across multiple web servers.

Disclaimer: I have not tried this, I am commenting solely on the theory behind it.

Why do you not want to use mysql for the sessions? If you think it will be faster, then I'd suggest you try it out.

4 database server nodes backing 3 webserver nodes? Why do you think you need so much processing at the database tier?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM