You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the initial connection to one of the hosts specified via `withContactPoints()` succeeded, the driver discovers the addresses and connects to all members of the cluster automatically. You can also see the nodes that the driver discovered by running `SELECT * FROM system.peers`.
22
22
23
+
### Persistent sessions
24
+
25
+
In order to limit the startup time and total number of connections to a Cassandra cluster, the PHP Driver enabled persistent sessions by default. All cluster and sessions using the same initial configuration will be shared across requests when persistent sessions are enabled. You can toggle this setting using [`Cassandra\Cluster\Builder::withPersistentSessions()`](http://datastax.github.io/php-driver/api/class/Cassandra/Cluster/Builder/#with-persistent-sessions).
26
+
27
+
```php
28
+
<?php
29
+
30
+
$cluster = Cassandra::cluster()
31
+
->withPersistentSessions(false)
32
+
->build();
33
+
$session = $cluster->connect();
34
+
```
35
+
36
+
Note that disabling persistent sessions will cause significant slow down of cluster initialization as the connections will be forced to get re-established for every request.
37
+
38
+
Once persistent sessions are enabled, you can view how many of them are currently active. They will be exposed in the Cassandra extension section of `phpinfo()`.
39
+
23
40
### Configuring load balancing policy
24
41
25
42
PHP Driver comes with a variety of load balancing policies. By default it uses a combination of token aware data center round robin.
0 commit comments