Skip to content
Mark Friedrich edited this page Jul 20, 2018 · 5 revisions

PATHFINDER stores some cached data (SQL query results, key → value cache data) in tmp/cache/directory. This is fine for smaller installations (~50 active users). This is the default configuration.

For larger installations or better performance I recommend a in memory cache backend like Redis.

Advantages:

  • Redis is an in memory cache that stores all data in your RAM rather than on your slow HDD.
  • Redis dumps all data from time2time on your HDD. This helps to keep/reload data on server restart
  • Redis has an advanced search/write algorithm that speeds up Pathfinder a lot

Redis

Redis setup [optional]

  1. Install Redis PHP extension → https://serverpilot.io/community/articles/how-to-install-the-php-redis-extension.html
    • Check your showinfo();page for PHP. You should find something like: redis-php
    • Go to your /setup page and check the Requirements section: redis-requirements
  2. Install Redis server → https://redis.io/topics/quickstart
  3. Setup Redis as an LRU (Least recently used) cache → https://redis.io/topics/lru-cache
  4. [optional] Set Redis as default Session handler for all your PHP projects on your server. Change these lines in your php.ini:
    session.save_handler  = redis
    session.save_path     = "tcp://localhost:6380?database=0"
    

    Hint: Default Redis port is 6380. Redis spawns 15 empty databases on start. We take the first database=0 for all global PHP session data.

  5. Change CACHE value in your /app/config.ini file like this: CACHE = redis=localhost:6380:1
    CACHE                =   redis=localhost:6380:1
    SESSION_CACHE        =   default
    

    Hint: We use a fresh DB :1 for all Pathfinder related cache data. Change SESSION_CACHE to default in order to use the global PHP Session handler (see 4.)

Check if everything is working. Go to your /setup page and check the Directories section. If the PHP framework is able to connect to your new Redis server, the CACHE value has changed like this:

Redis-dir

If everything is working, the /tmp/cache directory should be empty all the time and is no longer used.

Clone this wiki locally