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

How can I limit RAM usage in settings? #714

Open
pikhovkin opened this issue Feb 22, 2024 · 16 comments
Open

How can I limit RAM usage in settings? #714

pikhovkin opened this issue Feb 22, 2024 · 16 comments
Labels
question Further information is requested

Comments

@pikhovkin
Copy link

pikhovkin commented Feb 22, 2024

How can I limit RAM usage in settings?
For example, limit the use of RAM to no more than 1GB, but keep logs on the local storage system (SSD) for six months.

@hubcio hubcio added the question Further information is requested label Feb 22, 2024
@hubcio
Copy link
Collaborator

hubcio commented Feb 22, 2024

in server.toml you have cache section:
obraz

you can set the size to for example 1 GB, server will use a little more than that, (maybe 2 GB tops)

@pikhovkin
Copy link
Author

server will use a little more than that, (maybe 2 GB tops)

@hubcio this is a really helpful comment!

@pikhovkin
Copy link
Author

you can set the size to for example 1 GB

I set 512 MB for cache, but it doesn't work for Iggy 0.1.8, the RAM continues to increase. I stopped checking at 3GB RAM.

@hubcio
Copy link
Collaborator

hubcio commented Feb 25, 2024

@pikhovkin could you please share the logs? local_data/logs

@spetz
Copy link
Collaborator

spetz commented Feb 25, 2024

@pikhovkin does it happen immediately when starting the server or maybe after some time? There's also the setting called messages_required_to_save which is essentially responsible for keeping the unsaved messages in memory buffer, after they reach the provided threshold to be eventually saved onto the disk (or they can be saved in the background task, as specified in message_saver configuration). It's possible to have multiple partitions holding lots of messages in the buffer, which might increase the RAM usage. Also, another thing to consider are the indices (you can find the settings called cache_indexes and cache_time_indexes) - by default, a single index value is just 4 bytes, but once you have billions of messages, these could result in higher memory usage as well (unless you simply disable their cache).

@hubcio
Copy link
Collaborator

hubcio commented Feb 26, 2024

@pikhovkin can you also do this?

image

@hubcio
Copy link
Collaborator

hubcio commented Feb 26, 2024

@pikhovkin
for me, when I disable caching indexes and time indexes and use cache 512MB i get constant 1.3 GB memory usage.

@hubcio
Copy link
Collaborator

hubcio commented Feb 26, 2024

@pikhovkin FYI I created #724 to address this issue.

@hubcio
Copy link
Collaborator

hubcio commented Feb 27, 2024

@pikhovkin upon commiting of #658 problem will be partially resolved.

@hubcio
Copy link
Collaborator

hubcio commented Mar 1, 2024

@pikhovkin could you please check now (server 0.2.5), crates.io (0.2.7)

@pikhovkin
Copy link
Author

@pikhovkin could you please check now (server 0.2.5), crates.io (0.2.7)

Thanks @hubcio!
I can check it after resolving this issue

@hubcio
Copy link
Collaborator

hubcio commented Mar 2, 2024

@pikhovkin could you please check now (server 0.2.5), crates.io (0.2.7)

Thanks @hubcio! I can check it after resolving this issue

Alright, I will check it too.

@hubcio
Copy link
Collaborator

hubcio commented Jun 4, 2024

@pikhovkin it is now solved, can you try?

@pikhovkin
Copy link
Author

@hubcio
I can’t test it properly yet because of this error .

@pikhovkin
Copy link
Author

I still can't start properly iggy-rs/iggy-python-client#20

@hubcio
Copy link
Collaborator

hubcio commented Sep 25, 2024

@pikhovkin what about now? is everything ok?

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

No branches or pull requests

3 participants