[erlang-questions] embedded systems erlang?

Dmitry Kolesnikov dmkolesnikov@REDACTED
Wed Dec 17 12:48:02 CET 2014


Erlang demands some memory on embedded system but you can run decent applications on some HW platforms.
I think the lowest grade HW is Raspberry PI B Model with 512MB RAM (I’ve not touched HW with lower memory).
I am successfully running OTP 17.3 with web server that proxies requests to serial port. This is not a faster solution available on the globe but it address my immediate needs as fault tolerant HW controller.   

I’ve made some benchmark for you with 8 concurrent load source that sends HTTP POST request to web server over Wi-Fi, the payload is 1KB. The server handles 75 RPS on average, the memory consumption peaks to 24MB. Mean response latency is 250ms but 95th percentile goes to 500ms. However, the single load source with same traffic pattern shows different results. The benchmark driver generates about 50 RPS on average, mean response latency is less then 100ms, 99 percent of requests is responded within 250ms.

Just starting the shell on 17.3 on Raspberry PI B Model uses about 7 MB but you can reduce it to 4MB with some VM restrictions on number of processes, stack sizes, etc.

root@REDACTED:/home/pi# erl
Eshell V6.2  (abort with ^G)
1> erlang:memory().

- Dmitry

> On 17 Dec 2014, at 10:40, Matthias Lang <matthias@REDACTED> wrote:
> On Monday, December 15, Raoul Duke wrote:
>> I see many google hits for things people have done with Erlang
>> targeting "embedded" resource constrained systems. But I'm not sure if
>> there's like an official build or something for it?
> There is no "official" build for "resource constrained" erlang.
> But cross compilation, which is a hurdle for many embedded systems, has
> been part of the official build for years now (it's definitely in R14B03,
> probably appeared around R12 or R13)
>> Does everybody hack up their own thing?
> Yes, because different people's embedded systems are quite different.
>> I'm looking at like 256 K RAM (!)
> There's no way you'll get normal Erlang to run in that.
> Just starting the shell on R14B03 on a 32 bit ARM CPU uses about 10 MB.
> Older versions of Erlang, e.g. R7, were a bit less hungry, maybe 6 MB.
> But 256 K is totally out of reach.
> Here's erlang:memory() on an ARM, for a newly started emulator which
> hasn't done anything other than start the shell:
> Erlang R14B03 (erts-5.8.4) [source] [rq:1] [async-threads:0] [kernel-poll:false]
> Eshell V5.8.4  (abort with ^G)
> 1> erlang:memory().
> [{total,3488376},
> {processes,679792},
> {processes_used,673232},
> {system,2808584},
> {atom,300553},
> {atom_used,272023},
> {binary,17688},
> {code,1745473},
> {ets,86156}]
> the values are in bytes. (The memory use according to the OS is 10 MB for
> that emulator)
> Matt
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list