[erlang-questions] Erlang HTTP client libraries- pros/cons

Max Lapshin <>
Sat Sep 2 07:22:36 CEST 2017


HTTP client over external port is the most expensive way in all terms:

1) programming. It is REALLY hard to debug it.  Was it launched under
valgrind? If no, then there are at least 5 horrible memory leaks and memory
corruptions per each screen of code that haven't been discovered yet

2) deploying. Deploying NIF is a pain because you need to have build farm
for each architecture that you target to.  For example, we deploy flussonic
under suse 10, debian 7, debian8/ubuntu16, arm7, arm8, windows, elbrus 2k.
  All these platforms are different and you cannot rely on cross compiler.
Good luck with building repeatable infrastructure for compiling under
windows.

If you have erlang code, you can compile under mac and launch under windows
because guys from OTP team have already done all dirty job. Just read their
manual and follow it.

3) speed. It will be slow in all terms. High latency due to multiple OS
process scheduling: read in one process, then write to pipe and send
further.  Do you think that linux pipe is a "good and optimized" thing? It
is not.
What if we speak about high traffic?  1 gigabit of input will become
several gigabits of _useless_ copying data.




So I do not understand what can give libcurl that cannot be achieved in
plain erlang.  It is definitely not about high traffic speed because plain
vanilla lhttpc can download 10 Gbit/s over fiber without any extra
modifications.


On Thu, Aug 31, 2017 at 10:22 AM, Paul Oliver <> wrote:

> On Thu, Aug 31, 2017 at 6:20 PM Taras Halturin <> wrote:
>
>> I think, Max means that you choose most expensive way to deal with it and
>> it's not about efficiency of http handling but about efficiency of aim
>> achieving :)
>>
>>
> The most expensive way in terms of what? If not speed do you mean
> development effort? Given that the aim is to use libcurl then the choice is
> a port executable or some sort of NIF. When using a port executable I don't
> have to worry about it crashing my VM and all I pay is the price of port
> communications. If I use a NIF I have to concern myself with making sure my
> NIF code and the code in libcurl doesn't crash my VM. That's a lot more
> development time and risk.
>
> Cheers,
> Paul.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170902/e54b4269/attachment.html>


More information about the erlang-questions mailing list