[erlang-questions] Avoiding a bottleneck (nitrogen+yaws, app logic, couchbeam+couchdb)

Jeremy Raymond <>
Mon Dec 14 19:13:04 CET 2009


Hi,

Thanks I didn't think of this, but it seems reasonable. In your db interface
did you return the PID of the worker back to the calling interface so it
would know who to expect the response back from or just accept any response
back of the correct type?


Thanks,

Jeremy

On Sun, Dec 13, 2009 at 7:24 PM, Vasilij Savin <>wrote:

> Greetings,
>
> I can tell you about the solution we used in similar situation. It does not
> mean it is optimal, but it was the best we came up with.
>
> Each gen_server call to db interface will generate a separate handler
> thread that will work with couchDB directly. You will need to pass both PID
> and NodeID though. Then your client will have to wait for message from that
> server thread using standard messaging or if it is gen_server itself - using
> handle_info.
>
> This way interface between DB and frontend hopefully will not be
> bottleneck, or at least should scale as each request will be handled by
> separate thread.
>
> I would like to ask others to give opinion on this solution.
>
> Regards,
> Vasilij Savin
>


More information about the erlang-questions mailing list