{"action":"created","issue":{"url":"https://api.github.com/repos/xapi-project/xen-api/issues/3329","repository_url":"https://api.github.com/repos/xapi-project/xen-api","labels_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3329/labels{/name}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3329/comments","events_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3329/events","html_url":"https://github.com/xapi-project/xen-api/pull/3329","id":270987758,"number":3329,"title":"[CA-271014] Only get local SRs on the physical utilisation thread","user":{"login":"mcintyre94","id":1711350,"avatar_url":"https://avatars1.githubusercontent.com/u/1711350?v=4","gravatar_id":"","url":"https://api.github.com/users/mcintyre94","html_url":"https://github.com/mcintyre94","followers_url":"https://api.github.com/users/mcintyre94/followers","following_url":"https://api.github.com/users/mcintyre94/following{/other_user}","gists_url":"https://api.github.com/users/mcintyre94/gists{/gist_id}","starred_url":"https://api.github.com/users/mcintyre94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcintyre94/subscriptions","organizations_url":"https://api.github.com/users/mcintyre94/orgs","repos_url":"https://api.github.com/users/mcintyre94/repos","events_url":"https://api.github.com/users/mcintyre94/events{/privacy}","received_events_url":"https://api.github.com/users/mcintyre94/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-03T14:00:20Z","updated_at":"2017-11-13T10:11:32Z","closed_at":"2017-11-09T15:50:15Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3329","html_url":"https://github.com/xapi-project/xen-api/pull/3329","diff_url":"https://github.com/xapi-project/xen-api/pull/3329.diff","patch_url":"https://github.com/xapi-project/xen-api/pull/3329.patch"},"body":"This greatly improves the performance of the pool master in a large pool. The current loop means that every 2 minutes each host in the pool queries, for each PBD (regardless of which host it's on), whether it's currently attached, and its SR. It then updates the xapi database with the RRDD physical utilisation value for those SRs it has the data. As an optimisation therefore, this commit adds a new method to only get PBDs on the calling host, and then the SRs for those will be those that it can update the RRDD data for.\r\n\r\nThe issue with this physical utilisation thread is the overhead on the pool master, which must handle all the database queries. This is now only one query to get the PBDs currently attached on the calling host, plus one more for each PBD currently plugged on localhost (to get its SR). It was previously one query to get all PBDs on the pool (regardless of host), plus an extra two queries for each PBD to get its currently_attached and then its SR.\r\n\r\nIf a pool has n hosts with m PBDs each (all currently attached), then we previously had n hosts making 2nm+1 database queries each every 2 minutes, and we now have n hosts making 1+m database queries each every 2 minutes.\r\n\r\nPassing BVT: suite run 73964\r\nAlso see the ticket for examples of performance improvement from this fix on a large pool\r\n\r\nSigned-off-by: Callum McIntyre <callum.mcintyre@citrix.com>"},"comment":{"url":"https://api.github.com/repos/xapi-project/xen-api/issues/comments/343872422","html_url":"https://github.com/xapi-project/xen-api/pull/3329#issuecomment-343872422","issue_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3329","id":343872422,"user":{"login":"robhoes","id":413005,"avatar_url":"https://avatars1.githubusercontent.com/u/413005?v=4","gravatar_id":"","url":"https://api.github.com/users/robhoes","html_url":"https://github.com/robhoes","followers_url":"https://api.github.com/users/robhoes/followers","following_url":"https://api.github.com/users/robhoes/following{/other_user}","gists_url":"https://api.github.com/users/robhoes/gists{/gist_id}","starred_url":"https://api.github.com/users/robhoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robhoes/subscriptions","organizations_url":"https://api.github.com/users/robhoes/orgs","repos_url":"https://api.github.com/users/robhoes/repos","events_url":"https://api.github.com/users/robhoes/events{/privacy}","received_events_url":"https://api.github.com/users/robhoes/received_events","type":"User","site_admin":false},"created_at":"2017-11-13T10:11:32Z","updated_at":"2017-11-13T10:11:32Z","author_association":"OWNER","body":"The fixup commit should have been squashed before merging."}}
{"actor":{"display_login":"robhoes"}}