Session Clustering Directives

Session Clustering is a transparent application that does not require a user interface or a command line utility.

Session Clustering is configured by changing the session clustering directives in the zend.ini.

 

Directive

Value

Description

mod_cluster.daemon_verbosity_level

 

[1..3]

The verbosity level of the Session Clustering daemon messages.

mod_cluster.number_of_threads

[1..n]

Number of worker threads run by the Session Clustering daemon, mainly handling connections. Increase according to the running machines strength.

mod_cluster.garbage_collection_delta

[0..n]

The number of seconds between executions of the Session Clustering daemon’s garbage collector frequency.

mod_cluster.session_lifetime  

[1..n]

The lifetime of a session (in seconds either as file or in memory). Sessions older than that will be removed by garbage collection.

mod_cluster.statistics_delta_minutes

[0..n]

The number of minutes between statistics dump to the log file

mod_cluster.network.hostname

<machine hostname>

The IP/hostname of the machine on which the Session Clustering daemon runs. Note: Change the mod_cluster.network.hostname’s value to the name of the machine in the network.

mod_cluster.network.tcp_port_remote

 [1..65535]

The TCP port the Session Clustering daemon listens to  in order to communicate with other Session Clustering daemons

mod_cluster.network.unix_socket_permissions

[octal permission]

Permission to set for Unix socket file. When the daemon is run, it creates a ZendSessionManager.sock file, with these permissions

mod_cluster.ha.udp_port

45678

HA communication port

mod_cluster.ha.broadcast_address

 

default 255.255.255.255

cluster's broadcast mask

 

mod_cluster.ha.broadcast_delta  

default 30

The time, in seconds between broadcasts.

mod_cluster.message_server_port

 

The port on which the daemon listens for control messages (which can be sent using the messenger utility).

mod_cluster.allowed_hosts

 

 

A comma separated list of IPs or IP masks. these masks indicate machines which the daemon will agree to connect and to receive connections

mod_cluster.storage.use_permanent_storage

 

0

Session Clustering data storage:0-memory, 1-disk Note: Environments that have large amounts of session data (over a Mega) should save session information to the disk.

mod_cluster.storage.memory_cache_size

[1..n]

When using DISK STORAGE and not memory, this number specifies the amount of memory (in bytes) used as a cache by the Session Clustering daemon.

mod_cluster.ha.allowed_ips_file

<Platform install dir>/etc/allowed_ip

The File containing list of allowed IPs to connect with the Session Clustering daemon

mod_cluster.storage.flush_delta

 

0

Determines the storage method and intervals for storage flush

mod_cluster.storage.save_path

 

The location on disk where saved sessions are stored

mod_cluster.storage.dir_levels

 

[1..n]

The number of dir levels used in saving files

mod_cluster.storage.filename_cache_num_entries

[1..1024]

The Maximum number of session file pointers held in an internal cache

zend_temp_dir

 

The location in which the  ZendSessionManager.sock and the ZendSessionManager.lock are stored

zend_monitor.log_dir

 

The location in which log files are stored

mod_cluster.network.use_unix_sockets

 

 

Communication with the mod_cluster.so Note: Do not change this value, It should always be set to = 1.

mod_cluster.network.tcp_port_local

[1..65535]

If use_unix_sockets=0 then this will be the TCP port the Session Clustering daemon listens to. Note: The Session Clustering daemon will accept communication from localhost on that port only.

mod_cluster.verbosity_level

[1..5]

 

The verbosity level of the Session Clustering debug messages.

mod_cluster.log_rotation_delta

 

 

The number of minutes after which a check for log rotation is performed

mod_cluster.log_rotation_size

 

The size of the log file in MBs

 

Additional Information

mod_cluster.storage.flush_delta

Determines the write policy for sessions, when disk-mode is used.

If 0, then sessions are written to disk "on the spot" (write-through). there's no delay and when the WRITE function returns, then either the session is written or an error has occurred. This method may reduce performance.

If a positive number is specified, then write-back is used. For example, if 3 is specified, then a session is not written immediately, but only 3 seconds later. This method may increase performance. However, when the WRITE functions returns, data that has not been actually written! it can cause the following effects:

mod_cluster.storage.dir_levels

Determines the number of directory levels used when storing sessions on disk. The following example shows what dir levels are:

Usage Example

Example:

mod_cluster.storage.save_path = /tmp/zend_sessions/ mod_cluster.storage.dir_levels = 2

Assuming session ID is abc123def456, then the actual file saved to disk will be /tmp/zend_sessions/a/ab/abc123def456. So, the more dir levels there are, the level of indirection increases. What is it good for? it makes sure that you don't have a single directory with hundreds or thousands of sessions, since this situation reduces disk response time when accessing a single file.

 

 

Related Links

Related Links:
Session Clustering