1

I'm running a Netcore Web API through visual studio and after 40-60 requests it becomes unresponsive. Requests that would typically take under a second start taking over a minute.

I disabled the console logger and the API never slows down no matter how many requests I send to it.

Here is how I add the console logger:

loggerFactory.AddConsole( Configuration.GetSection( "Logging" ) );
  • We use NLog from web applications and web apis, and never seen any significant performance difference. It all depends on the config of NLog. Also it could depend on the indexes in your db. – Julian Jul 31 '18 at 21:13
  • Have you tried to use `` ? Maybe share your nlog.config, or do some profiling. – Rolf Kristensen Jul 31 '18 at 21:18
  • @Julian Just discovered that it isn't NLog but the console logger that is causing problems. – corey_trevor Jul 31 '18 at 21:27

1 Answers1

0

Unfortunately writing (multi threaded) to console is slow. It's not an limitation of NLog self.

See also Console.WriteLine slow

Julian
  • 33,915
  • 22
  • 119
  • 174