Improve Neos performance with Redis

Hi guys,

I’m wondering if this configuration makes sens to you.
My scenario, deploying to server where each build gets a new build folder on the server. Ideally the sessions shouldn’t be deleted so that an editor won’t get logged out while deployment. The Redis server is locally installed on the same machine.

I’m especially not sure about my configuration with:

  • Flow_Persistence_Doctrine:
  • Flow_Security_Authorization_Privilege_Method
  • Flow_Cache_ResourceFiles

Is there something I could do to even improve my Caches.yaml for Redis?

Thank you!

Neos_Fusion_Content:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 1

Flow_Mvc_Routing_Route:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 2

Flow_Mvc_Routing_Resolve:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 3

Flow_Persistence_Doctrine:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 4

Flow_Security_Authorization_Privilege_Method:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 5

Flow_Cache_ResourceFiles:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 6

Neos_Media_ImageSize:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 7

Flow_Session_Storage:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 8
  persistent: true

Flow_Session_MetaData:
  backend: Neos\Flow\Cache\Backend\RedisBackend
  backendOptions:
    hostname: 127.0.0.1
    port: 6379
    database: 9

`

For keeping logins over deployments we usually just declare the session caches as beeing persistent, that way this data ends up in Data/Persistent wich you have to share anyways :

Flow_Session_MetaData:
  persistent: true
Flow_Session_Storage:
 persistent: true

For the decision wich caches to put into redis i would mostly look into the number of files each cache holds. The file system is quite fast for a small number of files but performance rapidly drops especially if tags are invalidated for many seperate cache entries.

So lots of entries or lots of tags are a clear sign that redis will help you.

1 Like