bench
bench copied to clipboard
Single Redis Instance per Bench
Is your feature request related to a problem? Please describe.
We have 3 Redis processes running each bench for cache, queue, and socketIO. Is this in any way required? I can seem to get away with using a single process locally. These are my config files:
./Procfile /* Combined the redis_queue, redis_socketio & redis_cache into a single redis job */
redis: redis-server config/redis.conf
web: bench serve --port 8000
socketio: /opt/homebrew/opt/node@14/bin/node apps/frappe/socketio.js
watch: bench watch
schedule: bench schedule
worker_short: bench worker --queue short 1>> logs/worker.log 2>> logs/worker.error.log
worker_long: bench worker --queue long 1>> logs/worker.log 2>> logs/worker.error.log
worker_default: bench worker --queue default 1>> logs/worker.log 2>> logs/worker.error.log
./config/redis.conf /* Combined config of the 3 - pretty similar overall; more evidence they should've always been just one */
dbfilename redis.rdb
dir /Users/gavin/Desktop/frappe-bench-dev/config/pids
pidfile /Users/gavin/Desktop/frappe-bench-dev/config/pids/redis.pid
bind 127.0.0.1
port 11000
maxmemory 100mb
maxmemory-policy allkeys-lru
appendonly no
save ""
aclfile /Users/gavin/Desktop/frappe-bench-dev/config/redis.acl
./sites/common_site_config.json /* excluded other keys that didn't have anything to do with ports or..well this */
{
"redis_cache": "redis://localhost:11000",
"redis_queue": "redis://localhost:11000",
"redis_socketio": "redis://localhost:11000",
"socketio_port": 9000,
"webserver_port": 8000
}
Describe the solution you'd like
I can seem to get away using separate redis processes locally. This brings down the minimum required bench processes (triggered by bench start) from 10 to 8. These redis processes are lightweight as it is, so not having them doesn't come with significant benefits but this just seems like an overkill setup.
I haven't ever used or tested this with an ACL setup so I don't know how it fares in those. But don't think there should be any noticeable difference.
Now, I think you can take this one step further too. If you have multiple benches on your server/cluster, have them all share a single hosted Redis instance. Might have to use ACL for this so that the sites don't interfere with each other...but that's just a couple of commands away. If you could really benefit from this, that's great but I'm not managing any deployments that big rn so idk :P