~/talk

Design pattern for embedding mruby into middleware

Talkat RubyKaigi 2018 · 2018-05-31..06-02· [ruby, embedded-and-hardware]
links:none on file
slides:none on file

mruby is embedded into middleware like ngx_mruby with a clear pattern: create mrb_state at init, compile Ruby into bytecode, and execute cached bytecode per request for high throughput. Experiments show per-request mrb_state creation limits throughput to ~6k req/s, per-request compile reaches ~46k req/s, and cached bytecode runs ~64k req/s. Design covers precompile bytecode at init, per-thread/per-worker mrb_state reuse, and a suspend/resume model using fibers and event-loop callbacks to keep blocking Ruby calls nonblocking.

AI-written summary · about

  1. 0:00Introduction and background
  2. 10:18Why embed mruby in middleware
  3. 13:37Design patterns for mruby state
  4. 27:47Non-blocking operations with mruby
  5. 36:53Implementation in nginx
  6. 40:14Conclusion and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.