[erlang-questions] How to manage C ports that are suppose to handle a very high number of requests
Thu Aug 25 17:05:43 CEST 2016
Maybe something like poolboy is useful for you:
> On 25 Aug 2016, at 16:01, Arshad Ansari <> wrote:
> Hello there,
> I had earlier asked about how to access LuaJIT from erlang [http://erlang.org/pipermail/erlang-questions/2016-August/089939.html] and based on the responses, I decided to go with C port. It was working all great. Except, when I tried to call the same C-Port [luajit] code from erlang-diameter server. Since the requests were high, but not very high (approx 10K per second), the code fails with stack overflow on c side.
> Now I thought, I would create a seperate C port for each requests but that would mean there will be around 10K c-port processes. I'm now wondering how to handle this size of requests from the c port. Any help or direction is appreciated. Please let me know if my question is not clear. I'm attaching the code to access lua that works with single instance of c-port process.
> /************ CODE Details *********************/
> erl_com.c contains code to send/receive data from c side
> port.c runs the lua code and has main
> relay.erl starts the relay server and c port to talk to lua
> relay_cb.erl handles requests and communicates with lua
> erlang-questions mailing list
More information about the erlang-questions