#History with External MariaDB is extremely slow

1 messages Β· Page 1 of 1 (latest)

haughty dragon
#

Hi all,

I am running an external mariadb on the same proxmox instance as homeassistance VM,
Whenever I request data, it is loading extremely slow,

What could be the cause?

#

Please let me know if there is more information required πŸ™‚

short zinc
#

What are the MariaDB settings? What hardware is it hosted on? What's top -co%CPU look like on that hardware? How large is the database/tables? Is MariaDB running on the same host as HA? If not, how are they connected? How much data and what kind are you requesting? Why are you not using SQLite? There's butt load of variables.

haughty dragon
#

Running on N150 in Proxmox,
Running mariadb because SQLITE was even slower as heck as well as that I wanted to have much longer data retention and because have some other applications using mariadb

For instance when I am requesting 2 weeks of data its already crunching gears

#

The current hardware settings

#

I forgot I put out this thread, my apologies πŸ™‚

#

And MariaDB

short zinc
haughty dragon
#

Ahhh that was all set by the helper-scripts script I used

short zinc
#

How large is the database? How large is buffer pool size? You usually want to have all the data in RAM.

haughty dragon
#

I dont have access to it right now but I haven't done changes to the database, just purely logged it in into the recordersettings which did all the creation for me

#

Yes its on network storage poor beelink is running out of space while my NAS is doing nothing but plex 😭

haughty dragon
short zinc
haughty dragon
#

It was just annoying that I wanted to compare long term data, example; what was the commute time last year/month/week around this time

It wasn't there

short zinc
#

The issue is all your settings are kind of bad 😐

#

Not everything goes into the Long Term stats but you can customize entities to go there. Just depends what you store exactly.

haughty dragon
short zinc
#

The recorder database is very inefficient for storing this kind of data. LTS summarizes it and makes it manageable.

haughty dragon
short zinc
#

Then you probably want to give the Database 16G of RAM and modify its settings accordingly.

haughty dragon
#

Wuuuuuffff okay. Thats 100% of ram πŸ˜„

short zinc
#

I'd first check if the recorder data goes into LTS or not though. You can likely just reduce the purge days to the default.

haughty dragon
#

Sooo, first of, home assistant side,

You mentioned the 2 sockets are wrong?

#

And the HOST or AES V2, which one would you recommend?

short zinc
#

If you go to node > Summary you can see the CPU layout of your node.

haughty dragon
#

Makes sense

short zinc
#

For a N150 just give the VM 2 to 4 cores and use host or the default AES v2 model.

haughty dragon
#

Only recently migrated to proxmox, have been rawdogging raspberry pi's for the past what, 4 years? πŸ˜‚

short zinc
#

I generally always give at least 2 cores to things. Over allocating is fine. You don't limit a process on your PC to a core either, right?

haughty dragon
#

Ur correct πŸ™‚

#

This is already great advice πŸ₯°

short zinc
#

I give frigate a core and a 0.5 CPU limit to reduce its overall usage for example. Opengrok too. The rest just get what they need with sane minimums.

#

For a VM if you give it 4G then you can consider it gone. The VM will use it for caches and such. For a CT it will only use what it actually needs as the kernel is shared with it. It's just a fancy isolated process.

haughty dragon
#

Yeah the ram on hass was constantly bumping into 100% so I kept upping it

#

It was already a godsend going from 2gb to 4

short zinc
#

I gave my VictoriaMetrics CT 32G and 8 cores for example. It only temporarily needs that if I go back years in grafana. A VM would be a bad idea here.

haughty dragon
#

πŸ˜‚

#

Ok changed it, hope it doesn't break so the household doesn't get upset πŸ‘

short zinc
#

If it's just a single node you can use host too.

haughty dragon
#

Yeah, more nodes will be added later down the road

#

But yknow, ram prices πŸ™

#

So, mariadb size I'll have to take a look at buffersize

short zinc
haughty dragon
#

It already seems a bit faster, or its just placebo

#

Thanks! Now I can finally also update whisper and piper πŸ™‚

#

People on the internet are quite contradicting about .raw vs .qcow2

haughty dragon
#

Ok.. strange, I gave the MariaDB LXC 40GBs but the container only tells me theres 20GB total available..

#

But this of course is more of a proxmoxproblem than a hass problem πŸ™‚

#

Which is now also fixed.

short zinc