background preloader

Erlang

Facebook Twitter

Erlang Engine Tuning by Erik Stenman on Prezi. Performance optimization 101 - Erlang Factory SF 2014. Making Trivial Erlang/OTP Releases With Relx. Thanks to Tristan Sloughter and his recent work on relx making an Erlang/OTP no-downtime release is now super, super trivial. Like, so trivial you should just go ahead and plan to do it. In this article I’m going to assume you’re pretty familiar with Erlang but haven’t made any no-downtime releases yet and aren’t quite sure where to start. EDIT (September 23, 2013): This article targets relx version 0.2.0. As of 0.3.0 the syntax for upgrading/downgrading has changed to be simply install VSN_NUMBER. This change thanks to Richard Jones. On no-downtime releases I’ve got two special terms to introduce. Designing your system to be release-ready, building release tarballs for a running system and performing the steps to swap releases on a running system. It used to be that points two and three were the most difficult: release_handler and systools are older and have assumptions that, without context, seem peculiar.

Designing for OTP releases How, then, does one design a system for releases? Distel = Emacs erlang-mode++ - 百万军中. 原文地址: There are a number of different editor options for people wanting to develop Erlang code (see here, here, here); however, most people seem to use Emacs (which suits me just fine, because that's what I use most of the time anyhow). For Emacs users, the standard Erlang Mode for Emacs (which is included as part of the Erlang distribution) is what most people use. It has a lot of the functionality that you need when working with Erlang code and a lot of the "traditional" things that are normally found in an Emacs major mode for a programming language. It has support for things such as: However, coming from a Lisp background, I'm used to being able to interact directly with the underlying Lisp implementation, and I missed not having that available when working with Erlang code.

First of all, a few tips about installing Distel. Svn checkout distel In addition, I add the following customizations: describe-mode. How WhatsApp Grew to Nearly 500 Million Users, 11,000 cores, and 70 Million Messages a Second. When we last visited WhatsApp they’d just been acquired by Facebook for $19 billion. We learned about their early architecture, which centered around a maniacal focus on optimizing Erlang into handling 2 million connections a server, working on All The Phones, and making users happy through simplicity. Two years later traffic has grown 10x. How did WhatsApp make that jump to the next level of scalability? Rick Reed tells us in a talk he gave at the Erlang Factory: That's 'Billion' with a 'B': Scaling to the next level at WhatsApp (slides), which revealed some eye popping WhatsApp stats: What has hundreds of nodes, thousands of cores, hundreds of terabytes of RAM, and hopes to serve the billions of smartphones that will soon be a reality around the globe?

What are some of the most notable changes from two years ago? Obviously much bigger in every dimension, except the number of engineers. Rick always gives a good talk. Stats Stack Hardware System Overview Erlang love. Decoupling Parallelize. Your first Erlang program (in style). - Ward Bekker. Always wanted to learn Erlang? Let’s create your first Erlang “Hello World” program in style! In this HOWTO I’ll show you how to setup a bleeding edge Erlang development VPS and how to run you first Erlang program.

Erlang’s main strength is it’s concurrency support. It likes cores, so for our ‘Hello World’ program we obviously need cores. Create an account on Digital Ocean if you don’t have one yet (love them) and we’re going to boot up their biggest instance. 64GB and 20 cores will make our Hello World so snappy! Pick a datacenter location near you.Select the latest version of Ubuntu: 13.10 x64.Create the Droplet.And ssh to your Droplet with the credentials received from Digital Ocean: ssh root@your_ip_address. We’re going to compile Erlang from it’s github repository master branch, At the time of writing it’s a few commits after R17 release candidate 2 which comes with a Hipe LLVM backend, maps and named funs.

Install the required Ubuntu packages: Fire up Tmux: And add Great! Exit emacs:

Frameworks

Announcing “Nitrogen Elements” 0.2.1 | R.Shestakov. I have been working on the re-incarnated project “Nitrogen Elements” – which is a collection of useful Nitrogen GUI elements and now it is time to make a first release – v.0.2.1. The project contains the implementation for the following elements: Action DialogAccordion TabsMenuMenubar jsGridProgressbarLayout most of these elements are wrappers for jQuery UI widgets. You can find Nitrogen_Elements here. You can clone the git repo with: or you can include Nitrogen_Elements as a dependency to your Nitrogen project by adding the following to your rebar.config: The best way to get familiar with Nitrogen_Elements is to clone Nitrogen_Elements_Example project which shows practical usage : in the browser go to locahost:8000 To use Nitrogen_Elements in your code you need to include the header: you also need to include the following to your html template: Hopefully, this will be useful for somebody.

Like this: Like Loading... Comparison of Erlang Web Frameworks · ChicagoBoss/ChicagoBoss Wiki. Extend/cowboy. N2O. N2O: Web Framework for Erlang/OTP Nitrogen 2 Optimized, N2O was started as the first Erlang Web Framework that relies completely on WebSocket transport. Great compatibility with Nitrogen was retained and many improvements were made, such as binary page construction, binary data transfer, all events transmitted over WebSocket channel, minumum process spawns, work within Cowboy processes. N2O page renderer is several times faster than the original one.

Wide Coverage N2O is an unusual framework that solves problems in different web development domains while staying small and concise at the same time. Started off as a Nitrogen concept of server-side framework it can also build client-side offline applications using same site sources. This becomes possible with the powerful Erlang JavaScript Parse Transform which extends Erlang language to JavaScript platform with two-side interoperability.

Why Erlang in Web? Web-Servers raw performance grand congregation Rich and Lightweight Applications. ChicagoBoss/ChicagoBoss. How Nitrogen processes requests – part 1 | R.Shestakov. If you have used Nitrogen for a while, you might start wandering how Nitrogen actually processes your requests and what is happening under the hood. Unfortunately the documentation on this part is particularly patchy. There is a very good introductory tutorial which says this: Well, I never saw the “Complex version”. This is the attempt to explain some of the steps that Nitrogen takes to render the page. (I am treating this as study notes so I am more than certain that I will make some mistakes or even get something completely wrong – feel free to correct me. I am also only studying how Nitrogen works with Cowboy http server.).

Big picture When a user hits an URL serving Nitrogen pages, the request first goes to http server. Http server (Cowboy for example) will have a routing table which you need to define during server initialization. The table might look like this (this is Cowboy 0.6 specific! Where “Mod” is “cowboy_request_bridge” or implementation for another http server. Like this: How to build a live datagrid with Nitrogen | R.Shestakov. Www.middleware.biz. Erlang 101: an attempt to implement CQRS - Tom's ramblings. The WhatsApp Architecture Facebook Bought For $19 Billion. Rick Reed in an upcoming talk in March titled That's 'Billion' with a 'B': Scaling to the next level at WhatsApp reveals some eye popping WhatsApp stats: What has hundreds of nodes, thousands of cores, hundreds of terabytes of RAM, and hopes to serve the billions of smartphones that will soon be a reality around the globe? The Erlang/FreeBSD-based server infrastructure at WhatsApp.

We've faced many challenges in meeting the ever-growing demand for our messaging services, but as we continue to push the envelope on size (>8000 cores) and speed (>70M Erlang messages per second) of our serving system. But since we don’t have that talk yet, let’s take a look at a talk Rick Reed gave two years ago on WhatsApp: Scaling to Millions of Simultaneous Connections. Having built a high performance messaging bus in C++ while at Yahoo, Rick Reed is not new to the world of high scalability architectures. The founders are also ex-Yahoo guys with not a little experience scaling systems. But enough of this. Synrc/bpe. Spawngrid/kerl. The Erlang shell. The strength of these persistent models come apparent late in the development cycle. Software usually goes through several phases Analysis → Design → Impl. → Test → Deploy → Maintenance It is important to stress that development of software is a dynamic activity.

We repeatedly change the software in production by layering more and more complexity/features on top of the system. We also dynamically fix bugs in the software while it is in production. The recent years, development tends to so-called Agile methods—where there are many small dynamic iterations of the software construction process running all at the same time. The “Maintenance” part is very expensive. When we program, we try to remove errors early. But interestingly, all this only raises the bar for errors.

The class of faults that tend to be interesting is the class that can survive a static type check. Aside: I tend to absolutely love static type systems. End of Aside. Concurrency and Distribution failures The Erlang Shell.

Klarna

Flavors. Joxa. Elixir. Lisp Flavored Erlang.