{"action":"opened","issue":{"url":"https://api.github.com/repos/xtaci/kcptun/issues/334","repository_url":"https://api.github.com/repos/xtaci/kcptun","labels_url":"https://api.github.com/repos/xtaci/kcptun/issues/334/labels{/name}","comments_url":"https://api.github.com/repos/xtaci/kcptun/issues/334/comments","events_url":"https://api.github.com/repos/xtaci/kcptun/issues/334/events","html_url":"https://github.com/xtaci/kcptun/issues/334","id":195898651,"number":334,"title":"Requests per second throughput","user":{"login":"jeromegn","id":43325,"avatar_url":"https://avatars.githubusercontent.com/u/43325?v=3","gravatar_id":"","url":"https://api.github.com/users/jeromegn","html_url":"https://github.com/jeromegn","followers_url":"https://api.github.com/users/jeromegn/followers","following_url":"https://api.github.com/users/jeromegn/following{/other_user}","gists_url":"https://api.github.com/users/jeromegn/gists{/gist_id}","starred_url":"https://api.github.com/users/jeromegn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeromegn/subscriptions","organizations_url":"https://api.github.com/users/jeromegn/orgs","repos_url":"https://api.github.com/users/jeromegn/repos","events_url":"https://api.github.com/users/jeromegn/events{/privacy}","received_events_url":"https://api.github.com/users/jeromegn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-15T19:46:33Z","updated_at":"2016-12-15T19:46:33Z","closed_at":null,"body":"Hi,\r\n\r\nI've been playing with kcptun, curious about the performance and I found out that I would get at most 11-12K requests/per second on a server that can handle 56K requests/sec.\r\n\r\nI'm wondering which settings I should try tweaking to achieve better requests per second throughput? I played with the send/receive window sizes without seeing any significant improvement.\r\n\r\nserver to tunnel:\r\n\r\n```\r\ngo get github.com/valyala/fasthttp\r\ngo run $GOPATH/src/github.com/valyala/fasthttp/examples/fileserver/fileserver.go -dir .\r\n```\r\n\r\nkcptun server:\r\n\r\n```\r\n-t 127.0.0.1:8080 -mode normal -sndwnd 256 -rcvwnd 2048 --crypt none --nocomp\r\n```\r\n\r\nkcptun client:\r\n\r\n```\r\n-r :29900 -l :8081 -mode normal -sndwnd 256 -rcvwnd 2048 --crypt none --nocomp\r\n```\r\n\r\n**Benchmarks (all local):**\r\n\r\nfasthttp server (no tunnel):\r\n```\r\nwrk -c 8 -d 10s http://localhost:8080\r\nRunning 10s test @ http://localhost:8080\r\n  2 threads and 8 connections\r\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\r\n    Latency   140.08us   23.11us   1.03ms   75.41%\r\n    Req/Sec    27.44k   567.15    29.32k    73.27%\r\n  551323 requests in 10.10s, 1.24GB read\r\nRequests/sec:  54588.06\r\nTransfer/sec:    125.46MB\r\n```\r\n\r\ntunnelled:\r\n\r\n```\r\nwrk -c 8 -d 10s http://localhost:8081\r\nRunning 10s test @ http://localhost:8081\r\n  2 threads and 8 connections\r\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\r\n    Latency     0.96ms    5.48ms 155.27ms   99.63%\r\n    Req/Sec     5.99k   392.90     7.07k    70.30%\r\n  120261 requests in 10.10s, 276.40MB read\r\nRequests/sec:  11907.44\r\nTransfer/sec:     27.37MB\r\n```\r\n\r\nThe tunnelled version is about 4-5x slower than the original server.\r\n\r\nI tried on lower throughput servers (like `gohttp` and I seemed to achieve about 2x lower throughput, which is better.)\r\n\r\nAny ideas would be appreciated!"}}
{"actor":{"display_login":"jeromegn"}}