Cache index file Expansion and file repair

Index file expansion

When the error log file /usr/local/oredge-node/logs/error.log shows “cache index database is full: MDB_MAP_FULL: Environment mapsize limit reached, considering raising the map size? raising the map size?” means that the required size of the cache index file exceeds the currently configured value. This problem does not affect data forwarding, but only HTTP cache cleanup.

In this case, we should expand the cache index file according to the actual situation.

Steps to expand

  • Modify the nginx.conf configuration: /usr/local/oredge-node/conf/nginx.conf
cache_index_map_size 1024m.

Modify the size to the desired value, e.g. 1024m (1GB).

  • Modify the config.ini configuration: /usr/local/oredge-node/conf/config.ini and add the following configuration:

Note: If you are using an OpenResty Edge version lower than 23.6.1, you need to configure in /usr/local/oredge-node/conf/or-config.ini. At the same time, you need to notify us to update your configuration package, otherwise, subsequent package upgrades will restore your modifications.

[cache]
lmdb_size = 1024m

Change the size to the desired value, e.g. 1024m (1GB). This configuration needs to be consistent with the value in nginx.conf.

  • Restart the OpenResty Edge Node
systemctl start upgrade-oredge-node
  • To check if the configuration is in effect:
ls -lh /usr/local/oredge-node/data/cache_index.lmdb

When you see the size change to the configured size (e.g. 1GB), the configuration takes effect.

Index file repair

When “cache index unable to seek cursor: MDB_CORRUPTED: Located page was wrong type” appears in the error log file /usr/local/oredge-node/logs/error.log This means that the index file has been corrupted, so you need to delete the index file. Deleting the index file will cause the cache purge function to fail for files that have already been cached.

Most of the time, this problem is caused by an unexpected shutdown of the index file before the data is synced to disk, such as an unexpected power failure.

Delete the old index file and restart the OpenResty Edge Node

  • Delete the old index file
sudo rm -fr /usr/local/oredge-node/data/cache_index.lmdb/*
  • Restart the OpenResty Edge Node
systemctl start upgrade-oredge-node