{"action":"created","issue":{"url":"https://api.github.com/repos/NLog/NLog/issues/1038","labels_url":"https://api.github.com/repos/NLog/NLog/issues/1038/labels{/name}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/1038/comments","events_url":"https://api.github.com/repos/NLog/NLog/issues/1038/events","html_url":"https://github.com/NLog/NLog/issues/1038","id":116730628,"number":1038,"title":"Performance problem when thread number is big","user":{"login":"emanov","id":710570,"avatar_url":"https://avatars.githubusercontent.com/u/710570?v=3","gravatar_id":"","url":"https://api.github.com/users/emanov","html_url":"https://github.com/emanov","followers_url":"https://api.github.com/users/emanov/followers","following_url":"https://api.github.com/users/emanov/following{/other_user}","gists_url":"https://api.github.com/users/emanov/gists{/gist_id}","starred_url":"https://api.github.com/users/emanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanov/subscriptions","organizations_url":"https://api.github.com/users/emanov/orgs","repos_url":"https://api.github.com/users/emanov/repos","events_url":"https://api.github.com/users/emanov/events{/privacy}","received_events_url":"https://api.github.com/users/emanov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NLog/NLog/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-11-13T09:19:45Z","updated_at":"2015-11-19T13:33:28Z","closed_at":null,"body":"\r\n[NLog.config.txt](https://github.com/NLog/NLog/files/33788/NLog.config.txt)\r\n[Processor.cs.txt](https://github.com/NLog/NLog/files/33789/Processor.cs.txt)\r\n[Program.cs.txt](https://github.com/NLog/NLog/files/33790/Program.cs.txt)\r\n\r\n\r\nHello!\r\n\r\nI'm developing the app with big number of the long running threads (900-2000). When thread number is big the program has high cpu usage. After profiling the program I found that NLog eats 30% of all CPU usage in the method WriteAsyncLogEvents. The Blocking GC is high too.\r\n\r\nWhen I have 10 process with 100 threads there is no any problem\r\n\r\nSo I write simple test for NLog, where all threads process one collection. Processing of each item do 4 call to Logger.Info() with intermediate pause about 80ms. Running this test with 900 threads leads to 30% CPU usage on my Corei5 processor. But when I start 9 processes with 100 threads per process (total is 900 too) the Cpu usage less then 2-3%.\r\n\r\nSo, I'm trying to find the way to have 900 threads and low cpu usage."},"comment":{"url":"https://api.github.com/repos/NLog/NLog/issues/comments/158057885","html_url":"https://github.com/NLog/NLog/issues/1038#issuecomment-158057885","issue_url":"https://api.github.com/repos/NLog/NLog/issues/1038","id":158057885,"user":{"login":"emanov","id":710570,"avatar_url":"https://avatars.githubusercontent.com/u/710570?v=3","gravatar_id":"","url":"https://api.github.com/users/emanov","html_url":"https://github.com/emanov","followers_url":"https://api.github.com/users/emanov/followers","following_url":"https://api.github.com/users/emanov/following{/other_user}","gists_url":"https://api.github.com/users/emanov/gists{/gist_id}","starred_url":"https://api.github.com/users/emanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanov/subscriptions","organizations_url":"https://api.github.com/users/emanov/orgs","repos_url":"https://api.github.com/users/emanov/repos","events_url":"https://api.github.com/users/emanov/events{/privacy}","received_events_url":"https://api.github.com/users/emanov/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T13:33:28Z","updated_at":"2015-11-19T13:33:28Z","body":"Sure, I'll make it tomorrow."}}