{"id":22295776,"url":"https://github.com/danielfernandez/test-spring-boot-reactive-netty-output","last_synced_at":"2025-03-25T22:34:02.840Z","repository":{"id":146695477,"uuid":"74512179","full_name":"danielfernandez/test-spring-boot-reactive-netty-output","owner":"danielfernandez","description":"Test repository made for checking Netty's output with Spring Web Reactive","archived":false,"fork":false,"pushed_at":"2016-12-02T22:06:53.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T19:49:05.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielfernandez.png","metadata":{"files":{"readme":"README.markdown","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-22T20:52:41.000Z","updated_at":"2016-11-22T21:37:07.000Z","dependencies_parsed_at":"2023-06-14T10:45:39.329Z","dependency_job_id":null,"html_url":"https://github.com/danielfernandez/test-spring-boot-reactive-netty-output","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/danielfernandez%2Ftest-spring-boot-reactive-netty-output","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfernandez%2Ftest-spring-boot-reactive-netty-output/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfernandez%2Ftest-spring-boot-reactive-netty-output/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfernandez%2Ftest-spring-boot-reactive-netty-output/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielfernandez","download_url":"https://codeload.github.com/danielfernandez/test-spring-boot-reactive-netty-output/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245555088,"owners_count":20634670,"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-12-03T17:43:09.228Z","updated_at":"2025-03-25T22:34:02.808Z","avatar_url":"https://github.com/danielfernandez.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Test repository for Spring Web Reactive + Netty output behaviour\n----------------------------------------------------------------\n\nIssue Links:\n\n   * https://jira.spring.io/browse/SPR-14943\n   * https://jira.spring.io/browse/SPR-14944\n   * https://jira.spring.io/browse/SPR-14945\n\n\nThis repository is aimed at testing the differences in output behaviour\nbetween Spring Boot + Spring Web Reactive applications running on Netty and on other supported servers.\n\nThe issues to be tested are:\n\n   1. **Netty** might not be sending any results to the browser until the entire output is available,\n     which shouldn't happen.\n   2. **RxNetty** is not sending results at all when outputting large amounts of data.\n   3. There seem to be important differences in performance between *normal* and **SSE** output (SSE is much slower).\n   4. **Jetty** is significantly slower than Tomcat and Undertow.\n\n\n\n## How to test\n\nCompile and run each of the five Spring Boot applications, which are identical except for the fact that\nthey use a different server:\n\n```\ncd spring-boot-reactive-netty-output-{server}\nmvn -U clean compile spring-boot:run\n```\n\nAll five applications can be run at the same time (in fact, it is the recommended setup for testing). Each\napplication will listen in a different port:\n\n   * `http://localhost:8081` — Jetty\n   * `http://localhost:8082` — Netty\n   * `http://localhost:8083` — RxNetty\n   * `http://localhost:8084` — Tomcat\n   * `http://localhost:8085` — Undertow\n\nAll aplications offer a `/items/{repetitions}` URL which returns a JSON array of very simple data items. These\nitems actually come from a `Flux\u003cItem\u003e` object returned by the controller, and are created at the\n`ItemRepository` class from a `List\u003cItem\u003e` and then repeated the amount of times specified at the URL,\nby means of the following code:\n\n\n```java\n    public Flux\u003cItem\u003e findAllItems(final int repetitions) {\n\n        /*\n         * We don't really have a reactive source for these items, so\n         * we will just create a list of 10, and then repeat it many\n         * times to make our Flux publish quite a lot of data.\n         */\n\n        final List\u003cItem\u003e itemList = new ArrayList\u003c\u003e();\n        // Some large things in the Solar System\n        itemList.add(new Item(1, \"Mercury\"));\n        itemList.add(new Item(2, \"Venus\"));\n        itemList.add(new Item(3, \"Earth\"));\n        itemList.add(new Item(4, \"Mars\"));\n        itemList.add(new Item(5, \"Ceres\"));\n        itemList.add(new Item(6, \"Jupiter\"));\n        itemList.add(new Item(7, \"Saturn\"));\n        itemList.add(new Item(8, \"Uranus\"));\n        itemList.add(new Item(9, \"Neptune\"));\n        itemList.add(new Item(10, \"Pluto\"));\n\n        return Flux.fromIterable(itemList).repeat(repetitions);\n\n    }\n```\n\n## Observed Results (non-SSE)\n\nAfter starting all the servers, this is the behaviour obtained for each server. Note *intro* is hit\nevery 5 seconds so that we can better observe the evolution of the data transfer over time.\n\nAll `out.{server}` output files have been verified to be equal (for the servers that actually finished executing).\n\n\n**Jetty**\n\nFinished OK, 31 seconds, started returning data right away as expected.\n\n```\n$ curl http://localhost:8081/items/10000 \u003e out.jetty\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  400k    0  400k    0     0  73855      0 --:--:--  0:00:05 --:--:-- 76756\n100  752k    0  752k    0     0  74798      0 --:--:--  0:00:10 --:--:-- 75892\n100 1136k    0 1136k    0     0  76268      0 --:--:--  0:00:15 --:--:-- 79320\n100 1520k    0 1520k    0     0  76949      0 --:--:--  0:00:20 --:--:-- 79032\n100 1905k    0 1905k    0     0  77142      0 --:--:--  0:00:25 --:--:-- 77921\n100 2289k    0 2289k    0     0  77345      0 --:--:--  0:00:30 --:--:-- 78372\n100 2421k    0 2421k    0     0  77823      0 --:--:--  0:00:31 --:--:-- 82026\n```\n\n\n**Netty**\n\nFinished OK, 33 seconds, didn't return any data until the last moment **contrary to expected**.\n\n```\n$ curl http://localhost:8082/items/10000 \u003e out.netty\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:10 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:15 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:20 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:25 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:30 --:--:--     0\n100 2421k    0 2421k    0     0  74041      0 --:--:--  0:00:33 --:--:--  579k\n```\n\n\n**RxNetty**\n\nCancelled after 7 minutes, didn't return any data. Seems to have problems when `repetitions \u003e 100`.\n\n```\n$ curl http://localhost:8083/items/10000 \u003e out.rxnetty\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:--  0:00:15 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:30 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:45 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:01:00 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:01:15 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:01:30 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:01:45 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:02:00 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:02:15 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:02:30 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:02:45 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:03:00 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:03:16 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:03:30 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:03:45 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:04:00 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:04:15 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:04:30 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:04:45 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:05:00 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:05:15 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:05:30 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:05:45 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:06:00 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:06:15 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:06:30 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:06:45 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:07:00 --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:07:03 --:--:--     0\n^C (Cancelled, didn't finish)\n```\n\n\n**Tomcat**\n\nFinished OK, 7 seconds, started returning data right away as expected.\n\n```\n$ curl http://localhost:8084/items/10000 \u003e out.tomcat\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100 1959k    0 1959k    0     0   334k      0 --:--:--  0:00:05 --:--:--  340k\n100 2421k    0 2421k    0     0   336k      0 --:--:--  0:00:07 --:--:--  340k\n```\n\n\n**Undertow**\n\nFinished OK, 9 seconds, started returning data right away as expected.\n\n```\n$ curl http://localhost:8085/items/10000 \u003e out.undertow\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100 1353k    0 1353k    0     0   232k      0 --:--:--  0:00:05 --:--:--  249k\n100 2421k    0 2421k    0     0   245k      0 --:--:--  0:00:09 --:--:--  265k\n```\n\n## Observed Results (SSE)\n\nAfter starting all the servers, this is the behaviour obtained for each server. Note *intro* is hit\nevery 15 seconds so that we can better observe the evolution of the data transfer over time.\n\nAll `outsse.{server}` output files have been verified to be equal.\n\nNote in general, all these results are much slower than the equivalent non-SSE ones above.\n\n**Jetty (SSE)**\n\nFinished OK, 4 minutes 8 seconds, started returning data right away. **Slower than non-SSE**.\n\n```\n$ curl -H \"Accept:text/event-stream\" http://localhost:8081/items/10000 \u003e outsse.jetty\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  170k    0  170k    0     0  10967      0 --:--:--  0:00:15 --:--:-- 12063\n100  352k    0  352k    0     0  11669      0 --:--:--  0:00:30 --:--:-- 12596\n100  535k    0  535k    0     0  11935      0 --:--:--  0:00:45 --:--:-- 12428\n100  718k    0  718k    0     0  12070      0 --:--:--  0:01:00 --:--:-- 12541\n100  900k    0  900k    0     0  12149      0 --:--:--  0:01:15 --:--:-- 12521\n100 1084k    0 1084k    0     0  12210      0 --:--:--  0:01:30 --:--:-- 12500\n100 1267k    0 1267k    0     0  12251      0 --:--:--  0:01:45 --:--:-- 12493\n100 1450k    0 1450k    0     0  12279      0 --:--:--  0:02:00 --:--:-- 12462\n100 1631k    0 1631k    0     0  12289      0 --:--:--  0:02:15 --:--:-- 12473\n100 1814k    0 1814k    0     0  12311      0 --:--:--  0:02:30 --:--:-- 12525\n100 1996k    0 1996k    0     0  12324      0 --:--:--  0:02:45 --:--:-- 12345\n100 2179k    0 2179k    0     0  12337      0 --:--:--  0:03:00 --:--:-- 12553\n100 2362k    0 2362k    0     0  12348      0 --:--:--  0:03:15 --:--:-- 12372\n100 2545k    0 2545k    0     0  12356      0 --:--:--  0:03:30 --:--:-- 12535\n100 2728k    0 2728k    0     0  12365      0 --:--:--  0:03:45 --:--:-- 12449\n100 2910k    0 2910k    0     0  12371      0 --:--:--  0:04:00 --:--:-- 12498\n100 3007k    0 3007k    0     0  12375      0 --:--:--  0:04:08 --:--:-- 12495\n```\n\n\n**Netty (SSE)**\n\nFinished OK, 2 minutes 26 seconds, started returning data right away (which didn't happen when not using SSE). **Slower than non-SSE**.\n\n```\n$ curl -H \"Accept:text/event-stream\" http://localhost:8082/items/10000 \u003e outsse.netty\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  295k    0  295k    0     0  19403      0 --:--:--  0:00:15 --:--:-- 20722\n100  610k    0  610k    0     0  20406      0 --:--:--  0:00:30 --:--:-- 21206\n100  922k    0  922k    0     0  20723      0 --:--:--  0:00:45 --:--:-- 21005\n100 1235k    0 1235k    0     0  20882      0 --:--:--  0:01:00 --:--:-- 21497\n100 1547k    0 1547k    0     0  20963      0 --:--:--  0:01:15 --:--:-- 21231\n100 1857k    0 1857k    0     0  20993      0 --:--:--  0:01:30 --:--:-- 21267\n100 2165k    0 2165k    0     0  21004      0 --:--:--  0:01:45 --:--:-- 21020\n100 2473k    0 2473k    0     0  21000      0 --:--:--  0:02:00 --:--:-- 21081\n100 2781k    0 2781k    0     0  21002      0 --:--:--  0:02:15 --:--:-- 20764\n100 3007k    0 3007k    0     0  20993      0 --:--:--  0:02:26 --:--:-- 21063\n```\n\n\n**RxNetty (SSE)**\n\nFinished OK (whereas in the non-SSE test it had to be cancelled). 8 minutes 21 seconds, started returning data right away. \n\nInterestingly, note this time denotes an issue when not in SSE mode, when it had to be cancelled after 7 minutes with no result at all. \n\nIf RxNetty was going to take longer than those 7 minutes to send results but end up finishing OK, given the apparent proportions between non-SSE and SSE tests, this one would have taken much much longer than 8 minutes.\n\n```\n$ curl -H \"Accept:text/event-stream\" http://localhost:8083/items/10000 \u003e outsse.rxnetty\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100 86361    0 86361    0     0   5673      0 --:--:--  0:00:15 --:--:--  6054\n100  173k    0  173k    0     0   5893      0 --:--:--  0:00:30 --:--:--  6100\n100  263k    0  263k    0     0   5961      0 --:--:--  0:00:45 --:--:--  6177\n100  353k    0  353k    0     0   6016      0 --:--:--  0:01:00 --:--:--  6217\n100  444k    0  444k    0     0   6050      0 --:--:--  0:01:15 --:--:--  6186\n100  534k    0  534k    0     0   6061      0 --:--:--  0:01:30 --:--:--  6036\n100  624k    0  624k    0     0   6076      0 --:--:--  0:01:45 --:--:--  6162\n100  714k    0  714k    0     0   6088      0 --:--:--  0:02:00 --:--:--  6196\n100  805k    0  805k    0     0   6100      0 --:--:--  0:02:15 --:--:--  6187\n100  896k    0  896k    0     0   6108      0 --:--:--  0:02:30 --:--:--  6183\n100  986k    0  986k    0     0   6114      0 --:--:--  0:02:45 --:--:--  6154\n100 1076k    0 1076k    0     0   6119      0 --:--:--  0:03:00 --:--:--  6190\n100 1167k    0 1167k    0     0   6123      0 --:--:--  0:03:15 --:--:--  6164\n100 1257k    0 1257k    0     0   6127      0 --:--:--  0:03:30 --:--:--  6202\n100 1348k    0 1348k    0     0   6131      0 --:--:--  0:03:45 --:--:--  6183\n100 1438k    0 1438k    0     0   6133      0 --:--:--  0:04:00 --:--:--  6160\n100 1529k    0 1529k    0     0   6137      0 --:--:--  0:04:15 --:--:--  6196\n100 1619k    0 1619k    0     0   6138      0 --:--:--  0:04:30 --:--:--  6156\n100 1710k    0 1710k    0     0   6139      0 --:--:--  0:04:45 --:--:--  6135\n100 1800k    0 1800k    0     0   6140      0 --:--:--  0:05:00 --:--:--  6182\n100 1890k    0 1890k    0     0   6140      0 --:--:--  0:05:15 --:--:--  6180\n100 1980k    0 1980k    0     0   6140      0 --:--:--  0:05:30 --:--:--  6131\n100 2070k    0 2070k    0     0   6141      0 --:--:--  0:05:45 --:--:--  6183\n100 2160k    0 2160k    0     0   6141      0 --:--:--  0:06:00 --:--:--  6197\n100 2250k    0 2250k    0     0   6141      0 --:--:--  0:06:15 --:--:--  6084\n100 2339k    0 2339k    0     0   6139      0 --:--:--  0:06:30 --:--:--  5932\n100 2429k    0 2429k    0     0   6139      0 --:--:--  0:06:45 --:--:--  6144\n100 2519k    0 2519k    0     0   6139      0 --:--:--  0:07:00 --:--:--  6114\n100 2609k    0 2609k    0     0   6139      0 --:--:--  0:07:15 --:--:--  6151\n100 2699k    0 2699k    0     0   6140      0 --:--:--  0:07:30 --:--:--  6135\n100 2789k    0 2789k    0     0   6140      0 --:--:--  0:07:45 --:--:--  6165\n100 2879k    0 2879k    0     0   6140      0 --:--:--  0:08:00 --:--:--  6067\n100 2970k    0 2970k    0     0   6141      0 --:--:--  0:08:15 --:--:--  6176\n100 3007k    0 3007k    0     0   6141      0 --:--:--  0:08:21 --:--:--  6145\n```\n\n\n**Tomcat (SSE)**\n\nFinished OK, 1 minute 54 seconds, started returning data right away as expected. **Slower than non-SSE**.\n\n```\n$ curl -H \"Accept:text/event-stream\" http://localhost:8084/items/10000 \u003e outsse.tomcat\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  388k    0  388k    0     0  26500      0 --:--:--  0:00:15 --:--:-- 26772\n100  781k    0  781k    0     0  26658      0 --:--:--  0:00:30 --:--:-- 26881\n100 1173k    0 1173k    0     0  26710      0 --:--:--  0:00:45 --:--:-- 26925\n100 1566k    0 1566k    0     0  26731      0 --:--:--  0:01:00 --:--:-- 26783\n100 1960k    0 1960k    0     0  26764      0 --:--:--  0:01:15 --:--:-- 26894\n100 2352k    0 2352k    0     0  26767      0 --:--:--  0:01:30 --:--:-- 26746\n100 2746k    0 2746k    0     0  26782      0 --:--:--  0:01:45 --:--:-- 26888\n100 3007k    0 3007k    0     0  26786      0 --:--:--  0:01:54 --:--:-- 26840\n```\n\n\n**Undertow (SSE)**\n\nFinished OK, 1 minute 12 seconds, started returning data right away as expected. **Slower than non-SSE**.\n\n```\n$ curl -H \"Accept:text/event-stream\" http://localhost:8085/items/10000 \u003e outsse.undertow\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  561k    0  561k    0     0  37720      0 --:--:--  0:00:15 --:--:-- 43895\n100 1189k    0 1189k    0     0  40290      0 --:--:--  0:00:30 --:--:-- 43712\n100 1831k    0 1831k    0     0  41467      0 --:--:--  0:00:45 --:--:-- 43945\n100 2473k    0 2473k    0     0  42048      0 --:--:--  0:01:00 --:--:-- 43736\n100 3007k    0 3007k    0     0  42345      0 --:--:--  0:01:12 --:--:-- 44045\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfernandez%2Ftest-spring-boot-reactive-netty-output","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielfernandez%2Ftest-spring-boot-reactive-netty-output","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfernandez%2Ftest-spring-boot-reactive-netty-output/lists"}