#Load balancer
Explore tagged Tumblr posts
haroldfinch07 · 9 months ago
Text
Load Balancing Web Sockets with K8s/Istio
When load balancing WebSockets in a Kubernetes (K8s) environment with Istio, there are several considerations to ensure persistent, low-latency connections. WebSockets require special handling because they are long-lived, bidirectional connections, which are different from standard HTTP request-response communication. Here’s a guide to implementing load balancing for WebSockets using Istio.
1. Enable WebSocket Support in Istio
By default, Istio supports WebSocket connections, but certain configurations may need tweaking. You should ensure that:
Destination rules and VirtualServices are configured appropriately to allow WebSocket traffic.
Example VirtualService Configuration.
Tumblr media
Here, websocketUpgrade: true explicitly allows WebSocket traffic and ensures that Istio won’t downgrade the WebSocket connection to HTTP.
2. Session Affinity (Sticky Sessions)
In WebSocket applications, sticky sessions or session affinity is often necessary to keep long-running WebSocket connections tied to the same backend pod. Without session affinity, WebSocket connections can be terminated if the load balancer routes the traffic to a different pod.
Implementing Session Affinity in Istio.
Session affinity is typically achieved by setting the sessionAffinity field to ClientIP at the Kubernetes service level.
Tumblr media
In Istio, you might also control affinity using headers. For example, Istio can route traffic based on headers by configuring a VirtualService to ensure connections stay on the same backend.
3. Load Balancing Strategy
Since WebSocket connections are long-lived, round-robin or random load balancing strategies can lead to unbalanced workloads across pods. To address this, you may consider using least connection or consistent hashing algorithms to ensure that existing connections are efficiently distributed.
Load Balancer Configuration in Istio.
Istio allows you to specify different load balancing strategies in the DestinationRule for your services. For WebSockets, the LEAST_CONN strategy may be more appropriate.
Tumblr media
Alternatively, you could use consistent hashing for a more sticky routing based on connection properties like the user session ID.
Tumblr media
This configuration ensures that connections with the same session ID go to the same pod.
4. Scaling Considerations
WebSocket applications can handle a large number of concurrent connections, so you’ll need to ensure that your Kubernetes cluster can scale appropriately.
Horizontal Pod Autoscaler (HPA): Use an HPA to automatically scale your pods based on metrics like CPU, memory, or custom metrics such as open WebSocket connections.
Istio Autoscaler: You may also scale Istio itself to handle the increased load on the control plane as WebSocket connections increase.
5. Connection Timeouts and Keep-Alive
Ensure that both your WebSocket clients and the Istio proxy (Envoy) are configured for long-lived connections. Some settings that need attention:
Timeouts: In VirtualService, make sure there are no aggressive timeout settings that would prematurely close WebSocket connections.
Tumblr media
Keep-Alive Settings: You can also adjust the keep-alive settings at the Envoy level if necessary. Envoy, the proxy used by Istio, supports long-lived WebSocket connections out-of-the-box, but custom keep-alive policies can be configured.
6. Ingress Gateway Configuration
If you're using an Istio Ingress Gateway, ensure that it is configured to handle WebSocket traffic. The gateway should allow for WebSocket connections on the relevant port.
Tumblr media
This configuration ensures that the Ingress Gateway can handle WebSocket upgrades and correctly route them to the backend service.
Summary of Key Steps
Enable WebSocket support in Istio’s VirtualService.
Use session affinity to tie WebSocket connections to the same backend pod.
Choose an appropriate load balancing strategy, such as least connection or consistent hashing.
Set timeouts and keep-alive policies to ensure long-lived WebSocket connections.
Configure the Ingress Gateway to handle WebSocket traffic.
By properly configuring Istio, Kubernetes, and your WebSocket service, you can efficiently load balance WebSocket connections in a microservices architecture.
5 notes · View notes
enlume · 1 year ago
Text
0 notes
redactedconcepts · 1 year ago
Text
Load Balancer
Ever wonder how Facebook, Linkedin, Twitter and other web giants are handling such huge amounts of traffic? They don’t have just one server, but tens of thousands of them. In order to achieve this, web traffic needs to be distributed to these servers, and that is the role of a load-balancer.
Tumblr media
Readme:
Load-balancing
Load-balancing algorithms
0 notes
dgruploads · 1 year ago
Text
youtube
AWS | Episode 51 | Mastering AWS Application Load Balancer: Intro & Hands-On Tutorial
1 note · View note
rackmount-official-my-ass · 11 days ago
Text
when I rant about cloudflare and the unintended centralization of the internet, here's why.
Tumblr media
the services they provide are valuable, but organizationally centralized—of course they are geographically distributed and redundant against hardware failure, but a bad config or company policy change can cause huge problems across the internet that are both hard to diagnose and hard to mitigate. for end users who don't know what a global load balancer is, it looks like half the internet just...fell off.
90 notes · View notes
blood-starved-beast · 1 year ago
Text
Seeing people say that Melinoe would be the type to reject love or love interests but like. I can see her being more polygamous than Zagreus precisely cause she's so hard-working and organized. Do you know how much work it requires to balance possibly 4 or 5 love interests? All with their own needs, personalities, vices etc.? Zagreus "my room in squalor is fine" could never.
224 notes · View notes
slaygentford · 4 months ago
Text
I want everyone to know from the bottom of my heart that if a teacher assigns you group work it's because they've talked themselves into believing it's pedagogically sound to sit at their desk for twenty minutes
31 notes · View notes
wilting-fl0wer · 2 months ago
Text
woe silly Mia (+ Sol) doodles be upon ye
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Mia... i miss her..... i need to post her more........
20 notes · View notes
marvel-lous-guy · 2 years ago
Text
Tony: here, hold this *hands Peter a wrench*
Peter: *now holding 17 different tools* I think I'm gonna drop it
Tony: You're fine
*loud clang and crash*
Peter: ...I dropped it
410 notes · View notes
exuvvium · 1 year ago
Text
hot take rlcraft sucks its not enjoyable at all
115 notes · View notes
morganbritton132 · 10 months ago
Text
Having an office job is like, 60% waiting for a report to load.
23 notes · View notes
quizicalgin · 2 months ago
Text
Tumblr media Tumblr media
Now then, to the mask dress. I've already picked out most of the parts, but now it's a matter of choosing which side split to work with. The red dress would be the most accurate, although I'd have to smooth out the texture to remove the sparkle. Alternatively there's going with the super tall thigh split that's off to the side, but I remember being an even bigger nightmare to work with.
7 notes · View notes
freshthoughts2020 · 7 months ago
Text
Tumblr media Tumblr media Tumblr media
#best sneaker footwear drops releases november 2024 week 4 nike adidas where to buy#Adidas#We’re rolling into the final days of November with a full head of steam#and the world’s biggest sneaker brands have one more round of drops set for us before we switch the calendar to the year’s final month. Nik#adidas#PUMA and more have everything from high-heat hoop shoes and altered takes on classics locked and loaded for this week#but before we dive in let’s take a look back at what went down over the last seven days first.#Nike had a wild week across all verticals#with two tenured collaborators#Stash and Hiroshi Fujiwara#teasing forthcoming projects (Air Max 95/Air Force 1 and Air Zoom Spiridon#respectively). Kobe Bryant got a tribute on two different Air Force 1 colorways — the “Home” and a black pair — that are set to release nex#while Travis Scott’s Jordan Jumpman Jack “Bright Cactus” had its official images revealed and several Nike/Jordan Brand sneakers debuted in#Not to be outdone#adidas made plenty of noise of their own. Olympic gold medalist Noah Lyles debuted a new Bad Bunny collab#while Jerry Lorenzo’s next Fear of God Athletics basketball shoes surfaced and the brand showed off a Foam Runner-indebted silhouette calle#with New Balance’s 993 having multiple moments in the spotlight thanks to the likes of JJJJound and Aimé Leon Dore#while OTTO 958 showed off its latest ASICS collab and stylist Veneda Carter continued her collaborative relationship with Timberland.#Now that you’re up to speed#check out what shoes are dropping this upcoming week and be sure to hit up HBX to shop styles that are available now.#Sporty & Rich x adidas SL72 “Sweden Pack”#Release Date: November 26#Release Price: $120 USD#Where to Buy: adidas#Why You Should Cop:Sporty & Rich announced its new collaboration with adidas Originals on the SL72 “Sweden Pack” last week — and it’s inspi#it’s been reworked with a retro aesthetic that pays homage to the athletic footwear designs of the 70s. adidas and S&R have used a selectio#using the colors to nod to Sweden’s national colors. Customary Three Stripe branding is applied to the lateral sides of the shoes#while further branding is applied to the tongues and heel counters to round things off.#Nike Air Max Waffle “Triple Black”#Release Price: $140 USD
12 notes · View notes
thepringlesofblood · 2 years ago
Text
the new d20 trailer: escaping/surviving in the forest, ink and parchment aesthetic, all sorts of woodland creatures and you are one of them, is (probably) going to pull the genre-expectations rug out from under you as soon as it has a chance
me
Tumblr media
89 notes · View notes
drdemonprince · 2 years ago
Text
i think in the past few weeks i finally overcame the long slow soul curshing burnout i fell into after writing my last two books and breaking up with a partner of over 10 years. lately i have been feeling ENERGIZED and excited by future projects rather than bitter and resentful about needing to do anything, and im more tolerant of stimulation rather than being so extremely stress averse that i cancel anything that requires much energy. my energy is feeding into itself now. perfect time to fuck it all up by writing another book.
70 notes · View notes
fantastic-mr-corvid · 4 months ago
Text
Now Tesoro is trans it complicates the hypothetical dynamics diagram* even more bc after she comes out her biggest haters [mainly Cherry] are like good for you! aw damn it now i kinda like you. But also Cherry is annoyed because she can never have her hair undyed bc otherwise the main difference between them is one tattoo, Tesoros freckles and Cherrys eyes being green.
*i forgive her for it bc its never fucking happening anyway
4 notes · View notes