syndicate-rs/README.md

91 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

2021-05-12 13:36:18 +00:00
# Syndicate/rs
A Rust implementation of:
2021-09-02 13:28:27 +00:00
- the Syndicated Actor model, including assertion-based
communication, failure-handling, capability-style security,
dataspace entities, and facets as a structuring principle;
2021-08-11 20:22:53 +00:00
2021-05-12 13:36:18 +00:00
- the Syndicate network protocol, including
2021-08-11 20:22:53 +00:00
- a high-speed Dataspace indexing structure
2021-08-13 01:40:48 +00:00
([`skeleton.rs`](syndicate/src/skeleton.rs); see also
2021-08-11 20:22:53 +00:00
[HOWITWORKS.md](https://git.syndicate-lang.org/syndicate-lang/syndicate-rkt/src/commit/90c4c60699069b496491b81ee63b5a45ffd638cb/syndicate/HOWITWORKS.md)
from `syndicate-rkt`) and
- a standalone Syndicate protocol "broker" service (roughly
comparable in scope and intent to D-Bus); and
2021-08-13 01:40:48 +00:00
- a handful of [example programs](syndicate-server/examples/).
2021-05-12 13:36:18 +00:00
![The Syndicate/rs server running.](syndicate-rs-server.png)
*The Syndicate/rs server running.*
## Quickstart
2023-09-29 11:55:44 +00:00
From docker or podman:
docker run -it --rm leastfixedpoint/syndicate-server /syndicate-server -p 8001
Build and run from source:
2021-05-12 13:36:18 +00:00
git clone https://git.syndicate-lang.org/syndicate-lang/syndicate-rs
cd syndicate-rs
cargo build --release
2021-09-02 13:28:27 +00:00
./target/release/syndicate-server -p 8001
2021-05-12 13:36:18 +00:00
2023-10-04 19:48:14 +00:00
If you have [`mold`](https://github.com/rui314/mold) available (`apt install mold`), you may be
able to get faster linking by creating `.cargo/config.toml` as follows:
2023-10-04 19:48:14 +00:00
[build]
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
Enabling the `jemalloc` feature can get a *substantial* (~20%-50%) improvement in throughput.
2021-05-12 13:36:18 +00:00
## Running the examples
2023-11-15 20:06:19 +00:00
In one window, start the server with a basic configuration:
2021-05-12 13:36:18 +00:00
2023-11-15 20:06:19 +00:00
./target/release/syndicate-server -c dev-scripts/benchmark-config.pr
2021-05-12 13:36:18 +00:00
Then, choose one of the examples below.
### Producer/Consumer (sending messages)
In a second window, run a "consumer" process:
./target/release/examples/consumer
Finally, in a third window, run a "producer" process:
./target/release/examples/producer
### State producer/consumer (state replication)
Replace `producer` with `state-producer` and `consumer` with
`state-consumer`, respectively, in the instructions of the previous
subsection to demonstrate Syndicate *state replication*.
### Pingpong example (latency)
In a second window, run
./target/release/examples/pingpong pong
and in a third window, run
./target/release/examples/pingpong ping
The order is important - the difference between `ping` and `pong` is
about who kicks off the pingpong session.
### Performance note
You may find better performance by restricting the server to fewer
cores than you have available. For example, for me, running
2023-11-15 20:06:19 +00:00
taskset -c 0,1 ./target/release/syndicate-server -c dev-scripts/benchmark-config.pr
2021-05-12 13:36:18 +00:00
2023-11-15 20:06:19 +00:00
roughly *doubles* throughput for a single producer/consumer pair,
2021-05-12 13:36:18 +00:00
on my 48-core AMD CPU.