add scaling documentation

This commit is contained in:
Joris Vink 2013-10-14 15:03:58 +02:00
parent 9426906225
commit b75ac15e50
1 changed files with 52 additions and 0 deletions

52
docs/scaling Normal file
View File

@ -0,0 +1,52 @@
Scaling in Kore:
- Badass mode
- Minion mode
Badass mode:
- Receives connections from browsers
- Selects available remote minion worker
- Ties connection to worker and acts as a proxy in between
- Persistent connections between minion worker processes
- Pushes module and configuration changes to minions
Starting Kore in badass mode, badass workers get <port>+<worker nr>:
# ./kore -b 127.0.0.1:3350 -c /etc/kore.conf
Minion mode:
- ZERO configuration, minions get all required stuff from badass
- Each worker connects to the main badass port announcing itself
- Receives module
- Receives page handlers
- Receives ports for all badass workers
- Connects to each worker, announcing itself
- Receives all HTTP requests, parses and handles them
- Responses go back to badass
- kore_log() and access_log() go to badass (one log location)
In badass mode, minions no longer need:
- any configuration options.
- CPU detection should happen via CLI or automatic
Start a Kore process as a minion (and fetch everything from badass
running on 127.0.0.1).
# ./kore -m 127.0.0.1:3350 (-c 8 cpu count)
Protocol between badass/minions:
- Must be stream based (multiple different requests per single conn)
- Badass assigns unique streamID per new external connection
- The streamID is sent before each packet
- Type is added as well:
- 1 HTTP
- 2 SPDY
- 3 LOG
- 4 ALOG
- 5 MODUPDATE
- 6 CONFIG
- 7 PING
- 8 FIN
- Badass probably wants to buffer packets before sending them
to the minion
- Responses coming from minions are terminated by sending FIN.
(at which point badass will start responding to client)