Can EmonHub run out of memory?

Hi.

What will happen if a remote server (EmonCMS) is down for a longer period of time?

Will EmonHub keep storing buffers in the memory until the Raspberry Pi does not have any memory left?

If not, how much is the maximum amount of space that EmonHub can use?

pb66's picture

Re: Can EmonHub run out of memory?

The emonhub buffers have a default size of 1000 frames, frame sizes vary considerably depending on the count and types of variables etc. That size can be set in the [reporters] section of emonhub.conf.

Each reporter has it,s own buffer so the size can be set to a low number for a local emoncms whilst still maintaining a larger buffer for a remote emoncms.To change from the default of 1000 add a "buffer_size = 12345" line in a reporters [[[init_settings]]].

There are a lot of factors to consider if you decide to increase dramatically, I have one Pi that receives a 5 integer frame every 5 secs and that has a 30000 frame buffer which has absolutely no problem  running on a Pi B (512mb RAM) with raspian in read-only mode. Read-only is more RAM dependent as there is no caching and also the logfiles are written to RAM too. emonhubs logfiles are limited in size too so even if you have a runaway issue the emonhub logs cannot choke the Pi,

Because it's the number rather than the size of the buffers that is managed you will need to tally up the frequency and size of all your nodes to get an idea of how much time a buffer will cover and how much RAM will be used to do so.

I couldn't predict what the maximum would be that it could safetly use without causing issues for the OS etc that depends on what other stuff is going on but unless you are running many nodes with frequent and large data payloads and/or sending to several emoncms servers I would be very surprised if the buffers could choke a Pi with 512mb RAM, I have not tested an A (256mb) and expect the 2B (1024mb) to be way more superior.

See the emonhub's data buffers for a bit more info too.

Paul

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.