How can logging impact a Golang backend?

submited by
Style Pass
2024-05-14 12:30:08

This article is the answer to a small question I have always asked myself developing a backend. How much logging impact the performance? Is there a good reason why we keep the logging level to ERROR in production?

Since I was already playing with my Golang backend for my hobby project binary-duel, I decided to add a simple route with two configurable parameters:

I used https://www.npmjs.com/package/autocannon to load test this route with different (number of logs, size) combination, and finally extract metrics. The idea is to send as many requests as possible in 10 seconds.

Leave a Comment