Replies: 1 comment 1 reply
-
My goal is to build a high throughput and (ideally low latency) HTTP server capable of running sets of scripts which can be updated dynamically. The idea is to have a pool of prepared interpreters that each requests checks out from, runs the scripts, and returns the appropriate output. I'm enabling I'm also trying to achieve this with Duktape.cr at the moment, and have had some minor success, even with However, there are some issues. Duktape.cr handles pool reuse fine, but calling into Crystal from JS is experimental. If there's a script that calls out to Crystal and causes a Fiber switch (IO, sleep, etc), resumption of the Fiber can cause crashes. It also does not easily facilitate calling Crystal instances (only static methods), which is a little bit annoying. However, I can achieve 100k rps on my M1X MBP when reusing pools (but not shelling out to IO). Creating a new Duktape::Runtime for every request is slow (4k rps), but this doesn't crash even with IO, and scales alright by increasing My ideal situation would be able to use the same pool of Anyolite interpreters while being able to do IO. I don't require communication between interpreters, or passing values between interpreters. |
Beta Was this translation helpful? Give feedback.
-
Based on #26, this thread can be used to discuss how exactly to implement support for multiple interpreters.
Some of the problems:
Implementing multiple interpreters is definitely something I'd like to do, but all of the problems above need to be addressed, first.
My major question currently is: Are there actual use cases where the advantages outweigh these disadvantages?
Beta Was this translation helpful? Give feedback.
All reactions