{"action":"closed","issue":{"url":"https://api.github.com/repos/akka/akka-http/issues/364","repository_url":"https://api.github.com/repos/akka/akka-http","labels_url":"https://api.github.com/repos/akka/akka-http/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka-http/issues/364/comments","events_url":"https://api.github.com/repos/akka/akka-http/issues/364/events","html_url":"https://github.com/akka/akka-http/issues/364","id":180066926,"number":364,"title":"WebSocket Backpressure not working","user":{"login":"MichaelZinsmaier","id":888758,"avatar_url":"https://avatars.githubusercontent.com/u/888758?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelZinsmaier","html_url":"https://github.com/MichaelZinsmaier","followers_url":"https://api.github.com/users/MichaelZinsmaier/followers","following_url":"https://api.github.com/users/MichaelZinsmaier/following{/other_user}","gists_url":"https://api.github.com/users/MichaelZinsmaier/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelZinsmaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelZinsmaier/subscriptions","organizations_url":"https://api.github.com/users/MichaelZinsmaier/orgs","repos_url":"https://api.github.com/users/MichaelZinsmaier/repos","events_url":"https://api.github.com/users/MichaelZinsmaier/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelZinsmaier/received_events","type":"User","site_admin":false},"labels":[{"id":430145557,"url":"https://api.github.com/repos/akka/akka-http/labels/0%20-%20new","name":"0 - new","color":"FFFFFF","default":false},{"id":427494657,"url":"https://api.github.com/repos/akka/akka-http/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/akka/akka-http/milestones/5","html_url":"https://github.com/akka/akka-http/milestones/backlog","labels_url":"https://api.github.com/repos/akka/akka-http/milestones/5/labels","id":1991250,"number":5,"title":"backlog","description":"","creator":{"login":"akka-ci","id":2511948,"avatar_url":"https://avatars.githubusercontent.com/u/2511948?v=3","gravatar_id":"","url":"https://api.github.com/users/akka-ci","html_url":"https://github.com/akka-ci","followers_url":"https://api.github.com/users/akka-ci/followers","following_url":"https://api.github.com/users/akka-ci/following{/other_user}","gists_url":"https://api.github.com/users/akka-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/akka-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka-ci/subscriptions","organizations_url":"https://api.github.com/users/akka-ci/orgs","repos_url":"https://api.github.com/users/akka-ci/repos","events_url":"https://api.github.com/users/akka-ci/events{/privacy}","received_events_url":"https://api.github.com/users/akka-ci/received_events","type":"User","site_admin":false},"open_issues":116,"closed_issues":22,"state":"open","created_at":"2016-09-08T14:27:28Z","updated_at":"2016-11-22T14:16:21Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-09-29T14:35:48Z","updated_at":"2016-11-22T14:16:21Z","closed_at":"2016-11-22T14:16:21Z","body":"Hi Akka Team,\n\nI think backpressure for (single) WebSockets might be broken. A test project shows strange behavior\nsee attached screenshots and reproducer repository. The strange thing is that if this is correct it has been broken during the transition from Akka Streams 1.0 to Akka Streams 2.0 and is broken since including the latest release Akka 2.4.10. So potentially I'm missing some important settings?\n\n**echo server with red == data in, green == data out**\n\n[observed backpressure with Akka 1.0](https://github.com/MichaelZinsmaier/backpressure-bug/blob/master/withBackpressure.png)\n[no backpressure with Akka 2.x](https://github.com/MichaelZinsmaier/backpressure-bug/blob/master/broken.png)\n[code](https://github.com/MichaelZinsmaier/backpressure-bug)\n\nAssumption: if the server is not reading from a WebSocket stream after the HTTP upgrade this should result in TCP backpressure thus blocking the sender. If the server reads slowly the sender will be throttled (via TCP).\n\n**Test Setup:**\nA Netty based WebSocket client sending data as fast as possible. A Akka Http based WebSocket server receiving data and throttling the data stream (with sleep because the throttle stage didn't exist at the time of writing).\n\n```\n1000 bytes per WS object\n10 milliseconds delay per WS object\n20 MB test data => ~20.000 WS objects\nno further configuration\n```\n\n(running with 200MB and 2 milliseconds yields similar [results](https://github.com/MichaelZinsmaier/backpressure-bug/blob/master/broken_200mb_35secSendBurst.png))\n\n**reproducing without sockets**\n\n[code see branch broken serverLayer](https://github.com/MichaelZinsmaier/backpressure-bug/tree/brokenServerLayer)\nA small test without Netty / real Sockets / real IO yields similar results, the source seems to\ncomplete very fast without being backpressured by the slow intermediate consumer. Interestingly\na test with a large streamed HTTP Post request does show backpressure.\n\nHope that helps if you have further questions don't hesitate\n\nbest Michael\n"}}
{"actor":{"display_login":"ktoso"}}