paint-brush
I-Decoding Load Balancing Primitivesnge@fairday
39,946 ukufundwa
39,946 ukufundwa

I-Decoding Load Balancing Primitives

nge Aleksei4m2024/02/26
Read on Terminal Reader
Read this story w/o Javascript

Kude kakhulu; Uzofunda

Lapho ukala isistimu yakho ukuze ihambisane nethrafikhi eyengeziwe nabasebenzisi, ungakhetha phakathi kokukalwa okuqondile, okuthuthukisa amandla eseva, nokukala okuvundlile, okubandakanya amaseva aphindaphindayo. Nakuba ukukala okuqondile kulula, kunemikhawulo efana nezingqinamba zehadiwe. Ukukala okuvundlile ngezilinganisi zomthwalo kunikeza ukuguquguquka kodwa kudinga ukuphatha ukungabi nasimo kanye namasu okusebenzisa. Ukuqonda izilinganisi zomthwalo we-L4 ne-L7 kubalulekile, i-L4 ivikeleke kakhulu futhi isebenze kahle, kuyilapho i-L7 inikeza umzila ohlakaniphile ngezindleko zokusebenza kahle. Ukukhetha indlela efanele kuncike ezidingweni zesistimu nokulinganisa ukuphepha nokusebenza.

People Mentioned

Mention Thumbnail
featured image - I-Decoding Load Balancing Primitives
Aleksei HackerNoon profile picture
0-item


Noma nini lapho isistimu yakho ikhula, i-traffic iyanda, abasebenzisi abaningi ngokwengeziwe basebenzisa imikhiqizo yakho, amaseva aqala ukuphendula kancane, isikhathi sokuphumula siphoqa ibhizinisi lakho ukuthi lihlupheke bese uqala ukucabanga ngokukala.


Kunamasu amabili ayinhloko okulinganisa - okuqondile nokuvundlile.


Ukukala okuqondile kuhlose ukukhulisa amandla esistimu ngokungeza ngokuvamile i-CPU eyengeziwe, ne-RAM kumaseva akho.


Ngokuphambene, ukukala okuvundlile kugxile ekuphindaphindeni (noma ekuhlanganiseni) amaseva akho eqoqweni lezinsiza.


Okuningi kulokhu:


Ukukala okuqondile

Ukukala okuqondile kuyinketho engcono kakhulu yesistimu yethrafikhi ephansi ngoba iyindlela efinyeleleka kakhulu yokusingatha ukukhula ngaphandle kokwethula ubunkimbinkimbi obengeziwe. Awudingi ukukhathalela ngokuthumela amasu eqembu lezinsiza, ukunwebeka kwechibi lezinsiza, ukungabi nasimo kweseva yakho, inqolobane esabalalisiwe, nokunye.


Nokho, ukukala okuqondile kunezihibe ezinkulu

  1. Umkhawulo wezingxenyekazi zekhompuyutha njengoba kungenakwenzeka ngokungenamkhawulo ukwengeza izinsiza
  2. Ukushoda kokuhluleka kanye nokuphindaphinda umsebenzi kuphakamisa ingcuphe yokuba nesikhathi eside sokuphumula kanye nokulahleka kwedatha


Ukukala okuvundlile

Ukukala okuvundlile kususa lezi zinkinga ngokuhlanganisa iziphakeli zohlelo lwakho lokusebenza nokushumeka ingxenye efana nesilinganisi somthwalo .


Isilinganisi somthwalo sisabalalisa ithrafikhi kumaseva akho sisebenzisa ama-algorithms athile afana nalawa:


  1. I-Round-robin
  2. I-robin enesisindo
  3. Izindlela ezisuselwa ku-IP ezisuselwa ku-hash
  4. Indlela yokuxhuma encane
  5. Indlela yokuxhumana enesisindo esincane
  6. Indlela yokuphendula okungenani, nezinye eziningi.


Noma kunjalo, inezinkinga ezimbalwa:


  1. Amaseva kufanele angabi nezwe
  2. Amaseshini kufanele aqhutshwe esitolo sedatha esimaphakathi
  3. Okuningi okuyinkimbinkimbi ukuhambisa amasu kungase kudingeke
  4. Isilinganisi somthwalo singaba umgoqo wokusebenza uma singalungiswanga kahle futhi izinsiza azanele
  5. Yethula ubunkimbinkimbi obengeziwe ohlelweni futhi ime njengephuzu elilodwa elingase lehluleke, elidinga ukusebenzisa amasu okuhluleka.


L4 / L7 Layisha ibhalansi

Ukuze amadivaysi amabili aku-inthanethi axhumane, amasistimu ayisisekelo kufanele alandele imigomo ethile. Wonke umuntu wezwa ngemodeli ye-OSI, echaza izendlalelo eziyisikhombisa ezisetshenziswa amasistimu wamakhompyutha ukuxhumana ngenethiwekhi. Nakuba i-inthanethi yesimanje isuselwe kumodeli yesitaki yephrothokholi ye-TCP/IP elula, imodeli ye-OSI isetshenziswa kakhulu, njengoba isiza ukubona ngeso lengqondo nokuxhumana ukuthi amanethiwekhi asebenza kanjani futhi isize ukuhlukanisa nokuxazulula izinkinga zenethiwekhi.


Izixazululo eziningi zokulinganisa umthwalo wemboni zisebenzisa amagama athi L4 kanye ne-L7 lapho i-L4 ibhekisela kungqimba lwezokuthutha kumodeli ye-OSI futhi i-L7 ibhekisela kusendlalelo sohlelo lokusebenza.


Ibhalansi yomthwalo we-L4 kuseyi-L2/L3 njengoba isebenzisa idatha evela ezansi njengekheli le-IP kanye nenombolo yembobo.


Izinzuzo eziyinhloko ze-L4 load balancer

  • Ivikeleke kakhulu futhi iyasebenza njengoba okuqukethwe kwedatha akuthathwa ekwenzeni izinqumo zomzila

  • Ukuxhumana okufanayo kwe-TCP kubambe phakathi kweklayenti neseva, okusiza ukuvimbela ukweqa umkhawulo wokuxhumana okutholakalayo kwe-TCP kusilinganisi somthwalo.


Okubi okubalulekile kwesilinganisi somthwalo we-L4

  • Umzila ohlakaniphile awunakwenzeka njengoba okuqukethwe akususi ukubethela
  • Iphrothokholi esemthethweni iletha ubunkimbinkimbi obengeziwe
  • Ukwenza imephu phakathi kwamakheli omphakathi nawangasese
  • Ayikho inqolobane njengoba okuqukethwe akutholakali kuleli zinga
  • Akwenzeki ukuthi kusetshenziselwe ukwakhiwa kwama-microservices njengoba ukuqondisa kabusha kwethrafikhi akutholakali ngokusekelwe kumzila we-url


Ngakolunye uhlangothi, isilinganisi somthwalo we-L7 sisebenza ezingeni lesicelo kumodeli ye-OSI


Izinzuzo eziyinhloko ze-L7 load balancer

  • Izinqumo ezihlakaniphile zingenziwa ngokusekelwe endleleni ye-URL, izihloko, okuqukethwe

  • Ukulondoloza inqolobane


Ukungalungi okukhulu kwe-L7 load balancer

  • I-overhead eyengeziwe ngenxa yokugcinwa kokuxhumana okubili kwe-TCP, okukodwa phakathi kweklayenti nesilinganisi somthwalo, okwesibili phakathi kwesilinganisi somthwalo neseva. Futhi, umkhawulo wokuxhumeka kwe-TCP yesilinganisi somthwalo udinga ukucatshangelwa
  • Ivikeleke kancane njengoba isilinganisi somthwalo kufanele sazi izitifiketi ukuze sikwazi ukususa ukubethela idatha futhi senze izinqumo zomzila


Isiphetho

Isilinganisi somthwalo siyingxenye ebalulekile lapho kusetshenziswa ukukala okuvundlile ukuze kuphathwe amasistimu ethrafikhi ephezulu. Kunezinhlobo ezimbili eziyinhloko zezilinganisi zomthwalo i-L4 ne-L7.


  1. I-L4 load balancer ivikeleke kakhulu futhi iyasebenza ngenxa yemikhawulo yokwenza izinqumo ezihlakaniphile

  2. I-L7 load balancer isebenza ngendlela yokuhlinzeka ngezinqumo zomzila ezihlakaniphile ngenxa yezindleko zokusebenza kahle nokuphepha


Ukukhetha uhlobo olufanele kuncike ezidingweni zesistimu futhi kufanele kucatshangelwe ngokucophelela ngebhalansi enengqondo yokusebenzisa izimiso zokuphepha kanye nokususa izingqinamba zokusebenza.


Iphinde ishicilelwe lapha.