Enabling Session Clustering on Live Cluster


This article is also available in our new Knowledge Base: Enabling Session Clustering on Live Cluster


Applies To:

Zend Server Cluster with Session Clustering


When enabling Zend Session Clustering, you might start getting errors in Zend logs and users will be kicked out of the log-in system.

This is a sample sc.log:

[Mod Cluster 11.11.2014 02:54:31 NOTICE] 00263: [ mod_cluster.cpp : 623 ( ps_read_cluster ) ] failed to read session 6k0odt6jo4f2djk409jl0a3bb29hdhg5
[Mod Cluster 11.11.2014 03:00:02 WARNING] 00160: [ mod_cluster.cpp : 1394 ( getSession ) ] Failed to get session. Reaso…


Zend Session Clustering uses a different session ID than regular PHP sessions, although the flow / code integration is transparent to PHP and users.

Because of this modified session ID (PHPSESSID cookie by default), all sessions which are still tracked on client side and requested again, will be dropped as invalid, and new sessions with SC ID format would be created instead (so basically, session data is lost, users are logged out if the session has no DB backend etc.).

Session Clustering should be enabled on Zend Server installation when no users are affected, or more clearly, enabled while a server / cluster is out of load balancer and before getting live HTTP requests.

Taking a server / cluster off service to enable Session Clustering also means that expired sessions are anyway being refreshed so less users are affected.

About Zend Server Session ID format, it is as following:


You might recognize the HASH as unique ID from the standard PHP session IDs.


The real deal here is to identify if there are a few users being kicked out with old session ID (PHP files handler and former session handlers other than PHP and Zend SC), or any use of session is not working (new sessions, without any previous cookies in the browser do not get stored).
If indeed there is a global problem with enabling Zend Session Clustering, you should revert the change (i.e. return session handler to former value, normally "files"), restart all Web Servers and open a support ticket to examine the logs and understand what went wrong so Session Clustering can be re-enabled without breaking the PHP applications.