I’m running the TICK image on Digital Ocean. I set this up as a logging server for a web application I run. It worked great originally, but over time I noticed performance in Chronograph tanking. About a month ago my web application was unable to send cURL requests to Influx and I was getting all sorts errors. The influx process would sit at like 100% CPU utilization and connections would time out.
The first thing I tried was changing the indexes from inmem to tsi1. This fixed the CPU problem but now influx was using every last bit of available memory; I couldn’t even reboot the server from my SSH client.
I temporarily increased the memory capacity from 1GB to 2GB, but I don’t have any interest in paying an extra $5/mo for that. I can’t think of any reason why influx would need that much memory.
How can I reduce it’s memory usage? I have two main measurements with about 20M rows between them. The larger one has two continuous queries (by hour and by date). The smaller one does not have any. I have not configured any retention policies.
Would this be as simple as creating a retention policy that will truncate some of the older data? Perhaps keeping these raw tables at just a few million records would work? I’m more familiar with MySQL, so forgive my inexperience here. Thanks for the help!
Thanks for your patience! I’m looking into it now. Your cardinality isn’t too high, so that should be okay. Sometimes, people limit the amount of memory InfluxDB can use because of this, but I’m chatting with the team to see what we can do.
Important: I had to get this up and running so I dropped the measurement with 8M records (otherservice_api_log). This dropped my memory usage from something like 1.2GB to maybe 800MB. It’s risen a bit since then. I still have this server configured to 2GB of memory but I would like to bring it back down to 1GB.
According to pmap, InfuxDB is using 347MB of RAM, which is close to the 35.3% of the 908MiB of RAM in use, as seen in htop. I’d say the pmap and htop where at sightly different times, hence the small discrepancy.
It’s actually using 703M. The RES column from htop specifies the actual amount of physical memory in use. That is 77% of the in-use memory and 35% of the available memory.
I’m not sure how to interpret the pmap results. At the bottom it seems to indicate that nearly 3G is in use.
I know this is apples to oranges, but my MySQL server which has a 200GB table that is very actively used is sitting at 571M. My Influx server is almost 100% writes; I only open the Chronograph dashboard a couple times a day.
Interestingly, if I run the queries on that dashboard directly from the console only 200M of additional memory is used; so not sure what overhead Chronograph has.
I don’t really want to create a cgroup; I always wanted this to just be an easy logging solution that required very little configuration. If there’s no trivial way to specify a max memory usage in the Influx config, maybe I just need to reduce the cardinality or amount of data I’m storing.
This mostly seems to be an issue with this one measurement. The api_log measurement with 12M records performs incredibly well. I can read the past year of data rapidly and without high memory usage.
If I paste some more detailed information here would you be able to suggest some improvements to the schema? Is there anything specific you want to see?
Yeah I’ll be busy too as soon as my kids wake up; thanks for the help! I didn’t bother censoring anything below…it’s not really worth it at this point. Edit: They’re awake. Send help.