Giter Site home page Giter Site logo

Comments (6)

MerzMax avatar MerzMax commented on July 18, 2024

image

from scale-chat.

MerzMax avatar MerzMax commented on July 18, 2024

https://pkg.go.dev/github.com/gorilla/websocket#hdr-Buffers

from scale-chat.

MerzMax avatar MerzMax commented on July 18, 2024
  • Limit the buffer sizes to the maximum expected message size. Buffers larger than the largest message do not provide any benefit.
  • compression is experimental

from scale-chat.

MerzMax avatar MerzMax commented on July 18, 2024

Screenshot 2021-11-25 at 08 36 46

from scale-chat.

martbock avatar martbock commented on July 18, 2024

In my opinion, it would make sense to compare memory usage with and without the buffer. I would guess that it makes sense to create a medium-sized buffer of about 64 or 128 bytes if we want the chat server to be inspired by real chat messages. Most chat messages in my life are rather short, while few may be long texts.

Depending on the distribution of message sizes, setting the buffer size to a value less than the maximum expected message size can greatly reduce memory use with a small impact on performance. Here's an example: If 99% of the messages are smaller than 256 bytes and the maximum message size is 512 bytes, then a buffer size of 256 bytes will result in 1.01 more system calls than a buffer size of 512 bytes. The memory savings is 50%.
-- https://pkg.go.dev/github.com/gorilla/websocket#hdr-Buffers

from scale-chat.

MerzMax avatar MerzMax commented on July 18, 2024

That's right :) Since we want to test with several message sizes, this config might have a direct input on the services performance. In our case all messages will be the same size as well (in the scpe of one load test). I would suggest testing everything with 128 bytes. In the scope of the first load test we could test everything with a different buffersize as well, to "get a feeling" of the parameters impact.

from scale-chat.

Related Issues (20)

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.