socketCluster-server with SCC | redis and streams | connections
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js, redis
- Ambito
- backend, distributed-systems, networking
Direzione di ricerca
Inizia da scc-guide.md e dall’entry point socketcluster-server, quindi traccia come sono collegati sc-state, sc-broker, scc-server e sc-redis. L’issue non fornisce test nominati né criteri di accettazione concreti; il lavoro sarebbe completato risolvendo le questioni di progettazione relative alla rete, a Redis Streams adapter e alla gestione delle connessioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello,
I would like to implement what is describe in the SCC guide, from what I understand from the guide, if I use the socketcluster-server I should be able to scale automatically vertically and horizontally.
Could you please tell me what are the network requirement between the sc-state, sc-broker and the scc-server ? Does 80/443 is enough or the sc-state use additional ports ?
In my backend I use redis stream to pub/sub streams to specific channels/rooms using GROUP and XREADGROUP + rxJs, can I use the sc-redis as a base to create the necessary adapter ?
Last thing is more about the logic/management or how to deal with connections like RabbitMQ, ... As per the following doc of RabbitMq I'm not quite sure to understand how to apply what follow below with socketCluster...
As SCC will scale horizontally across the CPUs of my instance, should I create my connections on the master(server.js) and share it across all the brokers/workers and open channels from there ?
Don’t open and close connections or channels repeatedly
Have long lived connections if possible, and use channels for each task. The handshake process for an AMQP connection is quite complex and requires at least 7 TCP packets (more if TLS is used). Channels can be opened and closed more frequently if needed. Even channels should be long-lived if possible, e.g., reuse the same channel per thread for publishing. Don’t open a channel each time you are publishing. If you can't have long lived connections, then make sure to gracefully close the connection Best practice is to reuse connections and multiplex a connection between threads with channels.AMQP connections: 7 TCP packages
AMQP channel: 2 TCP packages
AMQP publish: 1 TCP package (more for larger messages)
AMQP close channel: 2 TCP packages
AMQP close connection: 2 TCP packages
Total 14-19 packages (+ Acks)
and (most important)
Don’t share channels between threads
You should make sure that you don’t share channels between threads as most clients don’t make channels thread-safe (because it would have a serious negative impact on performance).
The concept of cluster using nodeJs is quite new for me and due to some restriction we can not use the framework version of socketCluster. Looking forward to read to answers.
Thanks by advance.
fas3r
- Lingua principale
- JavaScript
- Stelle
- 109
- Fork
- 49
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SocketCluster/socketcluster-server
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
-
socket.kickOut fails Aperta
SocketCluster/socketcluster-server#49 · 3 commenti · 1 assegnatario ·
-
Pong Timeout Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
SocketCluster/socketcluster-server#41 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
SocketCluster/socketcluster-server#37 · 3 commenti · 1 reazione ·
Tutte le issue di SocketCluster/socketcluster-server
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
matrix-org/matrix.org#3649 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vadimdemedes/ink#1029 ·