Changeset View
Changeset View
Standalone View
Standalone View
src/docs/user/cluster/cluster_partitioning.diviner
Show All 25 Lines | |||||
Partitioning generally does not do much to increase resiliance or make it | Partitioning generally does not do much to increase resiliance or make it | ||||
easier to recover from disasters, and is primarily a mechanism for scaling. | easier to recover from disasters, and is primarily a mechanism for scaling. | ||||
If you are considering partitioning, you likely want to configure replication | If you are considering partitioning, you likely want to configure replication | ||||
with a single master first. Even if you choose not to deploy replication, you | with a single master first. Even if you choose not to deploy replication, you | ||||
should review and understand how replication works before you partition. For | should review and understand how replication works before you partition. For | ||||
details, see @{Cluster:Databases}. | details, see @{Cluster:Databases}. | ||||
Databases also support some advanced configuration options. Briefly: | |||||
- `persistent`: Allows use of persistent connections, reducing pressure on | |||||
outbound ports. | |||||
See "Advanced Configuration", below, for additional discussion. | |||||
What Partitioning Does | What Partitioning Does | ||||
====================== | ====================== | ||||
When you partition Phabricator, you move all of the data for one or more | When you partition Phabricator, you move all of the data for one or more | ||||
applications (like Maniphest) to a new master database host. This is possible | applications (like Maniphest) to a new master database host. This is possible | ||||
because Phabricator stores data for each application in its own logical | because Phabricator stores data for each application in its own logical | ||||
database (like `phabricator_maniphest`) and performs no joins between databases. | database (like `phabricator_maniphest`) and performs no joins between databases. | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
Launching a new Partition | Launching a new Partition | ||||
========================= | ========================= | ||||
To add a new partition, follow these steps: | To add a new partition, follow these steps: | ||||
- Set up the new database host or hosts. | - Set up the new database host or hosts. | ||||
- Add the new database to `cluster.database`, but keep its "partition" | - Add the new database to `cluster.databases`, but keep its "partition" | ||||
configuration empty (just an empty list). If this is the first time you | configuration empty (just an empty list). If this is the first time you | ||||
are partitioning, you will need to configure your existing master as the | are partitioning, you will need to configure your existing master as the | ||||
new "default". This will let Phabricator interact with it, but won't send | new "default". This will let Phabricator interact with it, but won't send | ||||
any traffic to it yet. | any traffic to it yet. | ||||
- Run `bin/storage partition`. | - Run `bin/storage partition`. | ||||
- Run `bin/storage upgrade` to initialize the schemata on the new hosts. | - Run `bin/storage upgrade` to initialize the schemata on the new hosts. | ||||
- Stop writes to the applications you want to move by putting Phabricator | - Stop writes to the applications you want to move by putting Phabricator | ||||
in read-only mode, or shutting down the webserver and daemons, or telling | in read-only mode, or shutting down the webserver and daemons, or telling | ||||
Show All 34 Lines | |||||
of which patches have been applied to that particular master so that | of which patches have been applied to that particular master so that | ||||
`bin/storage upgrade` can upgrade hosts correctly. | `bin/storage upgrade` can upgrade hosts correctly. | ||||
Phabricator does not perform joins across logical databases, so there are no | Phabricator does not perform joins across logical databases, so there are no | ||||
meaningful differences in runtime behavior if two applications are on the same | meaningful differences in runtime behavior if two applications are on the same | ||||
physical host or different physical hosts. | physical host or different physical hosts. | ||||
Advanced Configuration | |||||
====================== | |||||
Separate from partitioning, some advanced configuration is supported. These | |||||
options must be set on database specifications in `cluster.databases`. You can | |||||
configure them without actually building a cluster by defining a cluster with | |||||
only one master. | |||||
`persistent` //(bool)// Enables persistent connections. Defaults to off. | |||||
With persitent connections enabled, Phabricator will keep a pool of database | |||||
connections open between web requests and reuse them when serving subsequent | |||||
requests. | |||||
The primary benefit of using persistent connections is that it will greatly | |||||
reduce pressure on how quickly outbound TCP ports are opened and closed. After | |||||
a TCP port closes, it normally can't be used again for about 60 seconds, so | |||||
rapidly cycling ports can cause resource exuastion. If you're seeing failures | |||||
because requests are unable to bind to an outbound port, enabling this option | |||||
is likely to fix the issue. This option may also slightly increase performance. | |||||
The cost of using persistent connections is that you may need to raise the | |||||
MySQL `max_connections` setting: although Phabricator will make far fewer | |||||
connections, the connections it does make will be longer-lived. Raising this | |||||
setting will increase MySQL memory requirements and may run into other limits, | |||||
like `open_files_limit`, which may also need to be raised. | |||||
Persistent connections are enabled per-database. If you always want to use | |||||
them, set the flag on each configured database in `cluster.databases`. | |||||
Next Steps | Next Steps | ||||
========== | ========== | ||||
Continue by: | Continue by: | ||||
- returning to @{article:Clustering Introduction}. | - returning to @{article:Clustering Introduction}. |