{"id":21478664,"url":"https://github.com/kayhide/api-takeover","last_synced_at":"2025-03-17T08:25:29.779Z","repository":{"id":39699817,"uuid":"167653808","full_name":"kayhide/api-takeover","owner":"kayhide","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-16T05:51:10.000Z","size":17,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T17:58:16.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kayhide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-26T05:33:07.000Z","updated_at":"2020-07-30T03:01:36.000Z","dependencies_parsed_at":"2023-02-10T17:50:10.708Z","dependency_job_id":null,"html_url":"https://github.com/kayhide/api-takeover","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayhide%2Fapi-takeover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayhide%2Fapi-takeover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayhide%2Fapi-takeover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayhide%2Fapi-takeover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayhide","download_url":"https://codeload.github.com/kayhide/api-takeover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997454,"owners_count":20381029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T11:19:08.211Z","updated_at":"2025-03-17T08:25:29.739Z","avatar_url":"https://github.com/kayhide.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# api-takeover\n\nThis follows the blog post [Incremental API Takeover with Haskell Servant](https://www.parsonsmatt.org/2016/06/24/take_over_an_api_with_servant.html).\n\nUsing the updated version of servant-0.15.\n\n\n\n## Benchmark\n\n\n```\n% make benchmark\n*** Requesting to the old server\n\nhttperf --port=4567 --num-calls=500 --uri=/\nhttperf --client=0/1 --server=localhost --port=4567 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=1 --num-calls=500\nhttperf: warning: open file limit \u003e FD_SETSIZE; limiting max. # of open files to FD_SETSIZE\nMaximum connect burst length: 0\n\nTotal: connections 1 requests 500 replies 500 test-duration 0.249 s\n\nConnection rate: 4.0 conn/s (248.6 ms/conn, \u003c=1 concurrent connections)\nConnection time [ms]: min 248.6 avg 248.6 max 248.6 median 248.5 stddev 0.0\nConnection time [ms]: connect 0.3\nConnection length [replies/conn]: 500.000\n\nRequest rate: 2010.9 req/s (0.5 ms/req)\nRequest size [B]: 62.0\n\nReply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)\nReply time [ms]: response 0.5 transfer 0.0\nReply size [B]: header 173.0 content 69.0 footer 0.0 (total 242.0)\nReply status: 1xx=0 2xx=500 3xx=0 4xx=0 5xx=0\n\nCPU time [s]: user 0.07 system 0.18 (user 27.1% system 72.4% total 99.6%)\nNet I/O: 597.0 KB/s (4.9*10^6 bps)\n\nErrors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0\nErrors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0\n\n*** Requesting to the new server\n\nhttperf --port=8080 --num-calls=500 --uri=/\nhttperf --client=0/1 --server=localhost --port=8080 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=1 --num-calls=500\nhttperf: warning: open file limit \u003e FD_SETSIZE; limiting max. # of open files to FD_SETSIZE\nMaximum connect burst length: 0\n\nTotal: connections 1 requests 500 replies 500 test-duration 0.034 s\n\nConnection rate: 29.3 conn/s (34.2 ms/conn, \u003c=1 concurrent connections)\nConnection time [ms]: min 34.2 avg 34.2 max 34.2 median 34.5 stddev 0.0\nConnection time [ms]: connect 0.3\nConnection length [replies/conn]: 500.000\n\nRequest rate: 14631.0 req/s (0.1 ms/req)\nRequest size [B]: 62.0\n\nReply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)\nReply time [ms]: response 0.1 transfer 0.0\nReply size [B]: header 144.0 content 77.0 footer 2.0 (total 223.0)\nReply status: 1xx=0 2xx=500 3xx=0 4xx=0 5xx=0\n\nCPU time [s]: user 0.01 system 0.03 (user 26.4% system 73.3% total 99.7%)\nNet I/O: 4043.5 KB/s (33.1*10^6 bps)\n\nErrors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0\nErrors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0\n```\n\nIt shows about 2000 req/s on the sinatra server, 14000 req/s on the servant server.\n\nAbout 7 times faster.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayhide%2Fapi-takeover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayhide%2Fapi-takeover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayhide%2Fapi-takeover/lists"}