{"action":"created","issue":{"url":"https://api.github.com/repos/erlcloud/erlcloud/issues/325","repository_url":"https://api.github.com/repos/erlcloud/erlcloud","labels_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/325/comments","events_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/325/events","html_url":"https://github.com/erlcloud/erlcloud/issues/325","id":183514643,"number":325,"title":"Signing AWS request takes a surprisingly long time.","user":{"login":"MikeBenza","id":7649685,"avatar_url":"https://avatars.githubusercontent.com/u/7649685?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeBenza","html_url":"https://github.com/MikeBenza","followers_url":"https://api.github.com/users/MikeBenza/followers","following_url":"https://api.github.com/users/MikeBenza/following{/other_user}","gists_url":"https://api.github.com/users/MikeBenza/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeBenza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeBenza/subscriptions","organizations_url":"https://api.github.com/users/MikeBenza/orgs","repos_url":"https://api.github.com/users/MikeBenza/repos","events_url":"https://api.github.com/users/MikeBenza/events{/privacy}","received_events_url":"https://api.github.com/users/MikeBenza/received_events","type":"User","site_admin":false},"labels":[{"id":378996147,"url":"https://api.github.com/repos/erlcloud/erlcloud/labels/bug","name":"bug","color":"b60205","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-17T20:10:34Z","updated_at":"2016-12-09T10:32:11Z","closed_at":null,"body":"We have an application in development that executes multiple queries to DynamoDB in parallel.  I noticed the queries seemed to take unusually long even though they were returning no data ~~(sometimes up to 1 second to execute all 16 parallel queries on an m4.xlarge instance)~~.\n\nI profiled it and noticed ~~two things:~~ the time to sign a single request is long (~9ms) ~~, and when executed in parallel the performance is much much worse.  This issue is to deal with the case of a single signing taking a long time~~.\n\nI created the attached analysis with the following code.  al_erlcloud is a library we have that helps generate our default AWS configuration.\n\n``` erl\nfprof:trace([start, {file, \"/tmp/single.trace\"}, verbose]).\nerlcloud_aws:sign_v4_headers(al_erlcloud:default_config(), [], <<\"Test body\">>, \"us-east-1.dynamodb.aws.com\", \"dynamodb\").\nfprof:trace([stop]).\nfprof:profile({file, \"/tmp/single.trace\"}).\nfprof:analyse([totals, {dest, \"/tmp/single.analysis.txt\"}]).\n\n```\n\n[single.analysis.txt](https://github.com/erlcloud/erlcloud/files/533968/single.analysis.txt)\n\nEdit: I think I was misreading the fprof outputs for the parallel tests, so the parallel case doesn't seem much worse, just not as good as I'd hoped -- 94ms to sign 16 requests in parallel (5.85ms per signing) compared to 9ms to sign one request.\n"},"comment":{"url":"https://api.github.com/repos/erlcloud/erlcloud/issues/comments/265982784","html_url":"https://github.com/erlcloud/erlcloud/issues/325#issuecomment-265982784","issue_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/325","id":265982784,"user":{"login":"motobob","id":5736793,"avatar_url":"https://avatars.githubusercontent.com/u/5736793?v=3","gravatar_id":"","url":"https://api.github.com/users/motobob","html_url":"https://github.com/motobob","followers_url":"https://api.github.com/users/motobob/followers","following_url":"https://api.github.com/users/motobob/following{/other_user}","gists_url":"https://api.github.com/users/motobob/gists{/gist_id}","starred_url":"https://api.github.com/users/motobob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motobob/subscriptions","organizations_url":"https://api.github.com/users/motobob/orgs","repos_url":"https://api.github.com/users/motobob/repos","events_url":"https://api.github.com/users/motobob/events{/privacy}","received_events_url":"https://api.github.com/users/motobob/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T10:32:11Z","updated_at":"2016-12-09T10:32:11Z","body":"after added base16 dep \r\n[single.analysis.new.txt](https://github.com/erlcloud/erlcloud/files/641886/single.analysis.new.txt)\r\n\r\nhappy to close? "}}
{"actor":{"display_login":"motobob"}}