Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 06 07:14
    Shankar-khati commented #551
  • Sep 06 07:11
    Shankar-khati opened #551
  • Aug 17 17:12
    zydjohnHotmail opened #550
  • Aug 12 14:51
    F0o0De commented #545
  • Aug 09 13:00
    maarteNNNN synchronize #539
  • Aug 09 00:03
    maarteNNNN commented #539
  • Aug 08 23:57
    maarteNNNN synchronize #539
  • Aug 08 23:45
    maarteNNNN synchronize #539
  • Aug 08 19:16
    maarteNNNN synchronize #539
  • Aug 07 15:32
    F0o0De opened #549
  • Aug 07 15:25
    F0o0De opened #548
  • Aug 07 15:24
    F0o0De opened #547
  • Aug 07 15:21
    F0o0De commented #545
  • Aug 07 15:21
    F0o0De commented #545
  • Aug 07 15:21
    F0o0De edited #545
  • Aug 07 15:19
    F0o0De commented #545
  • Aug 07 15:09
    F0o0De opened #546
  • Aug 07 15:03
    F0o0De commented #545
  • Aug 07 15:02
    F0o0De commented #545
  • Aug 07 15:00
    F0o0De commented #545
Bellesoft
@BellesoftConsulting
when the worker gets really busy, I think its loosing the connection to the broker. I will increase the ping timeout and optimize the worker...
Jonathan Gros-Dubois
@jondubois
When your clients connect, are you doing a lot of processing on the server when you handle the connection?
Bellesoft
@BellesoftConsulting
thanks! SC is awesome btw... such a pleasure to work with it

When your clients connect, are you doing a lot of processing on the server when you handle the connection?

yes, that might be the issue

I have a worker thread as well, which I will try to unload to
and I I will try to batch the roster events
Jonathan Gros-Dubois
@jondubois
you should try to minimize database access and avoid heavy queries
Bellesoft
@BellesoftConsulting
each time a user connect, I publish a "user logged in" events, and create roster entries on the DB
etc
all that can be batched
and even offloaded to the worker thread...
I think queueing and batching all that will help
Jonathan Gros-Dubois
@jondubois
SC without any database access or additional processing on connect should be able to handle several tens of thousands or (in some low-activity cases) hundreds of thousands of concurrent connections per process.
Bellesoft
@BellesoftConsulting
cool! I know. the culprit is the mongodb roster... I might move it to an inmemory DB
Jonathan Gros-Dubois
@jondubois
Yes batching can help or using a more lightweight in-memory store can help. If a database is necessary then you should make sure that tables are well indexed.
Also, you should make sure that sockets are not waiting on each other (ensure that each socket connection is handled in parallel in your code).
Bellesoft
@BellesoftConsulting
` for await (let {socket} of agServer.listener('connection')) { RoomSocketHandler.handleConnect(socket) } })();
Jonathan Gros-Dubois
@jondubois
Well since you're not awaiting the RoomSocketHandler.handleConnect(socket) call, it is in parallel so that should not be the issue here. Note that if you did add an await statement at the front of this call, then the connections from different sockets wiuldy queue up and backpressure on the agSever's 'connection' even would build up (which would be bad).
But your code seems right.
Bellesoft
@BellesoftConsulting
thank you very much
Bellesoft
@BellesoftConsulting
@jondubois thanks a lot for you input. I rewrote my distributed roster logic to be in memory vs in mongoldb, and now there are 0 issues ;) sc is blazing fast.
AllOverIO
@ghibble
Hello, does anyone know the max number of concurrent connections that can be achieved on the Kubernetes cluster of socket cluster ?
04116
@04116
hi everyone,

my deployment is:
server 1: worker, scc-broker
server 2: haproxy => scc-state

when I connect scc-broker to scc-state via haproxy, scc-state return that IP address of scc-broker is server 2. So worker can not connect to scc-broker
I've trying to config haproxy to keep client IP but not yet success, does anyone resolved the same problem before?
thank so much,

Suleyman
@makaziev
Hello everyone). I need to create a chat on socket cluster 16. This is my first project on websockets. And I need your help). Share the project on socketcluster, which is more like a chat. Thank you)
Anurag Vohra
@anuragvohraec
Hi Guys I was tryingto deploy my socket cluster app to Google K8 engine = GKE
So when I run socketcluster deploy
in the process it ask me to enter my docker hub id and password
I am not hosting my app in docker hup rather on google artifcate registry
So how do I overwrite this image push to instead write to Google artifact registery and not to docker hub instead
Anurag Vohra
@anuragvohraec

Ok so I have gone with the default docker registry, to speed up development.
However I am facing issue with Ingress controller complaining : "Error:googleapi: Error 400: The SSL key is too large., sslCertificateKeyTooLarge"
I used certificate& private key of my domain, I got from LetsEncrypt.

Do any one has any idea how big should be SSL key and where can I get this SSL keys, if not CA ?

Jonathan Gros-Dubois
@jondubois
@ghibble The bottleneck is the scc-state instance; it should be able to comfortably support up to 2K scc-worker instances but may be as high as 10K instances. The total number of users depends significantly on your workload. With a relatively moderate/light pub/sub workload, each scc-worker can support 10K concurrent clients. So 10K * 2K = 20 million concurrent clients is reasonable. You could separate services into multiple clusters in order to scale further.
But I don' think many projects would ever see 20 million concurrent clients
the 10K figure (per scc-worker) could also be many times higher if the workload is very lightweight
it assumes a message going out to every single user at least every minute or so
but if most connections are kind of indle
then it could be closer to 100K or even 250K per server
May even be possible to reach close to 1M with a lot of optimizations
so it varies a lot
Jonathan Gros-Dubois
@jondubois
@04116 On the scc-broker host, you can tell the scc-broker instance its own IP using the SCC_INSTANCE_IP environment variable; then it will report this IP when connecting to the scc-state server (instead of scc-state trying to detect is automatically)
@04116 an alternative solution (assuming that your haproxy server adds some kind of 'forwarded for' header) is you can tell scc-state what that header is so that it will the value inside that header as the IP. In this case you would need to specify the name of that header as a FORWARDED_FOR_HEADER environment variable on the scc-state host - The value should be the name of the header.
Jonathan Gros-Dubois
@jondubois
@makaziev There have been a few over the years. Most are commercial so you can't see the code. I know that one of our community members is working on an open source one right now though (in progress): https://github.com/johancoppens/simple-chat
@anuragvohraec the socketcluster deployment commands use docker commands behind the scenes so you should be able to set the registry by fiddling with docker CLI settings or environment variables. See https://github.com/SocketCluster/socketcluster/blob/06150056ed688de2ea59ceb2acc6875280dba7f4/bin/cli.js#L600
Jonathan Gros-Dubois
@jondubois
@anuragvohraec I haven't tried to do this before. If it's not possible to set the registry with environment variables, we may have to add an extra argument to the docker login command here https://github.com/SocketCluster/socketcluster/blob/06150056ed688de2ea59ceb2acc6875280dba7f4/bin/cli.js#L585 (feel free to make a pull request).
You may also need to modify your container image names inside the socketcluster-k8s.json config file to include your custom registry ip:port at the start
Jonathan Gros-Dubois
@jondubois
@anuragvohraec About the SSL key, I haven't seen this error before. The SC CLI uses the kubectl create secret tls ${secretName} --key ${privateKeyPath} --cert ${certFilePath}command behind the scenes to add TLS secrets to the K8S cluster. You can try fiddling with that command directly to try to figure out what's wrong.
Oussama Mubarak
@semiaddict
Hi, I'm using SC for the second time, and loving it!
I have a small technical question: how can I use an AGClientSocket listener without assigning the return value to a variable? eslint is throwing the error "'event' is assigned a value but never used" when using the following:
(async () => { for await (const event of socket.listener("connect")) { // Do something without using the event variable } })();
I believe this is more general question for "for..of" and "for await...of" loops, but I can't seem to find the answer any where.
Thanks in advance.
Jonathan Gros-Dubois
@jondubois
@semiaddict it looks like an issue with ESLint. It was raised here eslint/eslint#2342 the issue appears to have been solved for for ... in loops here: eslint/eslint#6126 not sure about for ... of loop (though they were discussed in the issue too). Would ugrading to a newer ESLint version fix this? Or else you can always add an ESLint comment above that line to ignore the rule.
Others also remarked that this rule doesn't make sense for for-in and for-of loops because a variable MUST always be provided so it this rule should not be enforced
Oussama Mubarak
@semiaddict
Thanks @jondubois. I have the latest version of eslint. So I guess I will simply disable it on those lines.