Cache index file Expansion and file repair

Index File Expansion

When the following message appears in the /usr/local/oredge-node/logs/error.log error log, it indicates that the required size of the cache index file has exceeded the currently configured value:

"cache index database is full: MDB_MAP_FULL: Environment mapsize limit reached, considering raising the map size?"

This issue does not affect data forwarding but impacts the HTTP cache purge functionality. In such cases, we must expand the cache index file according to requirements.

Expansion Steps in new Versions

Run the script expand-cache-index-lmdb.sh to perform expansion. The script supports specifying the file size after expansion, with the unit in megabytes.

This script was first introduced in OpenResty Edge 25.6.15-1.

For example, adjust the size to 1024m (1GB).

sudo /usr/local/oredge-node/bin/expand-cache-index-lmdb.sh 1024

Expansion Steps in Older Versions

If your OpenResty Edge version is lower than 25.6.15-1, you need to manually modify the configuration files for expansion.

  1. Modify the /usr/local/oredge-node/conf/nginx.conf configuration:

    cache_index_map_size 1024m;
    

    Adjust the size to the required value, for example, 1024m (1GB).

  2. Modify the /usr/local/oredge-node/conf/config.ini configuration file, add the following content:

    [cache]
    lmdb_size = 1024m
    

    Ensure that this size matches the value in nginx.conf.

    Note: For OpenResty Edge versions lower than 23.6.1, you need to configure this in /usr/local/oredge-node/conf/or-config.ini, and notify us to update the configuration package to prevent it from being restored during upgrades.

  3. Restart the OpenResty Edge Node:

    systemctl start upgrade-oredge-node
    
  4. Verify if the configuration has taken effect:

    ls -lh /usr/local/oredge-node/data/cache_index.lmdb
    

    If the displayed size matches the configured size (e.g., 1GB), it indicates that the configuration has taken effect.