{"action":"created","issue":{"url":"https://api.github.com/repos/PowerDNS/pdns/issues/661","labels_url":"https://api.github.com/repos/PowerDNS/pdns/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/PowerDNS/pdns/issues/661/comments","events_url":"https://api.github.com/repos/PowerDNS/pdns/issues/661/events","html_url":"https://github.com/PowerDNS/pdns/issues/661","id":13684999,"number":661,"title":"pipe backend massive slowness on multicore machines & fix","user":{"login":"Habbie","id":525838,"avatar_url":"https://avatars.githubusercontent.com/u/525838?v=3","gravatar_id":"","url":"https://api.github.com/users/Habbie","html_url":"https://github.com/Habbie","followers_url":"https://api.github.com/users/Habbie/followers","following_url":"https://api.github.com/users/Habbie/following{/other_user}","gists_url":"https://api.github.com/users/Habbie/gists{/gist_id}","starred_url":"https://api.github.com/users/Habbie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Habbie/subscriptions","organizations_url":"https://api.github.com/users/Habbie/orgs","repos_url":"https://api.github.com/users/Habbie/repos","events_url":"https://api.github.com/users/Habbie/events{/privacy}","received_events_url":"https://api.github.com/users/Habbie/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PowerDNS/pdns/labels/auth-3.2","name":"auth-3.2","color":"eb6420"},{"url":"https://api.github.com/repos/PowerDNS/pdns/labels/defect","name":"defect","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2013-04-26T11:37:02Z","updated_at":"2015-10-01T13:14:35Z","closed_at":"2015-10-01T13:14:35Z","body":"I was doing some performance testing on our 32-way servers and discovered that in the simple case where the test program returns the data straight away, about 80% of the time was being spent in the kernel in a spinlock. I've been debugging this looking at the coprocess code and discovered that this is due to the following line in coprocess.cc:\r\n\r\nsetbuf(d_fp,0); // no buffering please, confuses select\r\n\r\nIf this is removed, performance in my particular test case goes from 2000qps with powerdns running at about 2000% cpu to 10000qps with powerdns using about 300% cpu.\r\n\r\nObviously the comment implies that this is not a permanent solution, I guess if the timeout is specified as 0 then the select code won't be executed and so you can disable the setbuf easily enough. However perhaps if the timeout is wanted you could set an alarm() rather than using select?\r\n\r\nMark"},"comment":{"url":"https://api.github.com/repos/PowerDNS/pdns/issues/comments/144722788","html_url":"https://github.com/PowerDNS/pdns/issues/661#issuecomment-144722788","issue_url":"https://api.github.com/repos/PowerDNS/pdns/issues/661","id":144722788,"user":{"login":"Habbie","id":525838,"avatar_url":"https://avatars.githubusercontent.com/u/525838?v=3","gravatar_id":"","url":"https://api.github.com/users/Habbie","html_url":"https://github.com/Habbie","followers_url":"https://api.github.com/users/Habbie/followers","following_url":"https://api.github.com/users/Habbie/following{/other_user}","gists_url":"https://api.github.com/users/Habbie/gists{/gist_id}","starred_url":"https://api.github.com/users/Habbie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Habbie/subscriptions","organizations_url":"https://api.github.com/users/Habbie/orgs","repos_url":"https://api.github.com/users/Habbie/repos","events_url":"https://api.github.com/users/Habbie/events{/privacy}","received_events_url":"https://api.github.com/users/Habbie/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T13:14:35Z","updated_at":"2015-10-01T13:14:35Z","body":"I'm closing all two-year-old profiling/performance tickets."}}