Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purge old messages when out of memory #121

Open
AlexeyKupershtokh opened this issue Jan 30, 2014 · 3 comments
Open

Purge old messages when out of memory #121

AlexeyKupershtokh opened this issue Jan 30, 2014 · 3 comments

Comments

@AlexeyKupershtokh
Copy link

Hello.

As I can see in the push_stream_shared_memory_size description:

The size of the memory chunk this module will use to store published messages, channels and other shared structures. When this memory is full any new request for publish a message or subscribe a channel will receive an 500 Internal Server Error response.

What is supposed to do when you get 500 trying to publish a mesasge?

I would prefer to have another option of the module behavior. I think it should (optionally) free memory when it needs more by freeing old messages. This way push_stream_message_ttl would have logic more like "try to keep messages for push_stream_message_ttl but can also delete them earlier".

E.g. this policy is available in Redis ( http://oldblog.antirez.com/post/redis-as-LRU-cache.html ):

Another way to use Redis as a cache is the maxmemory directive, a feature that allows specifying a maximum amount of memory to use. When new data is added to the server, and the memory limit was already reached, the server will remove some old data deleting a volatile key, that is, a key with an EXPIRE (a timeout) set, even if the key is still far from expiring automatically.

What do you think?

@joaoafrmartins
Copy link

Hello @wandenberg @AlexeyKupershtokh! +1

@misiek08
Copy link

It's a must have.

Some API to delete stored messages will be great too, but it's more advanced feature, so just freeing memory as needed will be ok.

@tomquas
Copy link

tomquas commented Sep 29, 2015

yes please. would be tremendously useful in my current setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants