Skip to content

Commit 09ca55b

Browse files
committed
feat(initial): first content pass
1 parent 88aaa78 commit 09ca55b

File tree

18 files changed

+19346
-0
lines changed

18 files changed

+19346
-0
lines changed

content/en/docs/_index.en.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: "User Guide"
3+
linkTitle: "User Guide"
4+
weight: 10
5+
type: "landing"
6+
draft: false
7+
translated: false
8+
translated: false
9+
resources:
10+
- src: "**.{png,jpg}"
11+
title: "Image #:counter"
12+
params:
13+
byline: "Image: Drupal / CC-BY-CA"
14+
categories:
15+
- wxt
16+
tags:
17+
- userguide
18+
---
19+
20+
This user guide is for project teams who are using the **[Drupal WxT][wxt]** distribution.
21+
22+
<!-- Links Referenced -->
23+
24+
[wxt]: https://github.com/drupalwxt/wxt
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: "Development"
3+
linkTitle: "Development"
4+
weight: 15
5+
type: "landing"
6+
draft: false
7+
translated: false
8+
resources:
9+
- src: "**.{png,jpg}"
10+
title: "Image #:counter"
11+
params:
12+
byline: "Image: Drupal / CC-BY-CA"
13+
categories:
14+
- wxt
15+
tags:
16+
- development
17+
---
18+
19+
This section provides information for developers who wish to help collaborate and improve **[Drupal WxT][wxt]**.
20+
21+
<!-- Links Referenced -->
22+
23+
[wxt]: https://github.com/drupalwxt/wxt
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: "Configuration Management"
3+
linkTitle: "Configuration Management"
4+
weight: 15
5+
type: "landing"
6+
draft: false
7+
translated: false
8+
resources:
9+
- src: "**.{png,jpg}"
10+
title: "Image #:counter"
11+
params:
12+
byline: "Image: Drupal / CC-BY-CA"
13+
categories:
14+
- wxt
15+
tags:
16+
- configuration
17+
---
18+
19+
Drupal WxT thanks to the work done by the Acquia Team is able to use advanced
20+
configuration management strategies.
21+
22+
At the moment this remains an opt-in process and you will have to add the
23+
following modules to your `composer.json` before you add the code snippet
24+
below to your `settings.php` file.
25+
26+
- **[Configuration Split][config-ignore]**
27+
- **[Configuration Ignore][config-split]**
28+
29+
Once enabled all default configuration will be stored in `/sites/default/files/config/default/`
30+
and then depending on your environment additionally configuration splits can
31+
be leveraged depending on your `SDLC`.
32+
33+
```php
34+
/**
35+
* Configuration Split for Configuration Management
36+
*
37+
* WxT is following the best practices given by Acquia for configuration
38+
* management. The "default" configuration directory should be shared between
39+
* all multi-sites, and each multisite will override this selectively using
40+
* configuration splits.
41+
*
42+
* To disable this functionality simply set the following parameters:
43+
* $wxt_override_config_dirs = FALSE;
44+
* $settings['config_sync_directory'] = $dir . "/config/$site_dir";
45+
*
46+
* See https://github.com/acquia/blt/blob/12.x/settings/config.settings.php
47+
* for more information.
48+
*/
49+
50+
use Drupal\wxt\Robo\Common\EnvironmentDetector;
51+
52+
if (!isset($wxt_override_config_dirs)) {
53+
$wxt_override_config_dirs = TRUE;
54+
}
55+
if ($wxt_override_config_dirs) {
56+
$config_directories['sync'] = $repo_root . "/var/www/html/sites/default/files/config/default";
57+
$settings['config_sync_directory'] = $repo_root . "/var/www/html/sites/default/files/config/default";
58+
}
59+
$split_filename_prefix = 'config_split.config_split';
60+
if (isset($config_directories['sync'])) {
61+
$split_filepath_prefix = $config_directories['sync'] . '/' . $split_filename_prefix;
62+
}
63+
else {
64+
$split_filepath_prefix = $settings['config_sync_directory'] . '/' . $split_filename_prefix;
65+
}
66+
67+
/**
68+
* Set environment splits.
69+
*/
70+
$split_envs = [
71+
'local',
72+
'dev',
73+
'test',
74+
'qa',
75+
'prod',
76+
'ci',
77+
];
78+
foreach ($split_envs as $split_env) {
79+
$config["$split_filename_prefix.$split_env"]['status'] = FALSE;
80+
}
81+
if (!isset($split)) {
82+
$split = 'none';
83+
if (EnvironmentDetector::isLocalEnv()) {
84+
$split = 'local';
85+
}
86+
if (EnvironmentDetector::isCiEnv()) {
87+
$split = 'ci';
88+
}
89+
if (EnvironmentDetector::isDevEnv()) {
90+
$split = 'dev';
91+
}
92+
elseif (EnvironmentDetector::isTestEnv()) {
93+
$split = 'test';
94+
}
95+
elseif (EnvironmentDetector::isQaEnv()) {
96+
$split = 'qa';
97+
}
98+
elseif (EnvironmentDetector::isProdEnv()) {
99+
$split = 'prod';
100+
}
101+
}
102+
if ($split != 'none') {
103+
$config["$split_filename_prefix.$split"]['status'] = TRUE;
104+
}
105+
106+
/**
107+
* Set multisite split.
108+
*/
109+
// $config["$split_filename_prefix.SITENAME"]['status'] = TRUE;
110+
```
111+
112+
<!-- Links Referenced -->
113+
114+
[config-ignore]: https://www.drupal.org/project/config_ignore
115+
[config-split]: https://www.drupal.org/project/config_split
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: "Performance"
3+
linkTitle: "Performance"
4+
weight: 15
5+
type: "landing"
6+
draft: false
7+
translated: false
8+
resources:
9+
- src: "**.{png,jpg}"
10+
title: "Image #:counter"
11+
params:
12+
byline: "Image: Drupal / CC-BY-CA"
13+
categories:
14+
- wxt
15+
tags:
16+
- performance
17+
---
18+
19+
Below are some recommended settings that improve the performance of **[Drupal WxT][wxt]** sites.
20+
21+
<!-- Links Referenced -->
22+
23+
[wxt]: https://github.com/drupalwxt/wxt
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: "PostgreSQL"
3+
linkTitle: "PostgreSQL"
4+
weight: 15
5+
type: "landing"
6+
draft: false
7+
translated: false
8+
resources:
9+
- src: "**.{png,jpg}"
10+
title: "Image #:counter"
11+
params:
12+
byline: "Image: Drupal / CC-BY-CA"
13+
categories:
14+
- wxt
15+
tags:
16+
- postgresql
17+
---
18+
19+
To properly configure PostgreSQL with Drupal you should ensure the following configuration is used.
20+
21+
> **Note**: Some customizations might be necessary depending on your individual requirements.
22+
23+
```sh
24+
postgresqlConfiguration:
25+
listenAddresses: "'*'"
26+
maxConnections: "200"
27+
sharedBuffers: 512MB
28+
workMem: 2048MB
29+
effectiveCacheSize: 512MB
30+
effectiveIoConcurrency: "100"
31+
maintenanceWorkMem: 32MB
32+
minWalSize: 512MB
33+
maxWalSize: 512MB
34+
walBuffers: 8048kB
35+
byteaOutput: "'escape'"
36+
hugePages: "off"
37+
walLevel: "replica"
38+
maxWalSenders: "0"
39+
synchronousCommit: "on"
40+
walKeepSegments: "130"
41+
checkpointTimeout: "'15 min'"
42+
checkpointCompletionTarget: "0.9"
43+
walCompression: "on"
44+
walWriterDelay: 200ms
45+
walWriterFlushAfter: 1MB
46+
bgwriterDelay: 200ms
47+
bgwriterLruMaxpages: "100"
48+
bgwriterLruMultiplier: "2.0"
49+
bgwriterFlushAfter: "0"
50+
maxWorkerProcesses: "8"
51+
maxParallelWorkersPerGather: "4"
52+
maxParallelWorkers: "4"
53+
```
54+
55+
> **Note**: The above is written in yaml syntax which will work for both Docker Compose and Kubernetes Helm Charts. For the `postgresql.conf` file itself without using these tools simply find the `_` counterpart.
56+
57+
#### Queries leveraging ILIKE
58+
59+
There is a known PostgreSQL performance issue that exists in Drupal and is related to leveraging queries with `ILIKE`.
60+
61+
This issue is particularly noticeable in relation to the path_alias table.
62+
63+
There are patches being worked on to handle this in Drupal core but a very quick fix can be implemented leveraging pg_trgm.
64+
65+
There is a great blog article listed below which goes over this issue in more detail.
66+
67+
* **[Improving Drupal Postgres Performance][performance]**
68+
69+
The instructions are a bit outdated so the updated syntax to enter in psql is given below:
70+
71+
```sh
72+
CREATE EXTENSION pg_trgm;
73+
CREATE INDEX path_alias__alias_trgm_gist_idx ON path_alias USING gist (alias gist_trgm_ops);
74+
CREATE INDEX path_alias__path_trgm_gist_idx ON path_alias USING gist (path gist_trgm_ops);
75+
ANALYZE path_alias;
76+
```
77+
78+
<!-- Links Referenced -->
79+
80+
[performance]: https://ferfebles.github.io/2018/04/16/Improving-large-Drupal-Postgres-performance-by-using-pg_trgm.html
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: "Redis"
3+
linkTitle: "Redis"
4+
weight: 15
5+
type: "landing"
6+
draft: false
7+
translated: false
8+
resources:
9+
- src: "**.{png,jpg}"
10+
title: "Image #:counter"
11+
params:
12+
byline: "Image: Drupal / CC-BY-CA"
13+
categories:
14+
- wxt
15+
tags:
16+
- redis
17+
---
18+
19+
To properly configure Redis with Drupal you should ensure the following configuration is added to your `settings.php` file.
20+
21+
> **Note**: Some customizations might be necessary depending on your individual requirements.
22+
23+
```php
24+
if (extension_loaded('redis')) {
25+
// Set Redis as the default backend for any cache bin not otherwise specified.
26+
$settings['cache']['default'] = 'cache.backend.redis';
27+
$settings['redis.connection']['interface'] = 'PhpRedis';
28+
$settings['redis.connection']['scheme'] = 'http';
29+
$settings['redis.connection']['host'] = 'localhost';
30+
$settings['redis.connection']['port'] = '6379';
31+
//$settings['redis.connection']['password'] = '';
32+
33+
// Allow the services to work before the Redis module itself is enabled.
34+
$settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';
35+
$settings['container_yamls'][] = 'modules/contrib/redis/redis.services.yml';
36+
37+
// Manually add the classloader path, this is required for the container cache bin definition below
38+
// and allows to use it without the redis module being enabled.
39+
$class_loader->addPsr4('Drupal\\redis\\', 'modules/contrib/redis/src');
40+
41+
$settings['bootstrap_container_definition'] = [
42+
'parameters' => [],
43+
'services' => [
44+
'redis.factory' => [
45+
'class' => 'Drupal\redis\ClientFactory',
46+
],
47+
'cache.backend.redis' => [
48+
'class' => 'Drupal\redis\Cache\CacheBackendFactory',
49+
'arguments' => ['@redis.factory', '@cache_tags_provider.container', '@serialization.phpserialize'],
50+
],
51+
'cache.container' => [
52+
'class' => '\Drupal\redis\Cache\PhpRedis',
53+
'factory' => ['@cache.backend.redis', 'get'],
54+
'arguments' => ['container'],
55+
],
56+
'cache_tags_provider.container' => [
57+
'class' => 'Drupal\redis\Cache\RedisCacheTagsChecksum',
58+
'arguments' => ['@redis.factory'],
59+
],
60+
'serialization.phpserialize' => [
61+
'class' => 'Drupal\Component\Serialization\PhpSerialize',
62+
],
63+
],
64+
];
65+
66+
/** Optional prefix for cache entries */
67+
$settings['cache_prefix'] = 'drupal_';
68+
69+
// Always set the fast backend for bootstrap, discover and config, otherwise
70+
// this gets lost when redis is enabled.
71+
$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';
72+
$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';
73+
$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';
74+
75+
// Use for all bins otherwise specified.
76+
$settings['cache']['default'] = 'cache.backend.redis';
77+
78+
// Use for all queues unless otherwise specified for a specific queue.
79+
$settings['queue_default'] = 'queue.redis';
80+
81+
// Or if you want to use reliable queue implementation.
82+
// $settings['queue_default'] = 'queue.redis_reliable';
83+
84+
// Use this to only use Redis for a specific queue.
85+
// $settings['queue_service_aggregator_feeds'] = 'queue.redis';
86+
87+
// Use this to use reliable queue implementation.
88+
// $settings['queue_service_aggregator_feeds'] = 'queue.redis_reliable';
89+
}
90+
```

0 commit comments

Comments
 (0)