Thanks for the information Muhammad. I want to add that similar optimizations can be done to pretty much any component used by the OpenWISP application, eg:
- Linux OS settings about networking, memory, swap usage - Redis - InfluxDB - SQL DB (depending on which one you're using) - Management VPN (depending on which one you're using) The optimizations will likely depend on your particular case (how much memory, CPU, storage you have available, what latency you have with devices, whether you have multiple machines or just 1, etc). Google and ChatGPT will help a lot to find more details about how to perform these optimizations. I hope this helps! Federico On Friday, July 26, 2024 at 5:55:14 AM UTC-4 Wit wrote: > Dear OpenWisp Community, > > I hope this message finds you well. > > I have been exploring ways to optimize the memory usage of Redis in our > OpenWisp deployments. After seeking advice, it was suggested to me that > adjusting the `maxmemory-policy` and `maxmemory` settings could help > improve performance and stability. > > ### Suggested Settings > > 1. **Maxmemory Policy:** > It was recommended to set the `maxmemory-policy` to `allkeys-lru`. This > policy helps manage memory usage by evicting the least recently used (LRU) > keys when the memory limit is reached. > > **Configuration:** > ```plaintext > maxmemory-policy allkeys-lru > ``` > > 2. **Maxmemory Size:** > As for the `maxmemory` setting, it was suggested to configure it based > on a percentage of the available RAM on the server. Allocating around 75% > of the total RAM for Redis could be a good starting point, while leaving > the remaining 25% for other processes and the operating system. > > **Configuration:** > ```plaintext > maxmemory <calculated value> > ``` > > ### Steps to Update Configuration > > 1. **Edit the Redis Configuration File:** > Open the Redis configuration file (`/etc/redis/redis.conf`) in a text > editor: > ```bash > sudo nano /etc/redis/redis.conf > ``` > > 2. **Update `maxmemory` and `maxmemory-policy`:** > Add or update the following lines as per your server's RAM percentage > allocation: > ```plaintext > maxmemory <calculated value> > maxmemory-policy allkeys-lru > ``` > > 3. **Save and Exit:** > Save the changes and exit the text editor. For `nano`, press `Ctrl+X`, > then `Y`, and then `Enter`. > > 4. **Restart Redis Server:** > Restart the Redis service to apply the changes: > ```bash > sudo systemctl restart redis-server > ``` > > I hope these suggestions are helpful. If anyone has further insights or > alternative recommendations, I would greatly appreciate your input. > > Best regards, And thanks ChatGPT 😁 > > Muhammad > -- You received this message because you are subscribed to the Google Groups "OpenWISP" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/a7eb6079-a30f-4531-a11d-cf72bd4e1c58n%40googlegroups.com.
