itsi 0.2.15 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/Cargo.lock +76 -74
  4. data/crates/itsi_acme/Cargo.toml +1 -1
  5. data/crates/itsi_scheduler/Cargo.toml +1 -1
  6. data/crates/itsi_scheduler/extconf.rb +3 -1
  7. data/crates/itsi_server/Cargo.lock +1 -1
  8. data/crates/itsi_server/Cargo.toml +3 -1
  9. data/crates/itsi_server/extconf.rb +3 -1
  10. data/crates/itsi_server/src/lib.rs +7 -1
  11. data/crates/itsi_server/src/ruby_types/itsi_body_proxy/mod.rs +2 -0
  12. data/crates/itsi_server/src/ruby_types/itsi_grpc_call.rs +6 -6
  13. data/crates/itsi_server/src/ruby_types/itsi_grpc_response_stream/mod.rs +14 -13
  14. data/crates/itsi_server/src/ruby_types/itsi_http_request.rs +71 -42
  15. data/crates/itsi_server/src/ruby_types/itsi_http_response.rs +151 -152
  16. data/crates/itsi_server/src/ruby_types/itsi_server/file_watcher.rs +6 -15
  17. data/crates/itsi_server/src/ruby_types/itsi_server/itsi_server_config.rs +32 -6
  18. data/crates/itsi_server/src/ruby_types/itsi_server.rs +1 -1
  19. data/crates/itsi_server/src/server/binds/listener.rs +49 -8
  20. data/crates/itsi_server/src/server/frame_stream.rs +142 -0
  21. data/crates/itsi_server/src/server/http_message_types.rs +143 -10
  22. data/crates/itsi_server/src/server/io_stream.rs +28 -5
  23. data/crates/itsi_server/src/server/lifecycle_event.rs +1 -1
  24. data/crates/itsi_server/src/server/middleware_stack/middlewares/auth_basic.rs +2 -3
  25. data/crates/itsi_server/src/server/middleware_stack/middlewares/compression.rs +8 -10
  26. data/crates/itsi_server/src/server/middleware_stack/middlewares/cors.rs +2 -3
  27. data/crates/itsi_server/src/server/middleware_stack/middlewares/csp.rs +3 -3
  28. data/crates/itsi_server/src/server/middleware_stack/middlewares/error_response/default_responses.rs +54 -58
  29. data/crates/itsi_server/src/server/middleware_stack/middlewares/error_response.rs +6 -9
  30. data/crates/itsi_server/src/server/middleware_stack/middlewares/etag.rs +27 -42
  31. data/crates/itsi_server/src/server/middleware_stack/middlewares/log_requests.rs +65 -14
  32. data/crates/itsi_server/src/server/middleware_stack/middlewares/max_body.rs +1 -1
  33. data/crates/itsi_server/src/server/middleware_stack/middlewares/proxy.rs +8 -11
  34. data/crates/itsi_server/src/server/middleware_stack/middlewares/rate_limit.rs +21 -8
  35. data/crates/itsi_server/src/server/middleware_stack/middlewares/redirect.rs +2 -3
  36. data/crates/itsi_server/src/server/middleware_stack/middlewares/ruby_app.rs +1 -5
  37. data/crates/itsi_server/src/server/middleware_stack/middlewares/static_assets.rs +1 -2
  38. data/crates/itsi_server/src/server/middleware_stack/middlewares/static_response.rs +13 -6
  39. data/crates/itsi_server/src/server/mod.rs +1 -0
  40. data/crates/itsi_server/src/server/process_worker.rs +5 -5
  41. data/crates/itsi_server/src/server/serve_strategy/acceptor.rs +100 -0
  42. data/crates/itsi_server/src/server/serve_strategy/cluster_mode.rs +87 -31
  43. data/crates/itsi_server/src/server/serve_strategy/mod.rs +1 -0
  44. data/crates/itsi_server/src/server/serve_strategy/single_mode.rs +166 -206
  45. data/crates/itsi_server/src/server/signal.rs +37 -9
  46. data/crates/itsi_server/src/server/thread_worker.rs +92 -70
  47. data/crates/itsi_server/src/services/itsi_http_service.rs +67 -62
  48. data/crates/itsi_server/src/services/mime_types.rs +185 -183
  49. data/crates/itsi_server/src/services/rate_limiter.rs +16 -34
  50. data/crates/itsi_server/src/services/static_file_server.rs +35 -60
  51. data/docs/benchmark-dashboard/.gitignore +27 -0
  52. data/docs/benchmark-dashboard/app/api/benchmarks/route.ts +22 -0
  53. data/docs/benchmark-dashboard/app/globals.css +94 -0
  54. data/docs/benchmark-dashboard/app/layout.tsx +20 -0
  55. data/docs/benchmark-dashboard/app/page.tsx +252 -0
  56. data/docs/benchmark-dashboard/components/benchmark-dashboard.tsx +1663 -0
  57. data/docs/benchmark-dashboard/components/theme-provider.tsx +11 -0
  58. data/docs/benchmark-dashboard/components/ui/accordion.tsx +58 -0
  59. data/docs/benchmark-dashboard/components/ui/alert-dialog.tsx +141 -0
  60. data/docs/benchmark-dashboard/components/ui/alert.tsx +59 -0
  61. data/docs/benchmark-dashboard/components/ui/aspect-ratio.tsx +7 -0
  62. data/docs/benchmark-dashboard/components/ui/avatar.tsx +50 -0
  63. data/docs/benchmark-dashboard/components/ui/badge.tsx +36 -0
  64. data/docs/benchmark-dashboard/components/ui/breadcrumb.tsx +115 -0
  65. data/docs/benchmark-dashboard/components/ui/button.tsx +56 -0
  66. data/docs/benchmark-dashboard/components/ui/calendar.tsx +66 -0
  67. data/docs/benchmark-dashboard/components/ui/card.tsx +79 -0
  68. data/docs/benchmark-dashboard/components/ui/carousel.tsx +262 -0
  69. data/docs/benchmark-dashboard/components/ui/chart.tsx +365 -0
  70. data/docs/benchmark-dashboard/components/ui/checkbox.tsx +30 -0
  71. data/docs/benchmark-dashboard/components/ui/collapsible.tsx +11 -0
  72. data/docs/benchmark-dashboard/components/ui/command.tsx +153 -0
  73. data/docs/benchmark-dashboard/components/ui/context-menu.tsx +200 -0
  74. data/docs/benchmark-dashboard/components/ui/dialog.tsx +122 -0
  75. data/docs/benchmark-dashboard/components/ui/drawer.tsx +118 -0
  76. data/docs/benchmark-dashboard/components/ui/dropdown-menu.tsx +200 -0
  77. data/docs/benchmark-dashboard/components/ui/form.tsx +178 -0
  78. data/docs/benchmark-dashboard/components/ui/hover-card.tsx +29 -0
  79. data/docs/benchmark-dashboard/components/ui/input-otp.tsx +71 -0
  80. data/docs/benchmark-dashboard/components/ui/input.tsx +22 -0
  81. data/docs/benchmark-dashboard/components/ui/label.tsx +26 -0
  82. data/docs/benchmark-dashboard/components/ui/loading-spinner.tsx +12 -0
  83. data/docs/benchmark-dashboard/components/ui/menubar.tsx +236 -0
  84. data/docs/benchmark-dashboard/components/ui/navigation-menu.tsx +128 -0
  85. data/docs/benchmark-dashboard/components/ui/pagination.tsx +117 -0
  86. data/docs/benchmark-dashboard/components/ui/popover.tsx +31 -0
  87. data/docs/benchmark-dashboard/components/ui/progress.tsx +28 -0
  88. data/docs/benchmark-dashboard/components/ui/radio-group.tsx +44 -0
  89. data/docs/benchmark-dashboard/components/ui/resizable.tsx +45 -0
  90. data/docs/benchmark-dashboard/components/ui/scroll-area.tsx +48 -0
  91. data/docs/benchmark-dashboard/components/ui/select.tsx +160 -0
  92. data/docs/benchmark-dashboard/components/ui/separator.tsx +31 -0
  93. data/docs/benchmark-dashboard/components/ui/sheet.tsx +140 -0
  94. data/docs/benchmark-dashboard/components/ui/sidebar.tsx +763 -0
  95. data/docs/benchmark-dashboard/components/ui/skeleton.tsx +15 -0
  96. data/docs/benchmark-dashboard/components/ui/slider.tsx +28 -0
  97. data/docs/benchmark-dashboard/components/ui/sonner.tsx +31 -0
  98. data/docs/benchmark-dashboard/components/ui/switch.tsx +29 -0
  99. data/docs/benchmark-dashboard/components/ui/table.tsx +117 -0
  100. data/docs/benchmark-dashboard/components/ui/tabs.tsx +55 -0
  101. data/docs/benchmark-dashboard/components/ui/textarea.tsx +22 -0
  102. data/docs/benchmark-dashboard/components/ui/toast.tsx +129 -0
  103. data/docs/benchmark-dashboard/components/ui/toaster.tsx +35 -0
  104. data/docs/benchmark-dashboard/components/ui/toggle-group.tsx +61 -0
  105. data/docs/benchmark-dashboard/components/ui/toggle.tsx +45 -0
  106. data/docs/benchmark-dashboard/components/ui/tooltip.tsx +30 -0
  107. data/docs/benchmark-dashboard/components/ui/use-mobile.tsx +19 -0
  108. data/docs/benchmark-dashboard/components/ui/use-toast.ts +194 -0
  109. data/docs/benchmark-dashboard/components.json +21 -0
  110. data/docs/benchmark-dashboard/dist/benchmark-dashboard.css +1 -0
  111. data/docs/benchmark-dashboard/dist/benchmark-dashboard.iife.js +211 -0
  112. data/docs/benchmark-dashboard/dist/placeholder-logo.png +0 -0
  113. data/docs/benchmark-dashboard/dist/placeholder-logo.svg +1 -0
  114. data/docs/benchmark-dashboard/dist/placeholder-user.jpg +0 -0
  115. data/docs/benchmark-dashboard/dist/placeholder.jpg +0 -0
  116. data/docs/benchmark-dashboard/dist/placeholder.svg +1 -0
  117. data/docs/benchmark-dashboard/embed.tsx +13 -0
  118. data/docs/benchmark-dashboard/hooks/use-mobile.tsx +19 -0
  119. data/docs/benchmark-dashboard/hooks/use-toast.ts +194 -0
  120. data/docs/benchmark-dashboard/lib/benchmark-utils.ts +54 -0
  121. data/docs/benchmark-dashboard/lib/utils.ts +6 -0
  122. data/docs/benchmark-dashboard/next.config.mjs +14 -0
  123. data/docs/benchmark-dashboard/package-lock.json +5859 -0
  124. data/docs/benchmark-dashboard/package.json +72 -0
  125. data/docs/benchmark-dashboard/pnpm-lock.yaml +5 -0
  126. data/docs/benchmark-dashboard/postcss.config.mjs +8 -0
  127. data/docs/benchmark-dashboard/styles/globals.css +94 -0
  128. data/docs/benchmark-dashboard/tailwind.config.ts +96 -0
  129. data/docs/benchmark-dashboard/tsconfig.json +27 -0
  130. data/docs/benchmark-dashboard/vite.config.ts +24 -0
  131. data/docs/build.rb +52 -0
  132. data/docs/content/benchmarks/index.md +96 -0
  133. data/docs/content/features/_index.md +1 -1
  134. data/docs/content/getting_started/_index.md +76 -46
  135. data/docs/hugo.yaml +3 -0
  136. data/docs/static/results.json +1 -0
  137. data/docs/static/scripts/benchmark-dashboard.iife.js +211 -0
  138. data/docs/static/styles/benchmark-dashboard.css +1 -0
  139. data/examples/rails_with_static_assets/Gemfile.lock +1 -1
  140. data/examples/rails_with_static_assets/Itsi.rb +4 -1
  141. data/gems/scheduler/Cargo.lock +15 -15
  142. data/gems/scheduler/lib/itsi/scheduler/version.rb +1 -1
  143. data/gems/server/Cargo.lock +75 -73
  144. data/gems/server/exe/itsi +6 -1
  145. data/gems/server/lib/itsi/http_request.rb +31 -39
  146. data/gems/server/lib/itsi/http_response.rb +5 -0
  147. data/gems/server/lib/itsi/rack_env_pool.rb +59 -0
  148. data/gems/server/lib/itsi/server/config/config_helpers.rb +1 -2
  149. data/gems/server/lib/itsi/server/config/dsl.rb +5 -4
  150. data/gems/server/lib/itsi/server/config/middleware/etag.md +3 -7
  151. data/gems/server/lib/itsi/server/config/middleware/etag.rb +2 -4
  152. data/gems/server/lib/itsi/server/config/middleware/proxy.rb +1 -1
  153. data/gems/server/lib/itsi/server/config/middleware/rackup_file.rb +2 -2
  154. data/gems/server/lib/itsi/server/config/options/auto_reload_config.rb +6 -2
  155. data/gems/server/lib/itsi/server/config/options/include.rb +5 -2
  156. data/gems/server/lib/itsi/server/config/options/listen_backlog.rb +1 -1
  157. data/gems/server/lib/itsi/server/config/options/pipeline_flush.md +16 -0
  158. data/gems/server/lib/itsi/server/config/options/pipeline_flush.rb +19 -0
  159. data/gems/server/lib/itsi/server/config/options/send_buffer_size.md +15 -0
  160. data/gems/server/lib/itsi/server/config/options/send_buffer_size.rb +19 -0
  161. data/gems/server/lib/itsi/server/config/options/writev.md +25 -0
  162. data/gems/server/lib/itsi/server/config/options/writev.rb +19 -0
  163. data/gems/server/lib/itsi/server/config.rb +43 -31
  164. data/gems/server/lib/itsi/server/default_config/Itsi.rb +1 -4
  165. data/gems/server/lib/itsi/server/grpc/grpc_call.rb +2 -0
  166. data/gems/server/lib/itsi/server/grpc/grpc_interface.rb +2 -2
  167. data/gems/server/lib/itsi/server/rack/handler/itsi.rb +3 -1
  168. data/gems/server/lib/itsi/server/rack_interface.rb +17 -12
  169. data/gems/server/lib/itsi/server/route_tester.rb +1 -1
  170. data/gems/server/lib/itsi/server/scheduler_interface.rb +2 -0
  171. data/gems/server/lib/itsi/server/version.rb +1 -1
  172. data/gems/server/lib/itsi/server.rb +1 -0
  173. data/gems/server/lib/ruby_lsp/itsi/addon.rb +12 -13
  174. data/gems/server/test/helpers/test_helper.rb +12 -13
  175. data/gems/server/test/middleware/etag.rb +3 -3
  176. data/gems/server/test/middleware/grpc/grpc.rb +13 -14
  177. data/gems/server/test/middleware/grpc/test_service_impl.rb +3 -3
  178. data/gems/server/test/middleware/proxy.rb +262 -268
  179. data/gems/server/test/options/ruby_thread_request_backlog_size.rb +2 -3
  180. data/lib/itsi/version.rb +1 -1
  181. metadata +99 -6
  182. data/tasks.txt +0 -27
@@ -0,0 +1,252 @@
1
+ "use client"
2
+
3
+ import { useState, useEffect } from "react"
4
+ import { BenchmarkDashboard } from "@/components/benchmark-dashboard"
5
+ import { LoadingSpinner } from "@/components/ui/loading-spinner"
6
+
7
+ // Updated sample data with the new group hierarchy and longer version strings
8
+ const sampleHierarchicalData = [
9
+ {
10
+ cpu: "apple_m1_pro",
11
+ groups: [
12
+ {
13
+ group: "rack",
14
+ tests: [
15
+ {
16
+ test: "chunked",
17
+ servers: [
18
+ {
19
+ server: "agoo",
20
+ results: [
21
+ {
22
+ server: "agoo",
23
+ test_case: "chunked",
24
+ version: "Agoo v1.2.3 (Ruby 3.2.0) with experimental HTTP/2 support",
25
+ threads: 1,
26
+ workers: 1,
27
+ http2: false,
28
+ concurrency: 10,
29
+ rss_mb: 1.77,
30
+ results: {
31
+ successRate: 1.0,
32
+ total: 20000.0,
33
+ slowest: 5000000.0,
34
+ fastest: 200000.0,
35
+ average: 2500000.0,
36
+ requestsPerSec: 6500.0,
37
+ totalData: 0,
38
+ sizePerRequest: 0.0,
39
+ sizePerSec: 0.0,
40
+ errorDistribution: {},
41
+ p95_latency: 4.8,
42
+ },
43
+ timestamp: "2025-05-24T10:41:17Z",
44
+ },
45
+ {
46
+ server: "agoo",
47
+ test_case: "chunked",
48
+ version: "Agoo v1.2.3 (Ruby 3.2.0) with experimental HTTP/2 support",
49
+ threads: 1,
50
+ workers: 1,
51
+ http2: false,
52
+ concurrency: 50,
53
+ rss_mb: 1.77,
54
+ results: {
55
+ successRate: 0.95,
56
+ total: 28000.0,
57
+ slowest: 12000000.0,
58
+ fastest: 400000.0,
59
+ average: 6000000.0,
60
+ requestsPerSec: 9500.0,
61
+ totalData: 0,
62
+ sizePerRequest: 0.0,
63
+ sizePerSec: 0.0,
64
+ errorDistribution: {
65
+ timeout: 50,
66
+ },
67
+ p95_latency: 10.2,
68
+ },
69
+ timestamp: "2025-05-24T10:41:17Z",
70
+ },
71
+ ],
72
+ },
73
+ {
74
+ server: "puma",
75
+ results: [
76
+ {
77
+ server: "puma",
78
+ test_case: "chunked",
79
+ version:
80
+ "Puma version 6.6.0+h2o version 2.3.0-DEV@87e2aa634 (Ruby 3.2.2) with HTTP/2 support enabled",
81
+ threads: 1,
82
+ workers: 1,
83
+ http2: true,
84
+ concurrency: 10,
85
+ results: {
86
+ successRate: 1.0,
87
+ total: 15000.0,
88
+ slowest: 4000000.0,
89
+ fastest: 200000.0,
90
+ average: 2000000.0,
91
+ requestsPerSec: 5000.0,
92
+ totalData: 150000000,
93
+ sizePerRequest: 10000.0,
94
+ sizePerSec: 50000000.0,
95
+ errorDistribution: {},
96
+ p95_latency: 3.8,
97
+ },
98
+ },
99
+ {
100
+ server: "puma",
101
+ test_case: "chunked",
102
+ version:
103
+ "Puma version 6.6.0+h2o version 2.3.0-DEV@87e2aa634 (Ruby 3.2.2) with HTTP/2 support enabled",
104
+ threads: 1,
105
+ workers: 1,
106
+ http2: true,
107
+ concurrency: 50,
108
+ results: {
109
+ successRate: 1.0,
110
+ total: 22000.0,
111
+ slowest: 12000000.0,
112
+ fastest: 400000.0,
113
+ average: 6000000.0,
114
+ requestsPerSec: 7500.0,
115
+ totalData: 220000000,
116
+ sizePerRequest: 10000.0,
117
+ sizePerSec: 75000000.0,
118
+ errorDistribution: {},
119
+ p95_latency: 11.2,
120
+ },
121
+ },
122
+ ],
123
+ },
124
+ ],
125
+ },
126
+ {
127
+ test: "io_party",
128
+ servers: [
129
+ {
130
+ server: "itsi",
131
+ results: [
132
+ {
133
+ server: "itsi",
134
+ test_case: "io_party",
135
+ version:
136
+ "ITSI v0.9.1-beta.3 (Experimental) with advanced IO processing and HTTP/2 multiplexing support",
137
+ threads: 1,
138
+ workers: 1,
139
+ http2: true,
140
+ concurrency: 10,
141
+ rss_mb: 64.11,
142
+ results: {
143
+ successRate: 1.0,
144
+ total: 48591.0,
145
+ slowest: 2850375.0,
146
+ fastest: 116292.0,
147
+ average: 486975.0,
148
+ requestsPerSec: 16196.49,
149
+ totalData: 0,
150
+ sizePerRequest: 0.0,
151
+ sizePerSec: 0.0,
152
+ errorDistribution: {},
153
+ p95_latency: 0.977999,
154
+ },
155
+ timestamp: "2025-05-15T03:43:50Z",
156
+ },
157
+ ],
158
+ },
159
+ ],
160
+ },
161
+ ],
162
+ },
163
+ {
164
+ group: "sinatra",
165
+ tests: [
166
+ {
167
+ test: "hello_world",
168
+ servers: [
169
+ {
170
+ server: "falcon",
171
+ results: [
172
+ {
173
+ server: "falcon",
174
+ test_case: "hello_world",
175
+ version:
176
+ "Falcon v0.51.1 (Ruby 3.3.0-preview1) with HTTP/2 and WebSocket support, running on Async::HTTP::Protocol::HTTP2 implementation",
177
+ threads: 2,
178
+ workers: 2,
179
+ http2: true,
180
+ concurrency: 10,
181
+ results: {
182
+ successRate: 1.0,
183
+ total: 30000.0,
184
+ slowest: 10000000.0,
185
+ fastest: 400000.0,
186
+ average: 5000000.0,
187
+ requestsPerSec: 10000.0,
188
+ totalData: 0,
189
+ sizePerRequest: 0.0,
190
+ sizePerSec: 0.0,
191
+ errorDistribution: {},
192
+ p95_latency: 8.5,
193
+ },
194
+ },
195
+ ],
196
+ },
197
+ ],
198
+ },
199
+ ],
200
+ },
201
+ ],
202
+ },
203
+ ]
204
+
205
+ export default function Home() {
206
+ const [isLoading, setIsLoading] = useState(true)
207
+ const [benchmarkData, setBenchmarkData] = useState([])
208
+ const [error, setError] = useState<string | null>(null)
209
+
210
+ useEffect(() => {
211
+ const fetchData = async () => {
212
+ try {
213
+ // In a real app, this would fetch from your API endpoint
214
+ // For demo purposes, we're using the sample hierarchical data
215
+ setBenchmarkData(sampleHierarchicalData)
216
+ setIsLoading(false)
217
+ } catch (err) {
218
+ console.error("Error fetching benchmark data:", err)
219
+ setError("Failed to load benchmark data. Please try again.")
220
+ setIsLoading(false)
221
+ }
222
+ }
223
+
224
+ fetchData()
225
+ }, [])
226
+
227
+ if (isLoading) {
228
+ return (
229
+ <div className="flex h-screen items-center justify-center">
230
+ <LoadingSpinner />
231
+ <span className="ml-2">Loading benchmark data...</span>
232
+ </div>
233
+ )
234
+ }
235
+
236
+ if (error) {
237
+ return (
238
+ <div className="flex h-screen items-center justify-center">
239
+ <div className="text-center">
240
+ <h2 className="text-2xl font-bold text-red-600">Error</h2>
241
+ <p className="mt-2">{error}</p>
242
+ </div>
243
+ </div>
244
+ )
245
+ }
246
+
247
+ return (
248
+ <main className="container mx-auto p-2">
249
+ <BenchmarkDashboard data={benchmarkData} />
250
+ </main>
251
+ )
252
+ }