{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-ecto/db_connection/issues/108","repository_url":"https://api.github.com/repos/elixir-ecto/db_connection","labels_url":"https://api.github.com/repos/elixir-ecto/db_connection/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/elixir-ecto/db_connection/issues/108/comments","events_url":"https://api.github.com/repos/elixir-ecto/db_connection/issues/108/events","html_url":"https://github.com/elixir-ecto/db_connection/pull/108","id":280865338,"number":108,"title":"Add built in connection pool","user":{"login":"fishcakez","id":2001229,"avatar_url":"https://avatars3.githubusercontent.com/u/2001229?v=4","gravatar_id":"","url":"https://api.github.com/users/fishcakez","html_url":"https://github.com/fishcakez","followers_url":"https://api.github.com/users/fishcakez/followers","following_url":"https://api.github.com/users/fishcakez/following{/other_user}","gists_url":"https://api.github.com/users/fishcakez/gists{/gist_id}","starred_url":"https://api.github.com/users/fishcakez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishcakez/subscriptions","organizations_url":"https://api.github.com/users/fishcakez/orgs","repos_url":"https://api.github.com/users/fishcakez/repos","events_url":"https://api.github.com/users/fishcakez/events{/privacy}","received_events_url":"https://api.github.com/users/fishcakez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars0.githubusercontent.com/u/477062?v=4","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"assignees":[{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars0.githubusercontent.com/u/477062?v=4","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2017-12-11T00:57:55Z","updated_at":"2018-02-12T01:14:54Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/elixir-ecto/db_connection/pulls/108","html_url":"https://github.com/elixir-ecto/db_connection/pull/108","diff_url":"https://github.com/elixir-ecto/db_connection/pull/108.diff","patch_url":"https://github.com/elixir-ecto/db_connection/pull/108.patch"},"body":"Adds a built in connection pool that will increase throughput by 3-7% for most single queries and load levels in Ecto. Other workloads may get 0%-10% improvements. \r\n\r\nThe pool uses an ETS queue and some other ETS trickier to avoid tracking busy connections/clients. The later feature (if this was only pool style) would allow us to stop using the pdict so that we can ensure no data leaks for non-closure transactions.\r\n\r\nWe might be able to get better performance by removing either or both of these ETS use cases.\r\n\r\nIO overload handling is better (and simpler) than Sojourn pool. In future we could improve the case where the database is down or other side of netsplit because we can know when there are no connections.\r\n\r\nCPU overload handling is not as good as Sojourn pool but could be improved by limiting the queue size and dropping all new checkouts above that size.\r\n\r\nThere is no overflow. This is something we could do in future if we have a simple and good algorithm.\r\n\r\nIdle ping handling is improved over other pools because pings will never synchronize and happen as rarely as possible.\r\n\r\nTimeout handling is improved over other pools because an absolute deadline can be used (useful for multiple repo or multi service calls) and the queue time is included in the timeout if not absolute. Also queue timeouts are `DBConnection.ConnectionError` errors, like Sojourn pool, so easier to handle.\r\n\r\nProcesses hibernation occurs efficiently and does not affect performance. It could be more efficient if hibernate on backoff.\r\n\r\nOverhead for `pool_size: 1` is insignificant compared to `DBConnection.Connection` so could replace it."},"comment":{"url":"https://api.github.com/repos/elixir-ecto/db_connection/issues/comments/364809343","html_url":"https://github.com/elixir-ecto/db_connection/pull/108#issuecomment-364809343","issue_url":"https://api.github.com/repos/elixir-ecto/db_connection/issues/108","id":364809343,"user":{"login":"fishcakez","id":2001229,"avatar_url":"https://avatars3.githubusercontent.com/u/2001229?v=4","gravatar_id":"","url":"https://api.github.com/users/fishcakez","html_url":"https://github.com/fishcakez","followers_url":"https://api.github.com/users/fishcakez/followers","following_url":"https://api.github.com/users/fishcakez/following{/other_user}","gists_url":"https://api.github.com/users/fishcakez/gists{/gist_id}","starred_url":"https://api.github.com/users/fishcakez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishcakez/subscriptions","organizations_url":"https://api.github.com/users/fishcakez/orgs","repos_url":"https://api.github.com/users/fishcakez/repos","events_url":"https://api.github.com/users/fishcakez/events{/privacy}","received_events_url":"https://api.github.com/users/fishcakez/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T01:14:54Z","updated_at":"2018-02-12T01:14:54Z","author_association":"OWNER","body":"@michalmuskala I removed the monitoring as its not required, unsure how minimal the increase in performance is but it simplifies the code slightly."}}
{"actor":{"display_login":"fishcakez"}}