1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
denoland-deno/tests/integration
Nathan Whitaker e92a05b551
feat(serve): Opt-in parallelism for deno serve (#24920)
Adds a `parallel` flag to `deno serve`. When present, we spawn multiple
workers to parallelize serving requests.


```bash
deno serve --parallel main.ts
```

Currently on linux we use `SO_REUSEPORT` and rely on the fact that the
kernel will distribute connections in a round-robin manner.

On mac and windows, we sort of emulate this by cloning the underlying
file descriptor and passing a handle to each worker. The connections
will not be guaranteed to be fairly distributed (and in practice almost
certainly won't be), but the distribution is still spread enough to
provide a significant performance increase.

---
(Run on an Macbook Pro with an M3 Max, serving `deno.com`

baseline::
```
❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000
Running 30s test @ http://127.0.0.1:8000
  2 threads and 125 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   239.78ms   13.56ms 330.54ms   79.12%
    Req/Sec   258.58     35.56   360.00     70.64%
  Latency Distribution
     50%  236.72ms
     75%  248.46ms
     90%  256.84ms
     99%  268.23ms
  15458 requests in 30.02s, 2.47GB read
Requests/sec:    514.89
Transfer/sec:     84.33MB
```

this PR (`with --parallel` flag)
```
❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000
Running 30s test @ http://127.0.0.1:8000
  2 threads and 125 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   117.40ms  142.84ms 590.45ms   79.07%
    Req/Sec     1.33k   175.19     1.77k    69.00%
  Latency Distribution
     50%   22.34ms
     75%  223.67ms
     90%  357.32ms
     99%  460.50ms
  79636 requests in 30.07s, 12.74GB read
Requests/sec:   2647.96
Transfer/sec:    433.71MB
```
2024-08-14 22:26:21 +00:00
..
bench_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
bundle_tests.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
cache_tests.rs chore: fix flaky net_listen_allow_localhost_4555 (#23726) 2024-05-07 17:21:56 +00:00
check_tests.rs fix(unstable): move sloppy-import warnings to lint rule (#24710) 2024-07-25 09:07:59 -04:00
compile_tests.rs fix(compile): adhoc codesign mach-o by default (#24824) 2024-08-01 02:11:24 -07:00
coverage_tests.rs feat(coverage): add breadcrumbs to deno coverage --html report (#24860) 2024-08-14 16:37:19 +09:00
doc_tests.rs chore: update deno_doc (#24308) 2024-06-28 05:03:51 -07:00
eval_tests.rs chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00
flags_tests.rs feat: better help output (#24958) 2024-08-12 08:55:33 -07:00
fmt_tests.rs feat(fmt): support HTML, Svelte, Vue, Astro and Angular (#25019) 2024-08-14 22:58:48 +02:00
info_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
init_tests.rs feat: deno init --serve (#24897) 2024-08-08 16:54:39 +00:00
inspector_tests.rs Reland "refactor(fetch): reimplement fetch with hyper instead of reqwest" (#24593) 2024-07-18 01:37:31 +02:00
install_tests.rs fix(future): Emit deno install warning less often, suggest deno install in error message (#24706) 2024-07-24 23:37:13 +00:00
js_unit_tests.rs test: run unit tests with DENO_FUTURE=1 (#24400) 2024-08-14 22:50:06 +02:00
js_unit_tests_future.rs test: run unit tests with DENO_FUTURE=1 (#24400) 2024-08-14 22:50:06 +02:00
jsr_tests.rs fix: bump cache sqlite dbs to v2 for WAL journal mode change (#24030) 2024-05-29 18:38:18 +00:00
jupyter_tests.rs fix: adapt to new jupyter runtime API and include session IDs (#24762) 2024-07-27 10:39:08 +02:00
lint_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
lsp_tests.rs fix(lsp): import map lookup for jsr subpath auto import (#25025) 2024-08-14 22:38:18 +01:00
mod.rs test: run unit tests with DENO_FUTURE=1 (#24400) 2024-08-14 22:50:06 +02:00
node_compat_tests.rs fix(ext/node): dispatch beforeExit/exit events irrespective of listeners (#23382) 2024-04-16 13:45:41 +00:00
node_unit_tests.rs fix: node:inspector not being registered (#25007) 2024-08-14 12:33:42 +00:00
npm_tests.rs fix(future): Emit deno install warning less often, suggest deno install in error message (#24706) 2024-07-24 23:37:13 +00:00
pm_tests.rs feat(install): change 'Add ...' message (#24949) 2024-08-08 16:25:05 +02:00
publish_tests.rs feat(publish): error on missing license file (#25011) 2024-08-12 19:51:58 -04:00
repl_tests.rs perf(repl): don't walk workspace in repl language server (#24037) 2024-05-29 21:31:09 +01:00
run_tests.rs feat(permissions): link to docs in permission prompt (#24948) 2024-08-08 15:39:31 +02:00
serve_tests.rs feat(serve): Opt-in parallelism for deno serve (#24920) 2024-08-14 22:26:21 +00:00
shared_library_tests.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
task_tests.rs feat(task): support running npm binary commands in deno.json (#23478) 2024-04-20 20:13:46 -04:00
test_tests.rs fix: upgrade deno_core to 0.298.0 (#24709) 2024-07-25 03:36:34 +02:00
upgrade_tests.rs chore: mark upgrade_prompt as flaky (#25009) 2024-08-12 23:04:00 +02:00
vendor_tests.rs feat: deprecate deno vendor (#22183) 2024-07-10 03:18:10 +02:00
watcher_tests.rs fix(cli): support --watch when running cjs npm packages (#25038) 2024-08-14 15:21:11 +02:00
worker_tests.rs refactor(tests): move worker_threads itests to spec tests (#23648) 2024-05-03 05:52:47 +00:00