Giter Site home page Giter Site logo

Max Message Size = 16mb about aeron HOT 7 CLOSED

kinghchan avatar kinghchan commented on June 11, 2024
Max Message Size = 16mb

from aeron.

Comments (7)

JPWatson avatar JPWatson commented on June 11, 2024

As it says in the Javadoc, it is a pragmatic length to encourage better design.
Large messages are a design smell. It is better to break them into chunks for transmission.

from aeron.

kinghchan avatar kinghchan commented on June 11, 2024

Hi @JPWatson, thanks for getting back to me.

I do understand that smaller messages are more 'pragmatic', but I was hoping for more clarification on exactly why on a hardware/OS level that using large messages is not pragmatic. My guess is because a large message would end up evicting other cached items.

For example, our L3 cache size is 64mb - does that mean we can safely increase the max message size to 32mb instead of 16mb (the current limit)?

Thanks again for your time!

from aeron.

JPWatson avatar JPWatson commented on June 11, 2024

Larger messages are more likely to increase the number of cache misses. You'll also have the cost of doing fragment assembly on the receiver size which involves additional copies. There is a bigger picture to consider. For instance, what are you optimising for? how would you build up the 32MB message to send in the first place?

from aeron.

kinghchan avatar kinghchan commented on June 11, 2024

Yes, I understand the cost of assembly.

The reason we have to consider large messages is because our source of data (from a grpc API) contains huge messages as large 60mb. The data would end up being built up in our application memory. This isn't something we can avoid, which is why we have to consider increasing the max message length of Aeron.

Yes, we can manually divide the messages into sub-messages in order to bypass Aeron's max message length when we receive the grpc message, but downstream we still have to manually join the sub-messages up. Our logic now has to consider both joining our sub-messages up as well as Aeron's own fragment assembler.

Hence my question as to whether it is safe to increase Aeron's max message length, and what the potential implications are.

Thanks again for your time.

from aeron.

mjpt777 avatar mjpt777 commented on June 11, 2024

If single messages get larger than what can practically fit in CPU cache along with other relevant data and code then performance can significantly degrade therefore we actively discourage designs that use large messages.

from aeron.

plokhotnyuk avatar plokhotnyuk commented on June 11, 2024

@mjpt777 do you mean the last level cache or per core one?

from aeron.

mjpt777 avatar mjpt777 commented on June 11, 2024

@mjpt777 do you mean the last level cache or per core one?

LLC is the general idea for the limit. However things are best when significantly less than per core caches.

from aeron.

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.