Coder Social home page Coder Social logo

Server load issue about ghchat HOT 8 CLOSED

aermin avatar aermin commented on May 18, 2024
Server load issue

from ghchat.

Comments (8)

aermin avatar aermin commented on May 18, 2024

Could you pls test this method?

Socket.io would use used long polling first for compatibility which some platforms couldn't support WebSocket.

image

https://stackoverflow.com/questions/15872788/maximum-concurrent-socket-io-connections

from ghchat.

ssdbkey avatar ssdbkey commented on May 18, 2024

I already tried it but it doesn't work. Is it related with data amount which is transferred by socket?

from ghchat.

aermin avatar aermin commented on May 18, 2024

@sarawut11 when happening this issue, could server-side receive the socket emit from client-side? Such as

 socket.on('sendPrivateMsg', async (data, cbFn) => {
 // here could server-side receive the socket emit from client-side at that time?
  ......
}

Check the server status find is it too busy to handle incoming socket events at that time. If it is, could use some method to do server optimization, such as load balancing, cache technology to prevent operating database immediately, and so on. I am so sorry I have no experience on server optimization.

from ghchat.

aermin avatar aermin commented on May 18, 2024

Hi @sarawut11 , are there any updates?

from ghchat.

ssdbkey avatar ssdbkey commented on May 18, 2024

@aermin I splitted the server into two servers - one for main node server, another one for socket only server.
And run 1 main node server and 5 socket servers, in a word, applying load balancer in nginx.
Let me see how it goes and let you know.
Note sure if this can be a solution tho but I believe it can improve something at least.

from ghchat.

aermin avatar aermin commented on May 18, 2024

@aermin I splitted the server into two servers - one for main node server, another one for socket only server.
And run 1 main node server and 5 socket servers, in a word, applying load balancer in nginx.
Let me see how it goes and let you know.
Note sure if this can be a solution tho but I believe it can improve something at least.

Thanks let me know. I hope this project could really help you. Welcome to discuss with me about some performance optimization at least on the code level if you need.

from ghchat.

ssdbkey avatar ssdbkey commented on May 18, 2024

I could resolve the issue @aermin by refactoring the code architecture.
Thank you.
Anyway, I think, it's worth to discuss with you via live chat.
Can you provide me your contact info?(skype or telegram or discord id?)
You can email me [email protected]

from ghchat.

aermin avatar aermin commented on May 18, 2024

@sarawut11 you are very cool ! !

I create a telegram group and will invite other people who have server-side optimization experience, who got this issue, or who are interesting in it.

telegram group link: https://t.me/joinchat/Kabe8hReKws36vfLhHsY6Q

Look forward to taking some discussion with you.

from ghchat.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.