The high availability of your PHP application can be achieved by implementing PHP sessions clustering in the cloud. To successfully handle application server failover we create environment with Memcached, several Apache servers, and an NGINX load balancer:
- Log into theJelastic Manager
- Click the Create environment button
- In the Environment topology window choose two or more servers you want to use (for example, two instances of Apache) and Memcached node. Type the name of the environment and click Create.
The Memcached node is used as a distributed caching engine in the environment with multiple nodes. In our case, it provides a Web session with the sticky sessions running on several application servers. If one server fails, the sessions are stored for backup on the Memcached node. Other servers can fetch the sessions from Memcached and start serving the session.