Great, I will try that.

Would it be okay for the app to use the following redis config:

maxmemory 2mb

maxmemory-policy allkeys-lru

From the docs: "all the keys will be evicted using an approximated LRU algorithm as long as we hit the 2 megabyte memory limit."

Source: https://redis.io/docs/management/config/#configuring-redis-as-a-cache

Reply to this note

Please Login to reply.

Discussion

Yes, your rate limits with long periods may become ineffective though with such a strict memory limit of 2mb. It may make sense to just get rid of them and just use short-period rate limits.

Now I understand it, thanks. I just realized that I have some rather old default limit in my settings, that is not in the current default-settings.yaml with a duration of 1d. First I'll get rid of this, let's see if it helps. I will document your tips in my github issue. Maybe someone else is having similar problems.

It seems I am back to square one: After removing rate limits no out-of-memory and no redis restarts had happened again. But still my invoice page goes offline now and then. No apparent entries in any logfile (nostream, nostream-cache, nostreamdb). 🤔

Enable debug logging on Nostream by setting the DEBUG env var to `worker:*`

Then go to your invoice page and inspect the logs.

Wow, this is a dense log! Thanks, I'll report back!

Oh no, this is embarrassing: I think I've finally found the problem and it has nothing to do with nostream. 🙈 It seems the main reason of my outages have been too low limits in my NGINX configuration (worker_connections & worker_rlimit_nofile). But thanks to your help I have improved swap and memory efficiency on the way. 🤙 I am 99% sure the problem is gone now. I'll wait some days and then document my findings in the issue and close it. Thanks for your help!

Glad you were able to solve it! 😎 If you get any more issues let me know.

That would be useful to mention in the README