Open Collective
Open Collective
Loading

ngx_mruby

A Fast and Memory-Efficient Web Server Extension Mechanism Using Scripting Language mruby for nginx

Contribute


Become a financial contributor.

Financial Contributions

Recurring contribution
Backer

Become a backer for $5.00 per month and support us

Starts at
$5 USD / month

Latest activity by


Be the first one to contribute!
Recurring contribution
Sponsor

Become a sponsor for $100.00 per month and support us

Starts at
$100 USD / month

Latest activity by


Be the first one to contribute!
Custom contribution
Donation
Make a custom one-time or recurring contribution.

Latest activity by


Top financial contributors

1
Takuto Kanzaki

$10 USD since Mar 2023

2
Simon Chiu

$5 USD since Mar 2019

ngx_mruby is all of us

Our contributors 4

Thank you for supporting ngx_mruby.

Budget


Transparent and open finances.

View all transactions
+$10.00USD
Completed
Contribution #638403

Debit from ngx_mruby to Guest

-$0.50USD
Completed
Contribution #423936

Credit from Guest to ngx_mruby

+$0.50USD
Refunded
Contribution #423936
$
Today’s balance

$12.01 USD

Total raised

$12.32 USD

Total disbursed

$0.31 USD

Estimated annual budget

--.-- USD

Connect


Let’s get the ball rolling!

News from ngx_mruby

Updates on our activities and progress.

ngx_mruby v2 Released

- Run request handler script on Fiber and Proc #343 - Support non-blocking sleep #343 thanks @syucream - Support non-blocking http[s] clients #345 thanks @pyama86 - upgrade mruby to 1.4.1 - Add Nginx.status_code= alias Nginx.return - Sup...
Read more
Published on June 27, 2018 by Ryosuke Matsumoto

About


ngx_mruby - A Fast and Memory-Efficient Web Server Extension Mechanism Using Scripting Language mruby for nginx.

As the increase of large-scale and complex Web services, not only the development of Web applications is required, but also the implementation of Web server extensions in many cases. Most Web server extensions are mainly implemented in the C language because of fast and memory-efficient behavior, but by writing extensions using a scripting language we can achieve better maintainability and productivity.

However, if the existing methods are primarily intended to enhance not the implementation of Web applications but the implementation of internal processing of the Web server, the problem remains in terms of speed, memory-efficiency and safety.

Therefore, we propose a fast and memory-efficient Web server extension mechanism using a scripting language. We designed an architecture where the server process creates a region in memory to save the state of the interpreter at the server process startup, and multiple scripts share this region to process the scripts quickly when new request are made.

The server process frees the global variables table, the exception flag and the byte-code which cause an increase of memory usage, in order to reduce the memory usage and extend safety by preventing interference between each script because of sharing the region. We implemented a mechanism that can extend the internal processing of nginx easily by Ruby scripts using nginx and the embeddable scripting language mruby. It's called "ngx_mruby".

Our team