{"action":"created","comment":{"url":"https://api.github.com/repos/influxdb/influxdb/pulls/comments/44041818","id":44041818,"diff_hunk":"@@ -61,6 +70,9 @@ type Client interface {\n \t// Query makes an InfluxDB Query on the database. This will fail if using\n \t// the UDP client.\n \tQuery(q Query) (*Response, error)\n+\n+\t// Close releases any resources a Client may be using.\n+\tClose() error","path":"client/v2/client.go","position":22,"original_position":22,"commit_id":"13bd87043f622ad1f6e51ff6af6cf3af61e3b04d","original_commit_id":"1eb5f8ab0a7c2359e903a89771210a6bdde47cc6","user":{"login":"sparrc","id":7155926,"avatar_url":"https://avatars.githubusercontent.com/u/7155926?v=3","gravatar_id":"","url":"https://api.github.com/users/sparrc","html_url":"https://github.com/sparrc","followers_url":"https://api.github.com/users/sparrc/followers","following_url":"https://api.github.com/users/sparrc/following{/other_user}","gists_url":"https://api.github.com/users/sparrc/gists{/gist_id}","starred_url":"https://api.github.com/users/sparrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparrc/subscriptions","organizations_url":"https://api.github.com/users/sparrc/orgs","repos_url":"https://api.github.com/users/sparrc/repos","events_url":"https://api.github.com/users/sparrc/events{/privacy}","received_events_url":"https://api.github.com/users/sparrc/received_events","type":"User","site_admin":false},"body":"I'd rather not make users create their own `net.Conn`, seems overly complicated. IMO it's okay to have a `Close()` function without an `Open()`. In the `net` library itself the `Close()` function is paired with the `DialUDP()` function.\r\n\r\nThis also means that we need `NewUDPClient` to return an error, correct?","created_at":"2015-11-05T17:34:45Z","updated_at":"2015-11-05T17:34:45Z","html_url":"https://github.com/influxdb/influxdb/pull/4664#discussion_r44041818","pull_request_url":"https://api.github.com/repos/influxdb/influxdb/pulls/4664","_links":{"self":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/comments/44041818"},"html":{"href":"https://github.com/influxdb/influxdb/pull/4664#discussion_r44041818"},"pull_request":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4664"}}},"pull_request":{"url":"https://api.github.com/repos/influxdb/influxdb/pulls/4664","id":49779194,"html_url":"https://github.com/influxdb/influxdb/pull/4664","diff_url":"https://github.com/influxdb/influxdb/pull/4664.diff","patch_url":"https://github.com/influxdb/influxdb/pull/4664.patch","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/4664","number":4664,"state":"open","locked":false,"title":"Increase performance of the UDP client","user":{"login":"nkatsaros","id":595927,"avatar_url":"https://avatars.githubusercontent.com/u/595927?v=3","gravatar_id":"","url":"https://api.github.com/users/nkatsaros","html_url":"https://github.com/nkatsaros","followers_url":"https://api.github.com/users/nkatsaros/followers","following_url":"https://api.github.com/users/nkatsaros/following{/other_user}","gists_url":"https://api.github.com/users/nkatsaros/gists{/gist_id}","starred_url":"https://api.github.com/users/nkatsaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkatsaros/subscriptions","organizations_url":"https://api.github.com/users/nkatsaros/orgs","repos_url":"https://api.github.com/users/nkatsaros/repos","events_url":"https://api.github.com/users/nkatsaros/events{/privacy}","received_events_url":"https://api.github.com/users/nkatsaros/received_events","type":"User","site_admin":false},"body":"I made the UDP client only resolve and dial once, when it's created. This does two things: it makes Write significantly faster, and it pushes name resolution errors to when you first create the client. \r\n\r\nI also added a buffer size knob the new UDP config struct I created. This is very important, as before the client was likely broken unless you were using it on your own machine. MTUs will generally not be ~65000, they will be more like 1500 or 500 and this needs to be tuneable if people plan on using this client over the internet. Unfortunately, UDPConn.SetReadBuffer sets the OS read buffer size and will not change the maximum size datagram you can receive so I removed it.\r\n\r\nLastly, in the UDP service I moved buffer creation outside of the loop to save allocations.\r\n\r\nThis is just an idea. I don't know if you'd want to commit to an extra function on the Client interface or the UDPConfig struct, but I believe they are necessary.\r\n\r\n","created_at":"2015-11-05T03:43:06Z","updated_at":"2015-11-05T17:34:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89ca033e3fbaa9515b5f57ed9a42bf79dbb07456","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/influxdb/influxdb/pulls/4664/commits","review_comments_url":"https://api.github.com/repos/influxdb/influxdb/pulls/4664/comments","review_comment_url":"https://api.github.com/repos/influxdb/influxdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4664/comments","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/13bd87043f622ad1f6e51ff6af6cf3af61e3b04d","head":{"label":"nkatsaros:udp-client-fixes","ref":"udp-client-fixes","sha":"13bd87043f622ad1f6e51ff6af6cf3af61e3b04d","user":{"login":"nkatsaros","id":595927,"avatar_url":"https://avatars.githubusercontent.com/u/595927?v=3","gravatar_id":"","url":"https://api.github.com/users/nkatsaros","html_url":"https://github.com/nkatsaros","followers_url":"https://api.github.com/users/nkatsaros/followers","following_url":"https://api.github.com/users/nkatsaros/following{/other_user}","gists_url":"https://api.github.com/users/nkatsaros/gists{/gist_id}","starred_url":"https://api.github.com/users/nkatsaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkatsaros/subscriptions","organizations_url":"https://api.github.com/users/nkatsaros/orgs","repos_url":"https://api.github.com/users/nkatsaros/repos","events_url":"https://api.github.com/users/nkatsaros/events{/privacy}","received_events_url":"https://api.github.com/users/nkatsaros/received_events","type":"User","site_admin":false},"repo":{"id":45577696,"name":"influxdb","full_name":"nkatsaros/influxdb","owner":{"login":"nkatsaros","id":595927,"avatar_url":"https://avatars.githubusercontent.com/u/595927?v=3","gravatar_id":"","url":"https://api.github.com/users/nkatsaros","html_url":"https://github.com/nkatsaros","followers_url":"https://api.github.com/users/nkatsaros/followers","following_url":"https://api.github.com/users/nkatsaros/following{/other_user}","gists_url":"https://api.github.com/users/nkatsaros/gists{/gist_id}","starred_url":"https://api.github.com/users/nkatsaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkatsaros/subscriptions","organizations_url":"https://api.github.com/users/nkatsaros/orgs","repos_url":"https://api.github.com/users/nkatsaros/repos","events_url":"https://api.github.com/users/nkatsaros/events{/privacy}","received_events_url":"https://api.github.com/users/nkatsaros/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nkatsaros/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":true,"url":"https://api.github.com/repos/nkatsaros/influxdb","forks_url":"https://api.github.com/repos/nkatsaros/influxdb/forks","keys_url":"https://api.github.com/repos/nkatsaros/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nkatsaros/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nkatsaros/influxdb/teams","hooks_url":"https://api.github.com/repos/nkatsaros/influxdb/hooks","issue_events_url":"https://api.github.com/repos/nkatsaros/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/nkatsaros/influxdb/events","assignees_url":"https://api.github.com/repos/nkatsaros/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/nkatsaros/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/nkatsaros/influxdb/tags","blobs_url":"https://api.github.com/repos/nkatsaros/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nkatsaros/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nkatsaros/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/nkatsaros/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nkatsaros/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/nkatsaros/influxdb/languages","stargazers_url":"https://api.github.com/repos/nkatsaros/influxdb/stargazers","contributors_url":"https://api.github.com/repos/nkatsaros/influxdb/contributors","subscribers_url":"https://api.github.com/repos/nkatsaros/influxdb/subscribers","subscription_url":"https://api.github.com/repos/nkatsaros/influxdb/subscription","commits_url":"https://api.github.com/repos/nkatsaros/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/nkatsaros/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/nkatsaros/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/nkatsaros/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/nkatsaros/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/nkatsaros/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nkatsaros/influxdb/merges","archive_url":"https://api.github.com/repos/nkatsaros/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nkatsaros/influxdb/downloads","issues_url":"https://api.github.com/repos/nkatsaros/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/nkatsaros/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/nkatsaros/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/nkatsaros/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nkatsaros/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/nkatsaros/influxdb/releases{/id}","created_at":"2015-11-05T00:56:57Z","updated_at":"2015-11-05T00:57:02Z","pushed_at":"2015-11-05T14:53:45Z","git_url":"git://github.com/nkatsaros/influxdb.git","ssh_url":"git@github.com:nkatsaros/influxdb.git","clone_url":"https://github.com/nkatsaros/influxdb.git","svn_url":"https://github.com/nkatsaros/influxdb","homepage":"http://influxdb.com","size":64072,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"influxdb:master","ref":"master","sha":"780df574bbe14e8878e1726c7e78b9e9790a7109","user":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"name":"influxdb","full_name":"influxdb/influxdb","owner":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdb/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdb/influxdb","forks_url":"https://api.github.com/repos/influxdb/influxdb/forks","keys_url":"https://api.github.com/repos/influxdb/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdb/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdb/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdb/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdb/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdb/influxdb/events","assignees_url":"https://api.github.com/repos/influxdb/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdb/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdb/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdb/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdb/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdb/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdb/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdb/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdb/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdb/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdb/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdb/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdb/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdb/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdb/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdb/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdb/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdb/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdb/influxdb/merges","archive_url":"https://api.github.com/repos/influxdb/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdb/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdb/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdb/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdb/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdb/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdb/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdb/influxdb/releases{/id}","created_at":"2013-09-26T14:31:10Z","updated_at":"2015-11-05T14:20:58Z","pushed_at":"2015-11-05T17:33:55Z","git_url":"git://github.com/influxdb/influxdb.git","ssh_url":"git@github.com:influxdb/influxdb.git","clone_url":"https://github.com/influxdb/influxdb.git","svn_url":"https://github.com/influxdb/influxdb","homepage":"http://influxdb.com","size":64072,"stargazers_count":6658,"watchers_count":6658,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":768,"mirror_url":null,"open_issues_count":421,"forks":768,"open_issues":421,"watchers":6658,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4664"},"html":{"href":"https://github.com/influxdb/influxdb/pull/4664"},"issue":{"href":"https://api.github.com/repos/influxdb/influxdb/issues/4664"},"comments":{"href":"https://api.github.com/repos/influxdb/influxdb/issues/4664/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4664/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/4664/commits"},"statuses":{"href":"https://api.github.com/repos/influxdb/influxdb/statuses/13bd87043f622ad1f6e51ff6af6cf3af61e3b04d"}}}}