Skip to content

Commit 3972620

Browse files
committed
IBX-10245: Document 5.0 requirements
1 parent 0f933ba commit 3972620

File tree

11 files changed

+305
-160
lines changed

11 files changed

+305
-160
lines changed

docs/ai_actions/img/diagram_source/server_setup.xml

Lines changed: 143 additions & 0 deletions
Large diffs are not rendered by default.

docs/getting_started/install_with_ddev.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ If the local project needs to answer to real production domains (for example, to
415415

416416
You can use DDEV to locally simulate a production cluster.
417417

418-
- See [Clustering with DDEV](clustering_with_ddev.md) to add Elasticsearch, Solr, Redis, or Memcached to your DDEV installation.
418+
- See [Clustering with DDEV](clustering_with_ddev.md) to add Elasticsearch, Solr, or Redis to your DDEV installation.
419419
- See [DDEV and Ibexa Cloud](ddev_and_ibexa_cloud.md) to locally run an [[= product_name =]] project by using DDEV.
420420

421421
## Stop or remove the project

docs/getting_started/requirements.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The following server requirements cover both running the software on-premise and
1717
For running on [[[= product_name_cloud =]]](https://www.ibexa.co/products/ibexa-cloud), where recommended configuration and support is provided out of the box, see separate [[[= product_name_cloud =]] section](#ibexa-cloud-requirements-and-setup) for further reading on its requirements.
1818

1919
The minimal setup requires PHP, MySQL/MariaDB, Apache/Nginx, Node.js and `yarn`.
20-
Recommendation for production setups is to use Varnish/Fastly, Redis/Memcached, NFS/EFS/S3 and Solr/Elasticsearch in a [clustered setup](clustering.md).
20+
For production setups it's recommended that you use Varnish/Fastly, Redis, NFS/EFS/S3 and Solr/Elasticsearch in a [clustered setup](clustering.md).
2121

2222
!!! caution "Recommended versions"
2323

@@ -202,7 +202,7 @@ Recommendation for production setups is to use Varnish/Fastly, Redis/Memcached,
202202

203203
=== "[[= product_name =]] v5.0"
204204

205-
- `php-redis` or `php-memcached`
205+
- `php-redis`
206206

207207
=== "[[= product_name =]] v4.6"
208208

@@ -287,7 +287,7 @@ Recommendation for production setups is to use Varnish/Fastly, Redis/Memcached,
287287
=== "[[= product_name =]] v5.0"
288288

289289
- Linux NFS or S3/EFS (for IO, aka binary files stored in content repository, not supported with legacy)
290-
- Redis 4.0+ or 5.0+ (separate instances for session and cache, both using a `volatile-*` [eviction policy](https://redis.io/docs/latest/develop/reference/eviction/), session instance configured for persistence) or [Memcached](https://memcached.org/) 1.5 or higher
290+
- Redis 4.0+ or 5.0+ (separate instances for session and cache, both using a `volatile-*` [eviction policy](https://redis.io/docs/latest/develop/reference/eviction/), session instance configured for persistence)
291291
- [Varnish](http://varnish-cache.org/) 6.0LTS or 7.1 with [varnish-modules](https://github.com/varnish/varnish-modules/blob/master/README.md) or [Fastly](https://www.fastly.com/) using [the provided bundle](http_cache.md) (for HTTP Cache)
292292

293293
If you see a "+" next to the product version, it indicates a recommended version or higher within the same major release.

docs/infrastructure_and_maintenance/cache/persistence_cache.md

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Persistence cache can best be described as an implementation of `SPI\Persistence
1212

1313
As shown in the illustration, this is done in the exact same way as the event layer is a custom implementation of `API\Repository` decorating the main repository.
1414
In the case of persistence cache, instead of sending events on calls passed on to the decorated implementation, most of the load calls are cached, and calls that perform changes purge the affected caches.
15-
Cache handlers *(for example, Memcached, Redis, or Filesystem)* can be configured using Symfony configuration.
15+
Cache handlers *(for example, Redis, or Filesystem)* can be configured using Symfony configuration.
1616
For details on how to reuse this Cache service in your own custom code, see below.
1717

1818
## Transparent cache
@@ -47,10 +47,10 @@ To see where and how to contribute additional caches, refer to the [source code]
4747
!!! note
4848

4949
Current implementation uses Symfony cache.
50-
It technically supports the following cache backends: [APCu, Array, Chain, Doctrine, Filesystem, Memcached, PDO & Doctrine DBAL, Php Array, Proxy, Redis]([[= symfony_doc =]]/components/cache/cache_pools.html#creating-cache-pools).
51-
[[= product_name =]] officially supports only using Filesystem for single server and Redis or Memcached for clustered setups.
50+
It technically supports the following cache backends: [APCu, Array, Chain, Doctrine, Filesystem, PDO & Doctrine DBAL, Php Array, Proxy, Redis]([[= symfony_doc =]]/components/cache/cache_pools.html#creating-cache-pools).
51+
[[= product_name =]] officially supports only using Filesystem for single server and Redis for clustered setups.
5252

53-
Use of Memcached or Redis as shared cache back end is a requirement for use in clustering setup.
53+
Use of Redis as shared cache back end is a requirement for use in clustering setup.
5454
For an overview of this feature, see [Clustering](clustering.md).
5555
Filesystem adapters, for example, are **not** intended to be used over a shared filesystem.
5656

@@ -210,79 +210,9 @@ Several cloud providers have managed services that are easier to set up, handle
210210
If you use Platform.sh Enterprise you can benefit from the Redis Sentinel across three nodes for great fault tolerance.
211211
Platform.sh Professional and lower versions offer Redis in single instance mode only.
212212

213-
### Memcached
214-
215-
[Memcached, a distributed caching solution](http://memcached.org/) is a cache solution that is supported for clustering use, as an alternative to Redis.
216-
217-
See [Memcached Cache Adapter in Symfony documentation]([[= symfony_doc =]]/components/cache/adapters/memcached_adapter.html#configure-the-connection) for information on how to configure Memcached.
218-
219-
220-
#### Supported Adapters
221-
222-
There is one Memcached adapter available out of the box.
223-
224-
##### `Symfony\Component\Cache\Adapter\MemcachedAdapter`
225-
226-
**Pros**: Memcached is able to handle much more concurrent load by design (multi threaded), and typically uses far less memory than Redis in general due to a simpler data structure.
227-
228-
**Cons**: 1.5-2x more lookups to the back-end cache server then `RedisTagAwareAdapter`.
229-
Depending on the number of lookups and latency to cache server this might affect page load time.
230-
231-
#### Adjusting configuration
232-
233-
Out of the box in `config/packages/cache_pool/cache.memcached.yaml` you can find a default example that can be used.
234-
235-
!!! note "[[= product_name_cloud =]]"
236-
237-
For [[= product_name_cloud =]]/Platform.sh: This is automatically configured in `vendor/ibexa/core/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php` if you have enabled Memcached as `cache` Platform.sh service.
238-
239-
For anything else, you can enable it with environment variables detected automatically by `vendor/ibexa/core/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php`.
240-
For instance, if you set the following environment variables `export CACHE_POOL="cache.memcached" CACHE_DSN="user:pass@localhost?weight=33"`, it results in config like this:
241-
242-
``` yaml
243-
services:
244-
cache.memcached:
245-
parent: cache.adapter.memcached
246-
tags:
247-
- name: cache.pool
248-
clearer: cache.app_clearer
249-
provider: 'memcached://user:pass@localhost?weight=33'
250-
# Default CACHE_NAMESPACE value, see bin/config/cache_pool/cache.redis.yaml for usage with e.g. multi repo.
251-
namespace: 'ez'
252-
```
253-
254-
See `config/default_parameters.yaml` and `config/cache_pool/cache.memcached.yaml` for further details on `CACHE_POOL`, `CACHE_DSN` and `CACHE_NAMESPACE`.
255-
256-
!!! caution "Clearing Memcached cache"
257-
258-
The regular `php bin/console cache:clear` command doesn't clear Memcached persistence cache.
259-
Use a dedicated Symfony command to clear the pool you have configured: `php bin/console cache:pool:clear cache.memcached`.
260-
261-
262-
!!! caution "Connection errors issue"
263-
264-
If Memcached does display connection errors when using the default (ascii) protocol, then switching to binary protocol *(in the configuration and Memcached daemon)* should resolve the issue.
265-
266-
!!! note
267-
268-
Memcached must not be bound to the local address if clusters are in use, or user logins fail.
269-
To avoid this, in `/etc/memcached.conf` take a look under `# Specify which IP address to listen on. The default is to listen on all IP addresses`
270-
271-
For development environments, change the address below this comment in `/etc/memcached.conf` to `-l 0.0.0.0`
272-
273-
For production environments, follow this more secure instruction from the Memcached man:
274-
275-
> -l <addr>
276-
277-
> Listen on <addr>; default to INADDR\_ANY. <addr> may be specified as host:port.
278-
If you don't specify a port number, the value you specified with -p or -U is used.
279-
You may specify multiple addresses separated by comma or by using -l multiple times.
280-
This is an important option to consider as there is no other way to secure the installation.
281-
Binding to an internal or firewalled network interface is suggested.
282-
283213
## Using cache service
284214

285-
Using the internal cache service allows you to use an interface and without caring whether the system is configured to place the cache in Memcached or on File system.
215+
Using the internal cache service allows you to use an interface and without caring whether the system is configured to place the cache on File system.
286216
And as [[= product_name =]] requires that instances use a cluster-aware cache in cluster setup, you can safely assume your cache is shared *(and invalidated)* across all web servers.
287217

288218
!!! note

docs/infrastructure_and_maintenance/clustering/clustering.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ The parts illustrate the different roles needed for a successful cluster setup.
1313

1414
![Server setup for clustering](server_setup.png)
1515

16-
The number of web servers, Memcached/Redis, Solr, Varnish, Database, and NFS servers, but also whether some servers play several of these roles (typically running Memcached/Redis across the web server), is up to you and your performance needs.
16+
The number of web servers, Redis, Solr, Varnish, Database, and NFS servers, but also whether some servers play several of these roles (typically running Redis across the web server), is up to you and your performance needs.
1717

1818
The minimal requirements are:
1919

2020
- [Shared HTTP cache (using Varnish)](reverse_proxy.md#using-varnish-or-fastly)
21-
- [Shared persistence cache](#shared-persistence-cache) and [sessions](#shared-sessions) (using Redis or Memcached)
21+
- [Shared persistence cache](#shared-persistence-cache) and [sessions](#shared-sessions) (using Redis)
2222
- Shared database (using MySQL/MariaDB)
2323
- [Shared binary files](#shared-binary-files) (using NFS, or S3)
2424

@@ -35,21 +35,20 @@ It's also recommended to use:
3535
### Shared persistence cache
3636

3737
Redis is the recommended cache solution for clustering.
38-
An alternative solution is using Memcached.
3938

4039
See [persistence cache documentation](persistence_cache.md#persistence-cache-configuration) on information on how to configure them.
4140

4241
### Shared sessions
4342

4443
For a [cluster](clustering.md) setup you need to configure sessions to use a back end that is shared between web servers.
45-
The main options out of the box in Symfony are the native PHP Memcached or PHP Redis session handlers, alternatively there is Symfony session handler for PDO (database).
44+
The main option out of the box in Symfony is the PHP Redis session handler, alternatively there is Symfony session handler for PDO (database).
4645

4746
To avoid concurrent access to session data from front-end nodes, if possible you should either:
4847

4948
- Enable [Session locking](https://www.php.net/manual/en/features.session.security.management.php#features.session.security.management.session-locking)
5049
- Use "Sticky Session", aka [Load Balancer Persistence](https://en.wikipedia.org/wiki/Load_balancing_%28computing%29#Persistence)
5150

52-
Session locking is available with `php-memcached`, and with `php-redis` (v4.2.0 and higher).
51+
Session locking is available with `php-redis` (v4.2.0 and higher).
5352

5453
On [[= product_name_cloud =]] (and Platform.sh) Redis is preferred and supported.
5554

docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -120,37 +120,3 @@ You can now check whether Redis works.
120120
For example, the `ddev redis-cli MONITOR` command returns outputs, for example, `"SETEX" "ezp:`, `"MGET" "ezp:`, `"SETEX" "PHPREDIS_SESSION:`, or `"GET" "PHPREDIS_SESSION:`, while navigating into the website, in particular the back office.
121121

122122
See [Redis commands](https://redis.io/docs/latest/commands/) for more details such as information about the [`MONITOR`](https://redis.io/docs/latest/commands/monitor/) command used in the previous example.
123-
124-
### Install Memcached
125-
126-
First, if not already there, append the following [new service](https://doc.ibexa.co/en/latest/infrastructure_and_maintenance/sessions/#handling-sessions-with-memcached) to `config/services.yaml`:
127-
128-
```yaml
129-
app.session.handler.native_memcached:
130-
class: Ibexa\Bundle\Core\Session\Handler\NativeSessionHandler
131-
arguments:
132-
- '%session.save_path%'
133-
- memcached
134-
```
135-
136-
Second, install and set up the add-on.
137-
The following sequence of commands:
138-
139-
1. Adds the Memcached container.
140-
1. Sets Memcached as the cache pool.
141-
1. Sets Memcached as the session handler.
142-
1. Restarts the DDEV cluster and clears application cache.
143-
144-
```bash
145-
ddev add-on get ddev/ddev-memcached
146-
ddev config --web-environment-add CACHE_POOL=cache.memcached
147-
ddev config --web-environment-add CACHE_DSN=memcached
148-
ddev config --web-environment-add SESSION_HANDLER_ID=app.session.handler.native_memcached
149-
ddev config --web-environment-add SESSION_SAVE_PATH=memcached:11211
150-
ddev restart
151-
ddev php bin/console cache:clear
152-
```
153-
154-
You can now check whether everything went right.
155-
156-
For example, the `watch 'ddev exec netcat -w1 memcached 11211 <<< "stats" | grep "cmd_.et "'` command checks whether the `web` service can access the `memcached` service, and displays the increase of `cmd_get` and `cmd_set` while navigating into the website.

0 commit comments

Comments
 (0)