Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/getting_started/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The following server requirements cover both running the software on-premise and
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.

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

!!! caution "Recommended versions"

Expand Down
8 changes: 4 additions & 4 deletions docs/getting_started/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ if you tell Composer to download dev packages or to download from source.

To avoid the error, check the stability of packages and avoid using `--prefer-source`.

## Redis sessions issues
## Redis/Valkey sessions issues

### Inconsistent cache/session data

If cache or session data inconsistent across web servers in Redis, see [Redis clustering](persistence_cache.md#redis-clustering), and make sure you only read/write to one active master instance at a time.
If cache or session data is inconsistent across web servers, see [Redis clustering](persistence_cache.md#redis-clustering), and make sure you only read/write to one active master instance at a time.

### Removed or refused sessions

If Redis sessions are removed or new sessions are refused.
If sessions are removed or new sessions are refused, it's recommended to use a separated instance for sessions, that either never runs out of memory or uses an eviction policy that suits your needs.

For more information, see [Cluster setup](sessions.md#cluster-setup).
It's recommended to use a separated instance of Redis for sessions, that either never runs out of memory or uses an eviction policy that suits your needs.

## Conflict with roave/security-advisories

Expand Down
4 changes: 2 additions & 2 deletions docs/infrastructure_and_maintenance/background_tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[[= product_name =]] sends messages (or commands) that represent the work to be done later.
These messages are stored in a queue and picked up by a background worker, which ensures that resource-heavy tasks are executed at a convenient time, without putting excessive load on the system.

[[= product_name_base =]] Messenger supports multiple storage backends, such as Doctrine, Redis, and PostgreSQL, and gives developers the flexibility to create their own message handlers for custom use cases.
[[= product_name_base =]] Messenger supports multiple storage backends, such as Doctrine, Redis/Valkey, and PostgreSQL, and gives developers the flexibility to create their own message handlers for custom use cases.

## How it works

Expand All @@ -23,7 +23,7 @@
1. A message PHP object is dispatched, for example, `ProductPriceReindex`.
2. The message is wrapped in an envelope, which may contain additional metadata, called stamps, for example, `DeduplicateStamp`.
3. The message is placed in the transport queue.
It can be a Doctrine table, a Redis queue, and so on.
It can be a Doctrine table, a Redis/Valkey queue, and so on.

Check warning on line 26 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L26

[Ibexa.Wordy] Remove 'and so on'. Try to use 'like' and provide examples instead.
Raw output
{"message": "[Ibexa.Wordy] Remove 'and so on'. Try to use 'like' and provide examples instead.", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 26, "column": 51}}}, "severity": "WARNING"}

Check failure on line 26 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L26

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 26, "column": 60}}}, "severity": "ERROR"}
4. A worker process continuously reads messages from the queue, pulls them into the default bus `ibexa.messenger.bus` and assigns them to the right handler.
5. A handler service processes the message (executes the command).
You can register multiple handlers for different jobs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,16 @@ parameters:
The only case where it's safe to increase these values is for dev environment with single concurrency on writes.
In prod environment you should only consider reducing them if you have heavy concurrency writes.

### Redis
### Redis/Valkey

[Redis](https://redis.io/), an in-memory data structure store, is one of the supported cache solutions for clustering.
Redis is used via [Redis pecl extension](https://pecl.php.net/package/redis).

See [Redis Cache Adapter in Symfony documentation]([[= symfony_doc =]]/components/cache/adapters/redis_adapter.html#configure-the-connection for information on how to connect to Redis.

[Valkey](https://valkey.io/), an alternative data structure store compatible with Redis, is also supported.
To set it up with [[= product_name =]], follow the same steps as for Redis.

#### Supported Adapters

There are two Redis adapters available out of the box that fit different needs.
Expand Down
10 changes: 5 additions & 5 deletions docs/infrastructure_and_maintenance/clustering/clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ The parts illustrate the different roles needed for a successful cluster setup.

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

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.
The number of web servers, Redis/Valkey, Solr, Varnish, Database, and NFS servers, but also whether some servers play several of these roles (typically running Redis/Valkey across the web server), is up to you and your performance needs.

The minimal requirements are:

- [Shared HTTP cache (using Varnish)](reverse_proxy.md#using-varnish-or-fastly)
- [Shared persistence cache](#shared-persistence-cache) and [sessions](#shared-sessions) (using Redis)
- [Shared persistence cache](#shared-persistence-cache) and [sessions](#shared-sessions) (using Redis/Valkey)
- Shared database (using MySQL/MariaDB)
- [Shared binary files](#shared-binary-files) (using NFS, or S3)

Expand All @@ -34,14 +34,14 @@ It's also recommended to use:

### Shared persistence cache

Redis is the recommended cache solution for clustering.
Redis and Valkey are the recommended cache solutions for clustering.

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

### Shared sessions

For a [cluster](clustering.md) setup you need to configure sessions to use a back end that is shared between web servers.
The main option out of the box in Symfony is the PHP Redis session handler, alternatively there is Symfony session handler for PDO (database).
The main option out of the box in Symfony is the PHP Redis session handler (also compatible with Valkey), alternatively there is Symfony session handler for PDO (database).

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

Expand All @@ -50,7 +50,7 @@ To avoid concurrent access to session data from front-end nodes, if possible you

Session locking is available with `php-redis` (v4.2.0 and higher).

On [[= product_name_cloud =]] (and Upsun) Redis is preferred and supported.
On [[= product_name_cloud =]] (and Upsun) Redis and Valkey are preferred and supported.

### Shared binary files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@
- the same service is used to store both persistence cache and sessions
- the session handler is set on Symfony side, not on PHP side

### Install Redis
### Install Redis or Valkey

DDEV supports multiple Redis-compatible implementation, including Redis itself and Valkey.
You can switch between them using the `ddev redis-backend <backend>` command after adding the `ddev/ddev-redis` add-on.

Check warning on line 122 in docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md#L122

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/infrastructure_and_maintenance/clustering/clustering_with_ddev.md", "range": {"start": {"line": 122, "column": 120}}}, "severity": "WARNING"}
For example, you can switch to Valkey by running `ddev add-on get ddev/ddev-redis; ddev redis-backend valkey/valkey:9`.
For more information, see [Swappable Redis backends](https://github.com/ddev/ddev-redis?tab=readme-ov-file#swappable-redis-backends) in DDEV's `dddev-redis` add-on documentation.

The following sequence of commands:

Expand All @@ -137,7 +142,7 @@
ddev php bin/console cache:clear
```

You can now check whether Redis works.
You can now check whether the data store backend works.

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.

Expand Down
13 changes: 7 additions & 6 deletions docs/infrastructure_and_maintenance/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- Dump optimized Composer autoload classmap
- Use a full web (Nginx/Apache) server with vhost
- Avoid shared filesystems for code (Docker for Mac/Win, VirtualBox/*, Vagrant, and more), or find ways to optimize or work around the issues.
- For clustering (mainly relevant for production/staging), reduce latency to Redis, use Varnish and [Solr](solr_overview.md).
- For clustering (mainly relevant for production/staging), reduce latency to Redis/Valkey, use Varnish and [Solr](solr_overview.md).

Check failure on line 19 in docs/infrastructure_and_maintenance/performance.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/performance.md#L19

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/performance.md", "range": {"start": {"line": 19, "column": 128}}}, "severity": "ERROR"}

## Client

Expand All @@ -31,7 +31,7 @@
- Compared to the built-in Symfony Proxy in PHP Varnish is much faster and is able to queue up requests for the same fresh/invalidated resource.
- With [ibexa/http-cache](https://github.com/ibexa/http-cache) support for xkey and grace Varnish provides more stable performance in read/write scenarios.
- Set up [[= product_name =]] in [cluster mode](clustering.md) if you need to handle bigger spikes of traffic than a single server can manage.
- See [recommendation for Redis](#redis) and [Search](#search) below.
- See [recommendation for Redis-compatible data stores](#redis-compatible-data-stores) and [Search](#search) below.

Check failure on line 34 in docs/infrastructure_and_maintenance/performance.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/performance.md#L34

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/performance.md", "range": {"start": {"line": 34, "column": 119}}}, "severity": "ERROR"}

!!! note

Expand Down Expand Up @@ -67,18 +67,19 @@
- Keep Composer up to date.
- Always dump optimized class map using `composer dump-autoload --optimize` or relevant flags on `composer install/update`.

### Redis
### Redis-compatible data stores

- Redis can in some cases perform better than filesystem cache even with a single server, as it offers better general performance for operations invalidating cache.
Redis and its alternatives, like Valkey, can in some cases perform better than filesystem cache even with a single server, as it offers better general performance for operations invalidating cache.
- However, pure read performance is slower, especially if the next points aren't optimized.
- With cache being on different node(s) than web server, make sure to try to tune latency between the two.

!!! tip

Check if your cloud provider has native service for Redis, as those might be better tuned.

- If you use Redis, make sure to tune it for in-memory cache usage. Its persistence feature isn't needed with cache and severely slows down execution time.
- [For use with sessions](sessions.md#cluster-setup) however, persistence can be a good fit if you want sessions to survive service interruptions.
When using Redis or Valkey, make sure to tune it for in-memory cache usage.

Check warning on line 80 in docs/infrastructure_and_maintenance/performance.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/performance.md#L80

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/infrastructure_and_maintenance/performance.md", "range": {"start": {"line": 80, "column": 76}}}, "severity": "WARNING"}
Its persistence feature isn't needed with cache and severely slows down execution time.
[For use with sessions](sessions.md#cluster-setup) however, persistence can be a good fit if you want sessions to survive service interruptions.

For more information, see [Redis clustering](persistence_cache.md#redis-clustering).

Expand Down
16 changes: 9 additions & 7 deletions docs/infrastructure_and_maintenance/sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

!!! note

Use of Redis (or experimentally PDO) as session handler is a requirement in a cluster setup, for details [see below](#cluster-setup). For an overview of the clustering feature see [Clustering](clustering.md).
Use of Redis, Valkey, or experimentally PDO as session handler is a requirement in a cluster setup, for details [see below](#cluster-setup). For an overview of the clustering feature see [Clustering](clustering.md).

## Configuration

Expand Down Expand Up @@ -76,14 +76,16 @@

See [shared sessions in the clustering guide](clustering.md#shared-sessions).

##### Handling sessions with Redis
##### Handling sessions with Redis and Valkey

To set up [[= product_name =]] using the [Redis](https://pecl.php.net/package/redis) you need to:
[[= product_name =]] supports storing sessions with [Redis](https://pecl.php.net/package/redis) or [Valkey](https://valkey.io/) data stores.

To set it up, you need to:

- [Configure the session save handler settings in `php.ini`](https://github.com/phpredis/phpredis/#php-session-handler)
- Set `%ibexa.session.handler_id%` to `~` _(null)_ in `config/packages/ibexa.yaml`

Alternatively if you have needs to configure Redis servers dynamically:
Alternatively if you have needs to configure the servers dynamically:

- Set `%ibexa.session.handler_id%` (or `SESSION_HANDLER_ID` env var) to `Ibexa\Bundle\Core\Session\Handler\NativeSessionHandler`
- Set `%ibexa.session.save_path%` (or `SESSION_SAVE_PATH` env var) to [save_path config for Redis](https://github.com/phpredis/phpredis/#php-session-handler)
Expand All @@ -97,10 +99,10 @@
Ideally keep [persistence cache](persistence_cache.md) and session data separated:

- Sessions can't risk getting [randomly evicted](https://redis.io/docs/latest/develop/reference/eviction/#eviction-policies) when you run out of memory for cache.
- You can't completely disable eviction either, as Redis then starts to refuse new entries once full, including new sessions.
- Either way, you should monitor your Redis instances and make sure you have enough memory set aside for active sessions/cache items.
- You can't completely disable eviction either, as the data store then starts to refuse new entries once full, including new sessions.
- Either way, you should monitor your data store instances and make sure you have enough memory set aside for active sessions/cache items.

Check failure on line 103 in docs/infrastructure_and_maintenance/sessions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/sessions.md#L103

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/sessions.md", "range": {"start": {"line": 103, "column": 142}}}, "severity": "ERROR"}

If you want to make sure sessions survive Redis or server restarts, consider using a [persistent Redis](https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/) instance for sessions.
If you want to make sure sessions survive data store or server restarts, consider setting up [persistent storage](https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/) instance for sessions.

##### Alternative storing sessions in database by using PDO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Useful commands:
php bin/console cache:clear --env prod
```

- clearing Redis cache
- clearing Redis/Valkey cache

```bash
php bin/console cache:pool:clear cache.redis
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/page_block_cache_clear.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

To clear the persistence cache run `./bin/console cache:pool:clear [cache-pool]` command.
The default cache-pool is named `cache.tagaware.filesystem`.
The default cache-pool when running redis is named `cache.redis`.
The default cache-pool when running Redis or Valkey is named `cache.redis`.
If you have customized the [persistence cache configuration](https://doc.ibexa.co/en/latest/infrastructure_and_maintenance/cache/persistence_cache/#what-is-cached), the name of your cache pool might be different.

In prod mode, you also need to clear the symfony cache by running `./bin/console c:c`.
In dev mode, the Symfony cache is rebuilt automatically.
In dev mode, the Symfony cache is rebuilt automatically.