-
Notifications
You must be signed in to change notification settings - Fork 728
Add BufferChannel for fsm incoming/outgoing channels. #2869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
cc #2862 |
@fujita could you please take a look at it? |
I don't think it's a good idea for GoBGP's most core code to have two different implementations. |
btw, what kind of use case do you have that puts such a heavy load on GoBGP? |
A regular channel with a limited size will not work, as it can still be reached, which may lead to disconnection with peer. BufferChannel can combine multiple updates into one, discarding outdated path's attributes. The most effectiveness of this channel is shown when there is a storm of attribute updates for one path from peer. |
Сonfiguration example:
or
|
Paths are being cyclically updated from peers due to attribute updates. And main thread |
@fujita gentle ping |
1 similar comment
@fujita gentle ping |
Why just not removing incoming queues? |
|
But with this PR - сan add another type of fsm incoming/outgoing channels, which will disable queues. |
I meant that why not removing incoming channels? |
I understand you :) And my answer: if we remove incoming channels, we will get possible problems: peers flap and OOM on remote gobgp server. |
Hmm, why? goroutine, reads from a socket, parses a BGP message, and updates the table with a lock and PrefixLimit config. I don't see the difference about OOM. |
Hey! |
Added the ability to select a type of fsm incoming/outgoing channels: 1. InfiniteChannel (old behavior, default) 2. BufferChannel BufferChannel allows to accumulate and combine paths in a separate thread, in the case when the reading side (for example, BgpServer.Serve) is busy. A map with NLRI key is also used to combine multiple changes of one path into a single update.
Nice graphs! Really clear and informative. Is there a way to reproduce a similar load in my environment (like MRT or something)? |
Added the ability to select a type of fsm incoming/outgoing channels:
BufferChannel allows to accumulate and combine paths in a separate thread, in the case when the reading side (for example, BgpServer.Serve) is busy.
A map with NLRI key (bufferChannel.pathIdxs) is also used to combine multiple changes of one path into a single update.
BufferChannel prevents infinite memory consumption because its maximum size is comparable to the size of the adj-in (or adj-out for the fsm outgoing channel).