Redis Database using 10GB of RAM.
iwannet opened this issue · comments
Describe the Bug
When running the newest version of Viewtube, the viewtube redis database uses so much RAM that my server begins lagging and eventually crashes. It uses almost 10 GB of RAM.
Steps to Reproduce the Bug
I just updated to the newest version.
Screenshot/Screen recording
This is a screenshot from glances
Device Info
- System: 16GB RAM in total
Logs
1:C 13 Jun 2024 12:33:52.206 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see jemalloc/jemalloc#1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:C 13 Jun 2024 12:33:52.206 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 13 Jun 2024 12:33:52.206 * Redis version=7.2.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 13 Jun 2024 12:33:52.206 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 13 Jun 2024 12:33:52.206 * monotonic clock: POSIX clock_gettime
1:M 13 Jun 2024 12:33:52.206 * Running mode=standalone, port=6379.
1:M 13 Jun 2024 12:33:52.207 * Server initialized
1:M 13 Jun 2024 12:33:52.208 * Loading RDB produced by version 7.2.5
1:M 13 Jun 2024 12:33:52.208 * RDB age 2027 seconds
1:M 13 Jun 2024 12:33:52.208 * RDB memory usage when created 10514.71 Mb
1:M 13 Jun 2024 12:34:07.864 * Done loading RDB, keys loaded: 2811, keys expired: 4.
1:M 13 Jun 2024 12:34:07.864 * DB loaded from disk: 15.657 seconds
1:M 13 Jun 2024 12:34:07.864 * Ready to accept connections tcp
Hi, I just added a section to the docs for this! You can configure the redis memory limit like so:
https://viewtube.wiki/configuration/advanced#redis-configuration
So its normal that it uses 10GB of RAM ?
So its normal that it uses 10GB of RAM ?
Yes, redis will just use as much ram as the system has available. But it is recommended to restrict it.
At how many should i put it for viewtube to still work normally ?
At how many should i put it for viewtube to still work normally ?
It will work fine with 1-2 GB. If you have a lot of users (in the thousands) on your instance, raising the limit will improve performance.
Thank you for the help !