Skip to content

Commit

Permalink
Fragmentation support and Network performance improvements (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
halturin authored Apr 22, 2020
1 parent 830a617 commit be991fa
Show file tree
Hide file tree
Showing 29 changed files with 5,917 additions and 3,602 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ coverage.html
*.swp
tags
.session

cover.out

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ epmd:
test:
go vet
go clean -testcache
go test ./...
go test -v ./...

cover:
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out -o coverage.html
rm cover.out

bench:
go test -bench=Node -run=X -benchmem

71 changes: 57 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![codecov](https://codecov.io/gh/halturin/ergo/graph/badge.svg)](https://codecov.io/gh/halturin/ergo)
[![Build Status](https://travis-ci.org/halturin/ergo.svg)](https://travis-ci.org/halturin/ergo)

Implementation of Erlang/OTP in Golang
Implementation of Erlang/OTP in Golang. Up to x5 times faster than original Erlang/OTP. The easiest drop-in replacement for your hot nodes in the cluster.

### Purpose ###

Expand Down Expand Up @@ -35,11 +35,61 @@ The goal of this project is to leverage Erlang/OTP experience with Golang perfor
* RPC callbacks support
* Experimental [observer support](#observer)
* Unmarshalling terms into the struct using etf.TermIntoStruct
* Support Erlang 21.*
* Support Erlang 22. (with [fragmentation](http://blog.erlang.org/OTP-22-Highlights/))

### Requirements ###

* Go 1.10 and above
* Highly recommend using 1.14.2 and above since it has significant performance improvements

### Benchmarks ###

Here is simple EndToEnd test demonstrates performance of messaging subsystem

Hardware: laptop with Intel(R) Core(TM) i5-8265U (4 cores. 8 with HT)

#### Sequential GenServer.Call using two processes running on single and two nodes

```
❯❯❯❯ go test -bench=NodeSequential -run=XXX -benchtime=10s
goos: linux
goarch: amd64
pkg: github.com/halturin/ergo
BenchmarkNodeSequential/number-8 256108 48578 ns/op
BenchmarkNodeSequential/string-8 266906 51531 ns/op
BenchmarkNodeSequential/tuple_(PID)-8 233700 58192 ns/op
BenchmarkNodeSequential/binary_1MB-8 5617 2092495 ns/op
BenchmarkNodeSequentialSingleNode/number-8 2527580 4857 ns/op
BenchmarkNodeSequentialSingleNode/string-8 2519410 4760 ns/op
BenchmarkNodeSequentialSingleNode/tuple_(PID)-8 2524701 4757 ns/op
BenchmarkNodeSequentialSingleNode/binary_1MB-8 2521370 4758 ns/op
PASS
ok github.com/halturin/ergo 120.720s
```

it means Ergo Framework provides around 25000 sync rps via localhost for simple data and around 4Gbit/sec for 1MB messages

#### Parallel GenServer.Call using 120 pairs of processes running on a single and two nodes

```
❯❯❯❯ go test -bench=NodeParallel -run=XXX -benchtime=10s
goos: linux
goarch: amd64
pkg: github.com/halturin/ergo
BenchmarkNodeParallel-8 2652494 5246 ns/op
BenchmarkNodeParallelSingleNode-8 6100352 2226 ns/op
PASS
ok github.com/halturin/ergo 34.145s
```

these numbers shows around 260000 sync rps via localhost using simple data for messaging

#### vs original Erlang/OTP

![benchmarks](https://raw.githubusercontent.com/halturin/ergobenchmarks/master/ergobenchmark.png)

sources of these benchmarks are [here](https://github.com/halturin/ergobenchmarks)


### EPMD ###

Expand All @@ -66,19 +116,12 @@ As an extra option, we provide EPMD service as a standalone application. There i

Here are the changes of latest release. For more details see the [ChangeLog](ChangeLog)

#### [1.0.0](https://github.com/halturin/ergo/releases/tag/1.0.0) - 2020-03-03 ####
#### [1.1.0](https://github.com/halturin/ergo/releases/tag/1.1.0) - 2020-04-23 ####

There is a bunch of changes we deliver with this release
* Fragmentation support (which was introduced in Erlang/OTP 22)
* Completely rewritten network subsystem (DIST/ETF).
* Improved performance in terms of network messaging (outperforms original Erlang/OTP up to x5 times. See [Benchmarks](#benchmarks))

* We have changed the name - Ergo (or Ergo Framework). GitHub's repo has been renamed as well. We also have created cloned repo `ergonode` to support users of the old version of this project. So, its still available at [https://github.com/halturin/ergonode](https://github.com/halturin/ergonode). But it's strongly recommend to use the new one.
* Completely reworked (almost from scratch) architecture whole project
* Implemented linking process feature (in order to support Application/Supervisor behaviors)
* Reworked Monitor-feature. Now it has full-featured support with remote process/nodes
* Added multinode support
* Added experimental observer support
* Fixed incorrect ETF string encoding (it was encoded as binary instead of string)
* Improved ETF TermIntoStruct decoder
* Improved code structure and readability

### Examples ###

Expand Down Expand Up @@ -217,7 +260,7 @@ There is a couple of options are already defined that you might want to use
* -trace.node
* -trace.dist

To enable Golang profiler just add `--tag debug` in your `go run` or `go build` like this:
To enable Golang profiler just add `--tags debug` in your `go run` or `go build` like this:

`go run --tags debug ./examples/genserver/demoGenServer.go`

Expand Down
1 change: 1 addition & 0 deletions application.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (a *Application) loop(p *Process, object interface{}, args ...interface{})
}
}
func (a *Application) stopChildren(from etf.Pid, children []ApplicationChildSpec, reason string) {

for i := range children {
child := children[i].process
if child != nil && child.self != from {
Expand Down
Loading

0 comments on commit be991fa

Please sign in to comment.