Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace sirupsen/logrus with a more performant logger #131

Open
tzaffi opened this issue Aug 2, 2023 · 0 comments
Open

Replace sirupsen/logrus with a more performant logger #131

tzaffi opened this issue Aug 2, 2023 · 0 comments

Comments

@tzaffi
Copy link
Contributor

tzaffi commented Aug 2, 2023

Problem

In working on #128 , I ran some performance tests and noticed that log-level had a significant impact. logrus has been observed to be slow in go-algorand and there is an internal issue (2479) to replace it and a poc branch using zerolog.

Problematic experiment

Using the Justfile command

❯ just conduit-bootstrap-and-go 300

to bootstrap testnet and run a postgresql exporter against it for 300 seconds. I ran it a number of times against both the original pipeline and the new one. Here are the experimental results:

Log Level Reps Original rounds/300 sec (logs/round) Pipelining rounds/300 sec (logs/round) Pipelining v Original (%)
TRACE 3 3718 (7.0) 3509 (14.0) -5.6%
INFO 2 4578.5 (3.0) 4423.5 (3.0) -3.4%

So comparing the results within each column we can see:

  • 19% performance decline in the Original algorithm when going from 3 → 7 logs/round
  • 21% performance decline in the Pipelining algorithm when going from 3 → 14 logs/round

The sample was very noisy but it looks like each log per round is costing around 1-5 % hit in terms of performance.

Action Items

  1. A POC PR which let's us validate the performance implications of swapping out logrus for zerolog
  2. Decide if we want to allow "plug and play" logger capability (we have heard one community member make this suggestion)
  3. Switch all logs in conduit to the new logger (possibly via an interface if we opt for the "plug and play" approach)

More links

Dependencies

None

Urgency

Medium - as we're currently working on improving Conduit's performance, this seems like a useful avenue to persue.

@tzaffi tzaffi mentioned this issue Aug 10, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant