{"action":"created","issue":{"url":"https://api.github.com/repos/RackHD/RackHD/issues/305","repository_url":"https://api.github.com/repos/RackHD/RackHD","labels_url":"https://api.github.com/repos/RackHD/RackHD/issues/305/labels{/name}","comments_url":"https://api.github.com/repos/RackHD/RackHD/issues/305/comments","events_url":"https://api.github.com/repos/RackHD/RackHD/issues/305/events","html_url":"https://github.com/RackHD/RackHD/issues/305","id":164614184,"number":305,"title":"mongo store publishRecordByGraphId needs optimization","user":{"login":"benbp","id":1020379,"avatar_url":"https://avatars.githubusercontent.com/u/1020379?v=3","gravatar_id":"","url":"https://api.github.com/users/benbp","html_url":"https://github.com/benbp","followers_url":"https://api.github.com/users/benbp/followers","following_url":"https://api.github.com/users/benbp/following{/other_user}","gists_url":"https://api.github.com/users/benbp/gists{/gist_id}","starred_url":"https://api.github.com/users/benbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbp/subscriptions","organizations_url":"https://api.github.com/users/benbp/orgs","repos_url":"https://api.github.com/users/benbp/repos","events_url":"https://api.github.com/users/benbp/events{/privacy}","received_events_url":"https://api.github.com/users/benbp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-08T20:52:27Z","updated_at":"2016-07-08T20:56:51Z","closed_at":null,"body":"Reference code: https://github.com/RackHD/on-core/blob/master/lib/workflow/stores/mongo.js#L18-L23\r\n\r\nI found this during some other bottleneck/performance debugging. There are two things we could improve here:\r\n\r\n1. We are doing an entire collection scan against mongo, so we should probably add an index for `instanceId`, which we don't have right now (only against `_id`).\r\n2. We are publishing the entire graph object over AMQP. This is not a small object (a couple MBs), and could probably be optimized to publish just a resource id (instanceId or URI) and other relevant fields rather than the whole thing.\r\n\r\nFYI @zyoung51 @rolandpoulter @VulpesArtificem "},"comment":{"url":"https://api.github.com/repos/RackHD/RackHD/issues/comments/231470698","html_url":"https://github.com/RackHD/RackHD/issues/305#issuecomment-231470698","issue_url":"https://api.github.com/repos/RackHD/RackHD/issues/305","id":231470698,"user":{"login":"benbp","id":1020379,"avatar_url":"https://avatars.githubusercontent.com/u/1020379?v=3","gravatar_id":"","url":"https://api.github.com/users/benbp","html_url":"https://github.com/benbp","followers_url":"https://api.github.com/users/benbp/followers","following_url":"https://api.github.com/users/benbp/following{/other_user}","gists_url":"https://api.github.com/users/benbp/gists{/gist_id}","starred_url":"https://api.github.com/users/benbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbp/subscriptions","organizations_url":"https://api.github.com/users/benbp/orgs","repos_url":"https://api.github.com/users/benbp/repos","events_url":"https://api.github.com/users/benbp/events{/privacy}","received_events_url":"https://api.github.com/users/benbp/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T20:56:51Z","updated_at":"2016-07-08T20:56:51Z","body":"Relevant data, a non-trivial chunk was spent on the publish record call.\r\n\r\n[flamegraph.zip](https://github.com/RackHD/RackHD/files/355104/flamegraph.zip)"}}
{"actor":{"display_login":"benbp"}}