Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 30 05:55
    pentestusa commented #524
  • Sep 01 10:47
    JojoStacy commented #429
  • Aug 14 17:36
    SeedyROM closed #535
  • Aug 10 16:14
    SeedyROM commented #535
  • Aug 07 21:02
    SeedyROM commented #535
  • Aug 07 13:31
    jondubois commented #535
  • Aug 07 13:30
    jondubois commented #535
  • Aug 07 13:30
    jondubois commented #535
  • Aug 07 13:29
    jondubois commented #535
  • Aug 06 18:16
    SeedyROM opened #535
  • Jul 20 13:43

    dependabot[bot] on npm_and_yarn

    (compare)

  • Jul 20 13:43
    dependabot[bot] closed #533
  • Jul 20 13:42
    dependabot[bot] edited #533
  • Jul 20 13:42
    dependabot[bot] commented #533
  • Jul 20 13:42
    dependabot[bot] edited #533
  • Jul 20 13:42

    jondubois on master

    Bump package-lock (compare)

  • Jul 20 13:29

    jondubois on old

    Updated dependencies Merge pull request #532 from di… (compare)

  • Jul 20 13:29
    jondubois closed #532
  • Jul 19 14:07
    arya-man opened #534
  • Jul 19 08:46
    dependabot[bot] labeled #533
Eric Guan
@guanzo
if someone tries to connect to ws://example.com/socketcluster, i want to redirect them to wss://example.com/socketcluster
similar to the http -> https redirect
Kevin Boon
@inQonsole
good question, idk if you can redirect websockets
but i don't recommend that setup even if you could make it work
you're better off using a reverse proxy
i have never tried websocket redirection so i got no clue if it's even supported
if you redirect http to https and you reverse proxy on https that should work without any issues.
Kevin Boon
@inQonsole
and you run socketcluster over ws of course not wss
Yamuna99
@Yamuna99
Hey
how can I set the different key name of socketcluster.authToken in local storage. and which also should also pass to WS calls on any subscribe or publish actions
zmikolaj
@zmikolaj
where i can get worker id
zmikolaj
@zmikolaj
any way to send to specific channel outside of socketcluster?
Kevin Boon
@inQonsole
@Yamuna99 authTokenName, in create([options])
@zmikolaj Workers don't exist anymore, but in v14 it was Worker.id
not sure what you mean with sending to specific channel outside of socketcluster, have to explain more what you are trying to do
Eric Guan
@guanzo
any idea how many connections a single worker can handle? i'm seeing around 15-20k connections per worker before errors start blowing up. that's a very rough estimate
Kevin Boon
@inQonsole
@guanzo no, there is no set limit, it also depends on what your server is doing per connection, how optimized your code is, that is something you have to find out by monitoring your server during active times, see where the limit is then use 90% of that maybe even 80% during production and that's the limit your server has, then you scale by starting up more servers.
and then of course, your OS has a limit, your IP has a limit, node js has a limit everything has limits,
Eric Guan
@guanzo
yeah this is why i hate scaling, so many things to check
meanwhile servers are on fire and users are complaining
Kevin Boon
@inQonsole
hahahahhaa, love it!
thats the joy of programming
serving a server to 10 people is easy, serving the masses is when you get into complicated things, with scaling on multiple machines etc.. clusterss
George2023
@George2023
hello Guys
I have an important question possible to make such as level of telegram by Socket cluster ? and same making channels such as 2 million people in one channels ? Really Socket cluster have such as this level ?
George2023
@George2023
Hello any one can answer
Kevin Boon
@inQonsole
@George2023 Short Answer: Yes, there is no limit on how many people can subscribe to a single channel, the limitations you are going to run into, is the x amount of messages send per second.
a simple google search would have given you this answer, https://hackernoon.com/socketcluster-scalability-considerations-1b3355ab2fd8
George2023
@George2023

@George2023 Short Answer: Yes, there is no limit on how many people can subscribe to a single channel, the limitations you are going to run into, is the x amount of messages send per second.

Appreciate for your answer very usefull.Please let me know do you know any place they are working on chat environment

Kevin Boon
@inQonsole
@George2023 what do you mean with ''place they are working on chat environment" ?
George2023
@George2023
Hi Kevin
Pls giv me the indian skype
Eric Guan
@guanzo
as i understand it, pubsub channels are sharded across brokers. The vast majority of my traffic are publishes to 1 channel. does that mean that only 1 broker is going to take all that load?
Kevin Boon
@inQonsole
all the pub/sub channels in your system will be shared evenly across the available scc-broker instances.
Eric Guan
@guanzo
hmm okay. i have 4 brokers and one of them is using double the CPU and 4x the memory. trying to understand why
Kevin Boon
@inQonsole
mmm, that is strange.
are the other 3 brokers active in the scc-state ?
Eric Guan
@guanzo
yah quite sure. if they weren't active i'd expect their cpu/memory usage to be idle
otherwise socketcluster is working beautifully for me, ~250k stable connections in prod, i had to spin up 20 scc-workers. 20 is a bit more than necessary until i figure out how to autoscale based on # connections
Kevin Boon
@inQonsole
you can get very high results with scc on a single server.
1+ million active connections on scc, is not hard to achieve
not a single scc-worker/scc-server instance, ppl get confused about that, 1 hardware server, you can accomplish a lot of active connections, with something like kubernetes or openshift etc..
Jonathan Gros-Dubois
@jondubois
@guanzo If you have a single channel, it will scale to support an unlimited number of subscribers (just add more brokers as needed). However, if you want to publish an unlimited number of messages, you may need to add additional channels. A good strategy to get even load across all brokers is to add a number at the end of the channel name (like a shard number) E.g. mychannel1, mychannel2, mychannel3; you will need to subscribe to each channel 'shard' explicitly on the client side.
But a single channel will be assigned to a single broker process
In any case if you have a single channel and you're doing a huge number of publishes to it (more than a single broker process can handle), you may want to rethink your strategy and find a more efficient way to split up the channel into multiple smaller channels
For large number of publishes, SC works best if you spread out messages between many small channels (the more different channels you have, the more evenly the load will be spread between available brokers).
Jonathan Gros-Dubois
@jondubois
It doesn't make sense from the subscriber client side if you have a single huge channel receiving 20K messages per second (for example); most front ends cannot display messages that fast anyway. It's important to design your system to avoid these huge channels; try to design your channels in a frontend-centered way.
Eric Guan
@guanzo
so my setup is an arbitrary amount of frontend clients all publishing to a single channel that a backend client subscribes to. no frontend clients are subscribing so that situation you just described doesn't happen to me.
based on what you said, i guess the quick fix is to split the single channel into several, and have clients pick 1 to publish to
that should spread load across brokers more evenly
i'm using socketcluster as an central router (i'm replacing crossbar.io), so frontend clients can publish messages to the backend client via socketcluster. basically RPC over pubsub
and these backend clients are separate services that subscribe to socketcluster. my socketcluster app itself has very little app-specific code