sonic icon indicating copy to clipboard operation
sonic copied to clipboard

Memory allocation while indexing data

Open amirEBD opened this issue 2 years ago • 6 comments

Hi @valeriansaliou , I had a great experience while using sonic, but the point is while indexing lots of data into sonic, the RAM usage will grow which is so ratinale. After finishing the indexing the RAM usage won't decrease as it is like sonic holds the memory. Would you have any suggestion for that?

image

PS: As I delete the container and recreate it the memory usage will be about 5 MBs

amirEBD avatar Jul 30 '22 05:07 amirEBD

Also I had an issue getting the amount of data inside the sonic. How can I get that? Cause sonic has no API for getting the volume size. Is it just using commands like sudo du data/?

amirEBD avatar Jul 30 '22 06:07 amirEBD

The allocator frees its memory, it’s just not given back to the system. In this case you should restart Sonic. This only occurs at import with a certain import speed that’s high.

valeriansaliou avatar Jul 30 '22 14:07 valeriansaliou

On the total data size, yes, you should use regular filesystem commands to check that. Sonic doesn’t provide anything to get the total size.

valeriansaliou avatar Jul 30 '22 14:07 valeriansaliou

Thanks for your answering Valerain, I have another question about a observation I had with sonic hard disk usage. As I create the docker container for sonic initially data/store directory is given but as I observed repeatedly the disk usage on / will increase realy much than expectation (about 100GBs). Will sonic use volumes other than data/store?

amirEBD avatar Jul 31 '22 06:07 amirEBD

Sonic only uses this directory to store its data. You can expect everything to be stored in this single folder. It should contain a kv and a fst folder.

valeriansaliou avatar Jul 31 '22 10:07 valeriansaliou

Try to check how many clients are connected during ingesting.

telnet ::1 1491
START control <PASSWORD>
INFO
QUIT

It will print something like this:

RESULT uptime(33270) clients_connected(35) commands_total(437461) command_latency_best(1) command_latency_worst(490) kv_open_count(0) fst_open_count(0) fst_consolidate_count(0)

Kryvchun avatar Dec 23 '22 04:12 Kryvchun