M
M
Mitya ToDaSyo2018-12-23 05:06:19
Journaling
Mitya ToDaSyo, 2018-12-23 05:06:19

Checking with a log entry, where to store the log in the database or in a file?

I'm learning not to throw rotten tomatoes! )
Task - you need to send a request to the API once every 5 minutes, get a response and add a line to the log log
. I tried to log in a file, but noticed that the load on the processor had risen.
Question - if you transfer the storage of logs to the database, will this reduce the load? And if so, what type of cell is best to use?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
stratosmi, 2018-12-23
@dimastik1986

Sequential logging of logs to regular files is the most minimally loading system entry.
If you don't, look for the problem.
With a DB - there will be more loading in the general case.
Do like this:
See the principles of ELK operation.
If the load is small, then you can immediately go to the database.
But, based on the fact that even simple writing to files slows you down - I would not go into the database.

V
Vitaly, 2018-12-23
@rim89

In the files it is very problematic then to look for something.
If we consider mySql, then, as an option, a table of type Archive

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question