-
Notifications
You must be signed in to change notification settings - Fork 17
/
2020-04-21-io-thread-benchmark.adoc.po
411 lines (355 loc) · 24.1 KB
/
2020-04-21-io-thread-benchmark.adoc.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2022-05-12 15:52+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. type: YAML Front Matter: title
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "A IO thread and a worker thread walk into a bar: a microbenchmark story"
msgstr "一个IO线程和一个工人线程走进酒吧:一个微基准的故事"
#. type: YAML Front Matter: synopsis
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Understand when and how to use the Quarkus IO thread and its influence on microbenchmarks."
msgstr "了解何时和如何使用Quarkus IO线程以及它对微观测试的影响。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"A competitor recently published a microbenchmark comparing the performance of their stack to Quarkus.\n"
"The Quarkus team feels this microbenchmark shouldn’t be taken at face value because it wasn’t making a like-to-like comparison leading to incorrect conclusions.\n"
"Both of the two frameworks under comparison support reactive processing.\n"
"Reactive processing enables running the business logic directly on the _IO thread_, which ultimately performs better in microbenchmark focusing on response time and concurrency.\n"
"The microbenchmark should have been written so that both frameworks (or neither framework) obtain this benefit.\n"
"Anyway, this turns out to be a very interesting topic and good information for Quarkus users, so read on."
msgstr "一家竞争对手最近发布了一项微基准测试,将其堆栈性能与 Quarkus 进行了比较。Quarkus 团队认为这个微基准测试不应该被视为表面价值,因为它并没有进行同类比较,从而得出了错误的结论。对比的两个框架都支持反应式处理。反应式处理可直接在 _IO 线程_ 上运行业务逻辑,最终在注重响应时间和并发性的微基准测试中表现更好。在编写微基准测试时,应该让两个框架(或两个框架都不支持)都能获得这种优势。总之,这对 Quarkus 用户来说是一个非常有趣的话题和很好的信息,请继续阅读。"
#. type: Title ==
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "tl; dr;"
msgstr "tl; dr;"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"Quarkus https://quarkus.io/blog/runtime-performance/[has great performance] for both imperative and reactive workloads.\n"
"It’s because Quarkus is itself based on Eclipse Vert.x, a mature top performing reactive framework, in such a way that allows you to layer, mix and match the IO paradigm that best fits your use-case."
msgstr "Quarkus 对于命令式工作负载和反应式工作负载都 link:https://quarkus.io/blog/runtime-performance/[具有出色的性能] 。这是因为 Quarkus 本身就是基于 Eclipse Vert.x(一个成熟的高性能反应式框架)开发的,它允许你分层、混合和匹配最适合你的用例的 IO 范式。"
#. type: Plain text
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "If you have a REST scenario well suited to run _purely on the IO thread_, add a Vert.x Reactive Route using https://quarkus.io/guides/reactive-routes[Quarkus Reactive Routes] and your app will get better performance than using Quarkus RESTEasy."
msgstr "如果你有一个很适合 _纯粹在IO线程上_ 运行的REST场景,使用 link:https://quarkus.io/guides/reactive-routes[Quarkus Reactive Routes] 添加一个Vert.x Reactive Route,你的应用将获得比使用Quarkus RESTEasy更好的性能。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"We ran this low-work REST + validation competitor-written microbenchmark which features no blocking operation, just returning static data.\n"
"When using Quarkus Reactive Routes to run Quarkus _purely on the IO thread_, **we observed 2.6x times the requests/sec and 30% less memory usage (RSS)** than running with Quarkus RESTEasy (which mixes IO thread and worker thread).\n"
"But that’s on a microbenchmark purpose built to this specific scenario (more on that later)."
msgstr "我们运行了竞争对手编写的这个低功耗 REST + 验证微基准测试,该测试没有阻塞操作,只是返回静态数据。当使用 Quarkus Reactive Routes _纯粹在 IO 线程上_ 运行 Quarkus 时,与使用 Quarkus RESTEasy(混合了 IO 线程和工作线程)相比, *我们观察到的请求数/秒增加了 2.6 倍,内存使用量(RSS)减少了 30%* 。不过,这是在专门为这种特定场景设计的微基准测试上(稍后详述)。"
#. type: Title ==
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "More interesting read"
msgstr "更多有趣的阅读"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"The microbenchmark itself is uninteresting, but it is a good demonstrator of a phenomenon that can happen in reactive stacks.\n"
"Let’s use it as a vehicle to learn more about Quarkus and its reactive engine."
msgstr "微基准本身并不有趣,但它很好地展示了反应堆栈中可能出现的一种现象。让我们以它为载体,进一步了解 Quarkus 及其反应式引擎。"
#. type: Title ===
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Imperative and Reactive: the elevator pitch"
msgstr "强迫性和反应性:升降机演讲"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"This blog post does not explain the fundamental differences between the imperative execution model and the reactive execution model.\n"
"However, to understand why we see so much difference in the mentioned microbenchmark, we need some notions."
msgstr "这篇博文并没有解释命令式执行模型和反应式执行模型之间的根本区别。不过,要理解为什么我们在上述微基准测试中看到如此大的差异,我们需要一些概念。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"In general, Java web applications use imperative programming combined with blocking IO operations.\n"
"This is incredibly popular because it is easier to reason about the code.\n"
"_Things_ get executed sequentially.\n"
"To make sure one request is not affected by another, they are run on different threads.\n"
"When your workload needs to interact with a database or another remote service, it relies on blocking IO.\n"
"The thread is blocked waiting for the answer.\n"
"Other requests running on different threads are not slowed down significantly.\n"
"But this means one thread for every concurrent request, which limits the overall concurrency."
msgstr "一般来说,Java 网络应用程序使用命令式编程,并结合阻塞 IO 操作。这种编程方式非常流行,因为它更容易对代码进行推理。 _事情_ 会按顺序执行。为了确保一个请求不受另一个请求的影响,它们会在不同的线程上运行。当你的工作负载需要与数据库或其他远程服务交互时,它依赖于阻塞 IO。线程被阻塞,等待应答。运行在不同线程上的其他请求不会明显减速。但这意味着每个并发请求都需要一个线程,从而限制了整体并发性。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"On the other side, the reactive execution model embraces asynchronous development models and non blocking IOs.\n"
"With this model, multiple requests can be handled by the same thread.\n"
"When the processing of a request cannot make progress anymore (because it requests a remote service, or interacts with a database), it uses non blocking IO.\n"
"This releases the thread immediately, which can then be used to serve another request.\n"
"When the result of the IO operation is available, the processing of the request is restored and continues its execution.\n"
"This model enables the usage of the _IO thread_ to handle multiple requests.\n"
"There are two significant benefits.\n"
"First, the response time is smaller because it does not have to jump to another thread.\n"
"Second, it reduces memory consumption as it decreases the usage of threads.\n"
"The reactive model uses the hardware resources more efficiently, but... there is a significant drawback.\n"
"If the processing of a request starts to block, this gets real bad.\n"
"No other request can be handled.\n"
"To avoid this, you need to learn how to write non blocking code, how to structure asynchronous processing, and how to use non blocking IOs.\n"
"It's a paradigm shift."
msgstr "另一方面,反应式执行模型包含异步开发模型和非阻塞 IO。在这种模式下,同一线程可以处理多个请求。当一个请求的处理无法再取得进展时(因为它请求远程服务或与数据库交互),就会使用非阻塞 IO。这将立即释放线程,使其可以为另一个请求提供服务。当 IO 操作的结果可用时,请求的处理就会恢复并继续执行。这种模式可以使用 _IO 线程_ 处理多个请求。这样做有两个显著的好处。首先,由于无需跳转到另一个线程,因此响应时间更短。其次,由于减少了线程的使用,因此降低了内存消耗。反应式模型能更有效地利用硬件资源,但......也有一个明显的缺点。如果一个请求的处理开始阻塞,情况就会变得非常糟糕。其他请求将无法处理。为了避免这种情况,你需要学习如何编写非阻塞代码,如何构建异步处理,以及如何使用非阻塞 IO。这是一种模式的转变。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"In Quarkus, we want to make the shift as easy as possible.\n"
"However, we have observed that the majority of user applications are written using the imperative model.\n"
"That is why, when the user application uses JAX-RS, Quarkus defaults to execute the (imperative) workload to a _worker thread_."
msgstr "在 Quarkus 中,我们希望尽可能简化这种转变。但是,我们发现大多数用户应用程序都是使用命令式模型编写的。这就是为什么当用户应用程序使用 JAX-RS 时,Quarkus 会默认将(命令式)工作负载执行到 _工作线程_ 中。"
#. type: Title ===
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Hello world microbenchmark: IO thread or worker thread?"
msgstr "你好,世界》微测试。IO线程还是工作线程?"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"Back to the competitor’s microbenchmark, we have a REST endpoint doing some trivial processing and some equally trivial validation.\n"
"Pretty much no meaningful business work.\n"
"This is the Hello World of REST for all intents and purposes."
msgstr "回到竞争对手的微基准测试,我们有一个 REST 端点正在进行一些琐碎的处理和同样琐碎的验证。几乎没有任何有意义的业务工作。这就是 REST 的 Hello World。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"When you run the microbenchmark with Quarkus RESTEasy, the request is handled by the reactive engine on the _IO thread_ but then the processing work is handed over to a second thread from the _worker thread pool_.\n"
"That’s called _dispatch_.\n"
"When your microbenchmark does as little as Hello World, then the dispatch overhead is proportionally big.\n"
"The dispatch overhead is not visible in most (real life) applications but is very visible in artificial constructs like microbenchmarks."
msgstr "使用 Quarkus RESTEasy 运行微基准测试时,请求由 _IO 线程_ 上的反应式引擎处理,但处理工作会交给工作 _线程池中_ 的第二个线程。这就是所谓的 _调度_ 。如果您的微基准测试只做了 Hello World 这么小的工作,那么调度开销就会成正比地增加。在大多数(现实生活中的)应用程序中,调度开销并不明显,但在微基准测试等人工构造中却非常明显。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"The competitor’s stack, however, runs all the request operations on the IO thread by default.\n"
"So what this microbenchmark was actually comparing is just the cost of dispatching to the worker thread pool.\n"
"And frankly (according to the competitor's numbers) and in spite of this extra dispatch work, Quarkus did very very well achieving ~95% of the competitor’s throughput today! I say today because we are always improving upon performance, and in fact we expect to see further gains in the soon to be released 1.4 release."
msgstr "而竞争对手的堆栈默认在 IO 线程上运行所有请求操作。因此,这个微基准测试实际比较的只是向工作线程池调度的成本。坦率地说(根据竞争对手的数据),尽管有这些额外的调度工作,Quarkus 今天的吞吐量仍然达到了竞争对手的 95%!之所以说 \"今天\",是因为我们一直在不断改进性能,事实上,我们希望在即将发布的 1.4 版本中看到进一步的改进。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "*When compared at a disadvantage (dispatching to a worker thread), Quarkus is nevertheless almost as fast in throughput.*"
msgstr "*如果以劣势(调度到工作线程)进行比较,Quarkus 的吞吐量几乎一样快。*"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"… But wait, Quarkus can also avoid the dispatch altogether and run operations on the IO Thread.\n"
"This is a more accurate comparison to how the competitor' stack was configured to do as in both case, it is the user's responsibility to ask for a dispatch if and when needed by the application.\n"
"To compare apples to apples, let’s use https://quarkus.io/guides/reactive-routes[Quarkus Reactive Routes] backed by Eclipse Vert.x.\n"
"In this model, operations are run on the IO thread by default."
msgstr "......不过,Quarkus 也可以完全避免调度,在 IO 线程上运行操作。这与竞争对手的堆栈配置相比更为准确,因为在这两种情况下,用户都有责任在应用程序需要时请求调度。在这种模式下,操作默认在 IO link:https://quarkus.io/guides/reactive-routes[线程] 上运行。"
#. type: Plain text
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "This is not very different from your JAX-RS equivalent."
msgstr "这与你的JAX-RS等价物没有很大区别。"
#. type: Title ===
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Throughput Numbers"
msgstr "吞吐量数字"
#. type: Plain text
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "We ran the microbenchmark application in a docker container constrained to reflect a typical resource allocation to a container orchestrated by Kubernetes:"
msgstr "我们在一个docker容器中运行微测试应用程序,以反映由Kubernetes协调的容器的典型资源分配。"
#. type: Plain text
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "4 CPU"
msgstr "4 CPU"
#. type: Plain text
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "256 MB of RAM"
msgstr "256MB的内存"
#. type: Plain text
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "and `-Xmx128m` heap usage for the Java process"
msgstr "和 `-Xmx128m` Java进程的堆使用情况"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"We saw that Quarkus using Reactive Routes ran 2.6 times the requests/sec.\n"
"2.6 times!\n"
"It makes sense! Remember the application code virtually does nothing, so the dispatch cost is comparatively high.\n"
"If you were to write a more real life workload (maybe even having a blocking operation like a JPA access and therefore forcing a dispatch), then the results would be very different.\n"
"Context matters!"
msgstr "我们看到,使用反应式路由的 Quarkus 的请求运行速度是原来的 2.6 倍/秒。2.6 倍!这是有道理的!请记住,应用程序代码实际上什么都没做,因此调度成本相对较高。如果你要编写一个更真实的工作负载(甚至可能有一个阻塞操作,比如 JPA 访问,从而强制调度),那么结果将截然不同。上下文很重要!"
#. type: Plain text
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "You can find code and how to reproduce the microbenchmark https://github.com/johnaohara/quarkus-iothread-workerpool/tree/1.3.1.Final[here on GitHub]."
msgstr "你可以 link:https://github.com/johnaohara/quarkus-iothread-workerpool/tree/1.3.1.Final[在GitHub上] 找到代码和如何重现该微观基准。"
#. type: Block title
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Microbenchmark results comparing Quarkus dispatching to a worker thread vs running purely on the IO thread"
msgstr "比较Quarkus调度到工作线程与纯粹在IO线程上运行的微观基准测试结果"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Quarkus - 1.3.1.Final - 4 CPU's"
msgstr "Quarkus - 1.3.1.Final - 4个CPU"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Worker thread"
msgstr "工作者线程"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "IO thread"
msgstr "IO线程"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Ratio"
msgstr "比率"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Mean Start Time to First Request (ms) footnote:[‘Mean Start Time to First Request’ was measured using an application built as an UberJar]"
msgstr "到第一个请求的平均开始时间(毫秒)[ link:#_footnotedef_1[1, id=\"_footnoteref_1\", class=\"footnote\", title=\"View footnote.\"]] 。 "
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "993.9"
msgstr "993.9"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "868.3"
msgstr "868.3"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "87.4%"
msgstr "87.4%"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Max RSS (MB)"
msgstr "最大RSS (MB)"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "138.8"
msgstr "138.8"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "97.9"
msgstr "97.9"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "70.5%"
msgstr "70.5%"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Max Throughput (req/sec)"
msgstr "最大吞吐量(req/秒)"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "46,172.2"
msgstr "46,172.2"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "123,520.4"
msgstr "123,520.4"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "267.5%"
msgstr "267.5%"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "Max Req/Sec/MB"
msgstr "最大需求量/秒/MB"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "332.7"
msgstr "332.7"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "1,262.1"
msgstr "1,262.1"
#. type: Table
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy, no-wrap
msgid "379.4%"
msgstr "379.4%"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid "*In a fair comparison (purely remaining on the IO thread - no dispatch), Quarkus more than double its throughput.*"
msgstr "*在公平的比较中(纯粹停留在 IO 线程上,没有调度),Quarkus 的吞吐量比其高出一倍多。*"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"As the generated load tends towards the maximum throughput of the system under test, the response time experienced by the client increases exponentially.\n"
"So the best system (for the workload) has a vertical line as far to the right as possible.\n"
"Equally important is to have as flat a line as possible for the longest time.\n"
"You do not want the response time to degrade before the system reaches maximum throughput."
msgstr "当生成的负载趋向于被测系统的最大吞吐量时,客户端的响应时间将呈指数增长。因此,(对于工作负载而言)最佳系统的垂直线应尽可能靠右。同样重要的是,在最长的时间内要有一条尽可能平的线。在系统达到最大吞吐量之前,不要让响应时间缩短。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"By the way, in the competitor microbenchmark Quarkus is shown as consuming more RSS (more RAM).This is also explained by the worker thread pool being operated whereas the competitor did not have a worker thread pool.\n"
"The Quarkus Reactive Routes solution (on a pure IO event run) shows a 30% RSS usage reduction."
msgstr "顺便提一下,在竞争对手的微基准测试中,Quarkus 显示消耗了更多的 RSS(更多 RAM),这也是因为运行了工作线程池,而竞争对手没有工作线程池。Quarkus Reactive Routes 解决方案(在纯 IO 事件运行中)显示减少了 30% 的 RSS 使用量。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"In this graph, the lower, the better.\n"
"We see that the pure IO thread solution manages to increase throughput with little to no change to the memory usage (RSS), that's very good!"
msgstr "在这张图中,越低越好。我们看到,纯 IO 线程解决方案在几乎不改变内存使用量(RSS)的情况下提高了吞吐量,这非常好!"
#. type: Title ==
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, no-wrap
msgid "Conclusion"
msgstr "解决方案"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"Quarkus offers you the ability to safely run blocking operations, run non blocking operations on the IO thread or mix both models.\n"
"The Quarkus team takes performance very seriously and we see Quarkus as offering great numbers whether you use the imperative or reactive models.\n"
"In more realistic workloads, the dispatch cost would be much less significant, you would not see such drastic differences between the two approaches.\n"
"As usual, test as close to your real application as possible."
msgstr "Quarkus 可以让你安全地运行阻塞操作,在 IO 线程上运行非阻塞操作,或者混合两种模式。Quarkus 团队非常重视性能,我们认为,无论使用命令式还是反应式模型,Quarkus 都能提供出色的性能。在更现实的工作负载中,调度成本的影响要小得多,你不会看到两种方法之间存在如此巨大的差异。与往常一样,测试应尽可能接近实际应用。"
#: _posts/2020-04-21-io-thread-benchmark.adoc
#, fuzzy
msgid ""
"Mystery solved.\n"
"Benchmarks are hard, challenge them.\n"
"But the moral of the story is that in all bad comes some good.\n"
"We’ve now learned how to run Quarkus applications entirely on the IO thread.\n"
"And how in some situations that can make a big difference.\n"
"Remember, don’t block! In fact, Quarkus https://quarkus.io/guides/all-config#quarkus-vertx-core_quarkus.vertx.warning-exception-time[can warn you if you do so].\n"
"Oh and we also learned that Quarkus is so fast, it can even beat itself ;p"
msgstr "谜底揭晓基准很难,挑战它们吧。但这个故事的寓意是,坏事也有好的一面。我们现在已经学会了如何完全在 IO 线程上运行 Quarkus 应用程序。在某些情况下,这将带来巨大的不同。记住,不要阻塞!事实上, link:https://quarkus.io/guides/all-config#quarkus-vertx-core_quarkus.vertx.warning-exception-time[如果你这样做了] ,Quarkus link:https://quarkus.io/guides/all-config#quarkus-vertx-core_quarkus.vertx.warning-exception-time[会向你发出警告] 。哦,我们还了解到,Quarkus 是如此之快,它甚至可以打败自己;p"