Skip to content

Commit 03afe70

Browse files
committed
Stop ignoring .png files
1 parent ee2c30c commit 03afe70

7 files changed

Lines changed: 90 additions & 5 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ relx
1616
*.html
1717
*.o
1818
*.plt
19-
*.png
2019
*.log
2120
*.swp
2221
erl_crash.dump

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Releases
2121
* Eliminate elysium_session_enqueuer module
2222
* Remove unused elysium_queue:node_change/1
2323
* Add Cassandra node reporting on connection errors
24+
* Move pending requests earlier than connection queue in supervisor
2425

2526
### <a name="0.2.2"></a>0.2.2 Add app.config configuration option
2627

doc/README.md

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,96 @@
11
elysium
22
=======
33

4-
Elysium provides dynamic access to a Cassandra cluster
4+
### Elysium provides dynamic access to a Cassandra cluster
55

66
- Uses round-robin connection semantics
77
- Manages live connections via checkin/checkout
88
- Addresses overload using a pending request queue
99
- Periodically checks for new Cassandra nodes
1010

11+
-------
12+
### Resilience is provided via rest_for_one supervision
13+
14+
- ETS data management: elysium_buffer_sup
15+
- Application status/control: elysium_queue
16+
- Load balancing: elysium_lb_queue
17+
- Cassandra node discovery: elysium_peer_handler
18+
- Connection queues: serial queue of connections and requests
19+
- Connection management: elysium_connection_sup
20+
21+
-------
22+
### Supervision Tree
23+
24+
![Elysium Top-Level Supervision Tree](supervision_tree.png)
25+
26+
-------
27+
### Queues are more persistent than connections
28+
29+
- Loss of all connections does not affect queues
30+
- unless elysium_sup itself is taken out
31+
- ets tables, status/control are last to die
32+
- ensures monitoring works when things are down
33+
- activate/deactivate adds/destroys connections
34+
- currently too abrupt
35+
- in future will nicely drain in flight queries
36+
- load balancing survives when requests/connection queues down
37+
- cluster node discovery runs even if connections gone
38+
- activate creates new connections using round-robin
39+
40+
-------
41+
### Basic operation is a checkin/checkout
42+
43+
- Load balancing via a ring buffer
44+
- checkin/checkout Cassandra {Host, Port}
45+
- connections are round-robin
46+
- slow to respond nodes are skipped
47+
- ring buffer updated by elysium_peer_handler
48+
- Connections are in a checkin/checkout queue
49+
- implemented as a behaviour
50+
- currently relies on elysium_serial_queue
51+
- elysium_parallel_queue trips on concurrency issues
52+
- Requests checkout a connection and then check it back in
53+
- if none available, request is put in pending queue
54+
- connection is long-lived seestar Cassandra socket gen_server
55+
- Also supports a one-shot request
56+
- spawns a new seestar connection
57+
- discards the connection after the request completes
58+
59+
-------
60+
### Stochastic Connection Migration
61+
62+
- Connections decay periodically
63+
- randomly in N chances per 1 Billion requests
64+
- decayed connections are immediately replaced
65+
- the new connection is placed at the end of the queue
66+
- unless it is used immediately on a pending request
67+
- Reconnect avoids congestion
68+
- round-robin skips slow to respond nodes
69+
- redistributes all connections over time
70+
- restarts seestar sessions to avoid memory/staleness issues
71+
72+
-------
73+
### Data Flow Logic
74+
75+
![Elysium Data Flow](data_flow.png)
76+
77+
-------
78+
### Three Methods of Configuration
79+
80+
- {config_mod, Module}
81+
- defines a functional interface for all config values
82+
- allows adaptive functionally changing parameters
83+
- {vbisect, Binary}
84+
- uses a binary dictionary for all config values
85+
- shared, lock-free, read-only configuration
86+
- any changes have to be distributed to running processes
87+
- {config_app_config, elysium}
88+
- refers to a top-level config block in the app.config file
89+
- has to be the name of a loaded application
90+
- simplest is to use elysium as an included_application
91+
- Performance is not equal
92+
- config_mod is 50% slower
93+
- vbisect and app.config seem to have similar performance
94+
- not measured with 16-core or more servers
95+
1196

doc/supervision_tree.dot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ graph ""
1212
n3 [ label="<l2> elysium_queue\n(gen_fsm elysium status)" ];
1313
n4 [ label="<l2> elysium_lb_queue\n(gen_server round-robin C*)" ];
1414
n5 [ label="<l2> elysium_peer_handler\n(node discovery)" ];
15-
n6 [ label="<l2> elysium_serial_queue\n(idle C* sessions)" ];
16-
n7 [ label="<l2> elysium_serial_queue\n(pending C* requests)" ];
15+
n6 [ label="<l2> elysium_serial_queue\n(pending C* requests)" ];
16+
n7 [ label="<l2> elysium_serial_queue\n(idle C* sessions)" ];
1717
n8 [ label="<l2> elysium_connection_sup\n(simple_one_for_one)" ];
1818
}
1919

doc/supervision_tree.pdf

1 Byte
Binary file not shown.

doc/supervision_tree.png

-369 Bytes
Loading

src/elysium_sup.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ init({Config}) ->
8282
[Buffer_Sup, Queue_Proc, % Ets owner and status reporter
8383
Serial_LB_Queue, % Queue for peer nodes
8484
Discovery_Proc, % Detects peer nodes and refreshes the buffers
85-
Serial_Session_Queue, Serial_Pending_Queue, % Queue gen_servers for serial option
85+
Serial_Pending_Queue, Serial_Session_Queue, % Queue gen_servers for serial option
8686
Conn_Sup]}}. % Connection worker supervisor

0 commit comments

Comments
 (0)