{"id":33707,"date":"2019-10-31T21:54:17","date_gmt":"2019-10-31T18:54:17","guid":{"rendered":"https:\/\/prohoster.info\/blog\/inogda-bolshe-eto-menshe-kogda-umenshenie-nagruzki-privodit-k-uvelicheniyu-zaderzhki\/"},"modified":"2019-10-31T21:54:17","modified_gmt":"2019-10-31T18:54:17","slug":"inogda-bolshe-eto-menshe-kogda-umenshenie-nagruzki-privodit-k-uvelicheniyu-zaderzhki","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/inogda-bolshe-eto-menshe-kogda-umenshenie-nagruzki-privodit-k-uvelicheniyu-zaderzhki","title":{"rendered":"Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs \u00e7on n\u00eb rritje t\u00eb vones\u00ebs","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Ashtu si n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/mahdytech.com\/2019\/01\/13\/curious-case-999-latency-hike\/\">shum\u00eb prej postimeve<\/a><\/noindex>, u shfaq nj\u00eb problem me sh\u00ebrbimin e shp\u00ebrndar\u00eb, le ta quajm\u00eb k\u00ebt\u00eb sh\u00ebrbim Elvin. K\u00ebt\u00eb her\u00eb nuk e zbulova vet\u00eb problemin, m\u00eb than\u00eb djemt\u00eb nga ana e klientit.<\/p>\n<p>Nj\u00eb her\u00eb u zgjova nga nj\u00eb let\u00ebr t\u00eb pak\u00ebnaqur p\u00ebr vonesa t\u00eb m\u00ebdha me Elvinin, t\u00eb cilin ne planifikonim ta lansojm\u00eb s\u00eb shpejti. N\u00eb ve\u00e7anti, klienti u p\u00ebrball me nj\u00eb vones\u00eb 99 p\u00ebr qind rreth 50 ms, shum\u00eb m\u00eb e lart\u00eb se buxheti yn\u00eb i vonesave. Ishte e habitshme, pasi un\u00eb e kam testuar me kujdes sh\u00ebrbimin, ve\u00e7an\u00ebrisht p\u00ebr vonesat, pasi kjo \u00ebsht\u00eb nj\u00eb \u00e7\u00ebshtje ankesash t\u00eb shpeshta.<\/p>\n<p>P\u00ebrpara se t'i dor\u00ebzoja Elvinin p\u00ebr testim, un\u00eb kam b\u00ebr\u00eb shum\u00eb eksperimente me 40,000 k\u00ebrkesa n\u00eb sekund\u00eb (QPS), t\u00eb gjitha treguan vones\u00eb m\u00eb t\u00eb vog\u00ebl se 10 ms. Ishte gati t\u00eb deklaroja se nuk isha dakord me rezultatet e tyre. Por duke e par\u00eb s\u00ebrish letr\u00ebn, vura re di\u00e7ka t\u00eb re: un\u00eb me siguri nuk e kam testuar kushtet q\u00eb ata p\u00ebrmend\u00ebn, QPS e tyre ishte shum\u00eb m\u00eb e ul\u00ebt se e imja. Un\u00eb kam testuar me 40k QPS, nd\u00ebrsa ata vet\u00ebm me 1k. Pata nj\u00eb eksperiment tjet\u00ebr, k\u00ebt\u00eb her\u00eb me nj\u00eb QPS m\u00eb t\u00eb ul\u00ebt, vet\u00ebm p\u00ebr t'i k\u00ebnaqur ata.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nPasi po e shkruaj k\u00ebt\u00eb n\u00eb blog \u2014 ndoshta e keni kuptuar tashm\u00eb: numrat e tyre dol\u00ebn t\u00eb ishin t\u00eb sakt\u00eb. Un\u00eb e kontrollova klientin tim virtual p\u00ebrs\u00ebri e p\u00ebrs\u00ebri, gjithmon\u00eb me t\u00eb nj\u00ebjtin rezultat: numri i ul\u00ebt i k\u00ebrkesave jo vet\u00ebm q\u00eb rrit vones\u00ebn, por rrit gjithashtu numrin e k\u00ebrkesave me vones\u00eb mbi 10 ms. Me fjal\u00eb t\u00eb tjera, n\u00eb 40k QPS, rreth 50 k\u00ebrkesa n\u00eb sekund\u00eb kalonin 50 ms, nd\u00ebrsa n\u00eb 1k QPS, \u00e7do sekond\u00eb kishte 100 k\u00ebrkesa m\u00eb shum\u00eb se 50 ms. Paradoxi!<\/p>\n<p><img decoding=\"async\" alt=\"Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs \u00e7on n\u00eb rritje t\u00eb vones\u00ebs\" src=\"\/wp-content\/uploads\/2019\/05\/d181859376e2befad9ed631e8f8ff168.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h1>Ngushtoni k\u00ebrkimin<\/h1>\n<p>\nDuke u p\u00ebrballur me problemin e vones\u00ebs n\u00eb nj\u00eb sistem t\u00eb shp\u00ebrndar\u00eb me shum\u00eb komponente, gj\u00ebja e par\u00eb q\u00eb duhet b\u00ebr\u00eb \u00ebsht\u00eb t\u00eb krijoni nj\u00eb list\u00eb t\u00eb shkurt\u00ebr t\u00eb t\u00eb dyshuarve. Le t\u00eb shqyrtojm\u00eb m\u00eb thell\u00eb arkitektur\u00ebn e Elvin:<\/p>\n<p><img decoding=\"async\" alt=\"Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs \u00e7on n\u00eb rritje t\u00eb vones\u00ebs\" src=\"\/wp-content\/uploads\/2019\/05\/9b10198772b0e53890eb94d5e5c9afd0.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNj\u00eb pik\u00eb e mir\u00eb fillimi \u00ebsht\u00eb lista e kalimeve t\u00eb kryera t\u00eb hyrjeve-daljeve (thirrjet rrjetore\/k\u00ebrkimi n\u00eb disk etj.). Le t\u00eb p\u00ebrpiqemi t\u00eb kuptojm\u00eb, ku q\u00ebndron vonesa. P\u00ebrve\u00e7 hyrjes-daljes evidente me klientin, Elvini b\u00ebn nj\u00eb hap shtes\u00eb: ai i drejtohet magazin\u00ebs s\u00eb t\u00eb dh\u00ebnave. Megjithat\u00eb, kjo magazin\u00eb funksionon n\u00eb t\u00eb nj\u00ebjtin grup me Elvin, k\u00ebshtu q\u00eb atje vonesa duhet t\u00eb jet\u00eb m\u00eb e vog\u00ebl se me klientin. Prandaj, lista e t\u00eb dyshuarve:<\/p>\n<ol>\n<li>Thirrja rrjetore nga klienti te Elvini.\n<\/li>\n<li>Thirrja rrjetore nga Elvini te magazina e t\u00eb dh\u00ebnave.\n<\/li>\n<li>K\u00ebrkimi n\u00eb disk n\u00eb magazin\u00ebn e t\u00eb dh\u00ebnave.\n<\/li>\n<li>Thirrje rrjeti nga depoja e t\u00eb dh\u00ebnave te Elvini.\n<\/li>\n<li>Thirrje rrjeti nga Elvini te klienti.<\/li>\n<\/ol>\n<p>\nLe t\u00eb p\u00ebrpiqemi t\u00eb fshijm\u00eb disa pika.<\/p>\n<h3>Depoja e t\u00eb dh\u00ebnave nuk ka lidhje.<\/h3>\n<p>\nS\u00eb pari, un\u00eb e transformova Elvinin n\u00eb nj\u00eb server ping-ping, i cili nuk p\u00ebrpunon k\u00ebrkesat. Pas marrjes s\u00eb nj\u00eb k\u00ebrkese, ai ktheu nj\u00eb p\u00ebrgjigje bosh. N\u00ebse vonesa zvog\u00eblohet, at\u00ebher\u00eb problemi ndodhet n\u00eb realizimin e Elvinin ose t\u00eb depoes s\u00eb t\u00eb dh\u00ebnave \u2014 asgj\u00eb q\u00eb s\u2019ka ndodhur m\u00eb par\u00eb. N\u00eb eksperimentin e par\u00eb, ne marrim nj\u00eb grafik t\u00eb till\u00eb:<\/p>\n<p><img decoding=\"async\" alt=\"Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs \u00e7on n\u00eb rritje t\u00eb vones\u00ebs\" src=\"\/wp-content\/uploads\/2019\/05\/bd8fed2b2cc0d07946d1c4a868ae36b3.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nSi\u00e7 e shohim, p\u00ebrdorimi i serverit ping-ping nuk tregon asnj\u00eb p\u00ebrmir\u00ebsim. Kjo do t\u00eb thot\u00eb se depoja e t\u00eb dh\u00ebnave nuk e rrit vones\u00ebn, dhe lista e dyshuarve zvog\u00eblohet me gjysm\u00eb:<\/p>\n<ol>\n<li>Thirrja rrjetore nga klienti te Elvini.\n<\/li>\n<li>Thirrje rrjeti nga Elvini te klienti.<\/li>\n<\/ol>\n<p>\nSuper! Lista po zvog\u00eblohet shpejt. Mendova se pothuajse e zbardha arsyeja.<\/p>\n<h3>gRPC<\/h3>\n<p>\nTani \u00ebsht\u00eb koha p\u00ebr t'ju njohur me nj\u00eb lojtar t\u00eb ri: <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/grpc\/grpc\">gRPC<\/a><\/noindex>. Kjo \u00ebsht\u00eb nj\u00eb bibliotek\u00eb me kod t\u00eb hapur nga Google p\u00ebr komunikimin brenda procesit. <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Remote_procedure_call\">RPC<\/a><\/noindex>. Megjithat\u00eb, <code>gRPC<\/code> nuk \u00ebsht\u00eb mir\u00eb optimizuar dhe \u00ebsht\u00eb p\u00ebrdorur gjer\u00ebsisht, un\u00eb e kam p\u00ebrdorur p\u00ebr her\u00eb t\u00eb par\u00eb n\u00eb nj\u00eb sistem t\u00eb k\u00ebtij niveli, dhe prisja q\u00eb realizimi im do t\u00eb ishte jo optimal \u2014 p\u00ebr ta th\u00ebn\u00eb leht\u00ebsisht.<\/p>\n<p>Prania <code>gRPC<\/code> n\u00eb stek ka lindur nj\u00eb pyetje t\u00eb re: ndoshta, kjo \u00ebsht\u00eb realizimi im ose vet\u00eb <code>gRPC<\/code> po shkakton problemin e vones\u00ebs? Po e shtojm\u00eb n\u00eb list\u00ebn e dyshuarve t\u00eb reja:<\/p>\n<ol>\n<li>Klienti th\u00ebrret bibliotek\u00ebn <code>gRPC<\/code>\n<\/li>\n<li>Biblioteka <code>gRPC<\/code> n\u00eb klient ekzekuton thirrjen rrjetit t\u00eb bibliotek\u00ebs <code>gRPC<\/code> n\u00eb serverin\n<\/li>\n<li>Biblioteka <code>gRPC<\/code> kthen te Elvini (nuk ka operacione n\u00eb rastin e serverit ping-pong)<\/li>\n<\/ol>\n<p>\nP\u00ebr t\u2019u kuptuar se si duket kodi, realizimi im i klientit\/Elvinin nuk ndryshon shum\u00eb nga <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/grpc\/grpc\/tree\/v1.19.0\/examples\/cpp\/helloworld\">shembujt e klient-serverit async.<\/a><\/noindex>.<\/p>\n<blockquote><p><i>Sh\u00ebnim: lista e m\u00ebsip\u00ebrme \u00ebsht\u00eb pak e thjeshtuar, pasi <code>gRPC<\/code> merr mund\u00ebsin\u00eb e p\u00ebrdorimit t\u00eb modelit t\u00eb qarkullimit t\u00eb vet\u00eb (me template?), ku lidhin e stek t\u00eb ekzekutimit <code>gRPC<\/code> dhe implementimi i p\u00ebrdoruesit. P\u00ebr thjesht\u00ebsi, do t\u00eb q\u00ebndrojm\u00eb n\u00eb k\u00ebt\u00eb model.<\/i><\/p><\/blockquote>\n<p><\/p>\n<h3>Profilizimi do ta zgjidh\u00eb gjith\u00e7ka.<\/h3>\n<p>\nDuke fshir\u00eb depojat e t\u00eb dh\u00ebnave, mendova se pothuajse e p\u00ebrfundova: \u201cTani \u00ebsht\u00eb e leht\u00eb! Do ta p\u00ebrdorim profilin dhe do t\u00eb zbulojm\u00eb se ku ndodh vonesa.\u201d Un\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/mahdytech.com\/2019\/01\/13\/curious-case-999-latency-hike\/\">jemi nj\u00eb adhurues i madh i profilizimit t\u00eb sakt\u00eb,<\/a><\/noindex>sepse CPU-t\u00eb jan\u00eb shum\u00eb t\u00eb shpejt\u00eb dhe shpesh nuk jan\u00eb ngushtica. Shumica e vonesave ndodhin kur procesori duhet t\u00eb ndaloj\u00eb p\u00ebrpunimin p\u00ebr t\u00eb b\u00ebr\u00eb di\u00e7ka tjet\u00ebr. Profilizimi i sakt\u00eb i CPU \u00ebsht\u00eb b\u00ebr\u00eb posa\u00e7\u00ebrisht p\u00ebr k\u00ebt\u00eb: regjistron sakt\u00ebsisht t\u00eb gjitha <noindex><a rel=\"nofollow\" href=\"https:\/\/www.tutorialspoint.com\/what-is-context-switching-in-operating-system\">ndryshimet e kontekstit<\/a><\/noindex> dhe tregon se ku ndodhin vonesat.<\/p>\n<p>Mora mora kam tre profile: p\u00ebr QPS t\u00eb lart\u00eb (vonesa e vog\u00ebl) dhe me server ping-pong n\u00eb QPS t\u00eb ul\u00ebt (vonese e madhe), si n\u00eb an\u00ebn e klientit ashtu edhe n\u00eb an\u00ebn e serverit. Dhe thjesht p\u00ebr t\u00eb qen\u00eb n\u00eb rast, mora edhe nj\u00eb most\u00ebr t\u00eb profilit t\u00eb procesorit. Kur krahasoja profilet, zakonisht k\u00ebrkoja nj\u00eb stak thirrjesh anomale. P\u00ebr shembull, n\u00eb an\u00ebn e keqe me vones\u00eb t\u00eb lart\u00eb ndodhin shum\u00eb m\u00eb tep\u00ebr nd\u00ebrrime konteksti (10 ose m\u00eb shum\u00eb her\u00eb). Por n\u00eb rastin tim, numri i nd\u00ebrrimeve t\u00eb kontekstit ishte praktikisht i nj\u00ebjt\u00eb. P\u00ebr habin\u00eb time, nuk kishte asgj\u00eb thelb\u00ebsore.<\/p>\n<h1>Debugging shtes\u00eb<\/h1>\n<p>\nIsha n\u00eb d\u00ebshp\u00ebrim. Nuk dija \u00e7far\u00eb mjete t\u00eb tjera mund t\u00eb p\u00ebrdorja, dhe plani im i ardhsh\u00ebm ishte esencialisht p\u00ebrs\u00ebritja e eksperimenteve me variacione t\u00eb ndryshme, n\u00eb vend t\u00eb diagnostikimit t\u00eb sakt\u00eb t\u00eb problemit.<\/p>\n<h3>\u00c7far\u00eb, n\u00ebse<\/h3>\n<p>\nQ\u00eb nga fillimi, m\u00eb shqet\u00ebsonte nj\u00eb vones\u00eb e caktuar prej 50 ms. Kjo \u00ebsht\u00eb shum\u00eb koh\u00eb. Vendosa t\u00eb prisja pjes\u00eb nga kodi derisa t\u00eb mund t\u00eb zbuloja sakt\u00ebsisht se cila pjes\u00eb shkaktonte k\u00ebt\u00eb gabim. Pastaj pasoi nj\u00eb eksperiment q\u00eb funksionoi.<\/p>\n<p>Si zakonisht, pas retrospektiv\u00ebs gjith\u00e7ka dukej e dukshme. Vendosa klientin n\u00eb nj\u00eb makin\u00eb me Elvinin - dhe d\u00ebrgova k\u00ebrkes\u00ebn n\u00eb <code>localhost<\/code>. Dhe rritja e vones\u00ebs u zhduk!<\/p>\n<p><img decoding=\"async\" alt=\"Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs \u00e7on n\u00eb rritje t\u00eb vones\u00ebs\" src=\"\/wp-content\/uploads\/2019\/05\/2d8466625a264abe2110a65592ee0da8.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nDi\u00e7ka nuk ishte n\u00eb rregull me rrjetin.<\/p>\n<h3>M\u00ebsojm\u00eb aft\u00ebsit\u00eb e inxhinierit t\u00eb rrjetit<\/h3>\n<p>\nDuhet t\u00eb pranoj: njohurit\u00eb e mia rreth teknologjis\u00eb s\u00eb rrjetit jan\u00eb t\u00eb tmerrshme, sidomos duke marr\u00eb parasysh se punoj me to \u00e7do dit\u00eb. Por rrjeti ishte i dyshuari kryesor dhe duhej t\u00eb m\u00ebsoja se si ta diagnostikoj.<\/p>\n<p>Kateqoriya: Parametr\/Spesifikasiya | Etibarl\u0131l\u0131q sinfi: Tier III+ (SLA 99.99%) | Yerl\u0259\u015fm\u0259: Sofiya, Bolqar\u0131stan (Ov\u00e7e Pole k\u00fc\u00e7\u0259si, 122) | Sertifikatla\u015fd\u0131rma: ISO 27001:2013, ISO 9001:2015, PCI DSS 4.0 | Elektrik t\u0259chizat\u0131: 3 m\u00fcst\u0259qil 10 kV giri\u015f + \u00f6z yar\u0131mstansiyas\u0131 | Ehtiyat g\u00fcc t\u0259chizat\u0131: 6 dizel-generator (4.8 MVt), UPS N+1 (AC\/DC) | Soyutma: N+1 d\u0259qiqlikli kondisionerl\u0259r, stellaj ba\u015f\u0131na 12 kVt-a q\u0259d\u0259r | \u015e\u0259b\u0259k\u0259 v\u0259 \u0259laq\u0259: Carrier-neutral, m\u00fcst\u0259qil optik giri\u015fl\u0259r, Meet-Me Rooms | Yan\u011f\u0131ns\u00f6nd\u00fcrm\u0259: VESDA erk\u0259n a\u015fkarlama sistemi, FM200 v\u0259 IG-55 qaz\u0131 | T\u0259hl\u00fck\u0259sizlik: 24\/7 m\u00fchafiz\u0259, biometrik giri\u015f n\u0259zar\u0259ti, CCTV | D\u0259st\u0259k: Smart Hands-and-Eyes 24\/7\/365<\/p>\n<p>Bolqar\u0131standa serverl\u0259r <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.microsoft.com\/en-us\/sysinternals\/downloads\/psping\">Imgi 39 database securitydata server web concept cloud storage technologythe programmer works laptop 101087 2634<\/a><\/noindex> Imgi 3 trendy isometric icon electrical panel 9206 10922<\/p>\n<p>Imgi 38 big data analytics abstract concept vector illustration 107173 25643 <noindex><a rel=\"nofollow\" href=\"https:\/\/support.microsoft.com\/en-ca\/help\/314868\/how-to-use-tracert-to-troubleshoot-tcp-ip-problems-in-windows\">Imgi 36 saas software as service engineer sysadmin sync data cloud application server 1162612 5073<\/a><\/noindex>Imgi 2 premium hosting using man woman users vector boy girl use laptop connected server premium hosting characters connectivity cyberspace technology fla<\/p>\n<p>Pra, arsyeja e vones\u00ebs nuk ishte kodi im, as implementimi i gRPC dhe as rrjeti. Kisha filluar t\u00eb shqet\u00ebsohesha se kurr\u00eb nuk do ta kuptoja k\u00ebt\u00eb.<\/p>\n<h3>Tani, n\u00eb cil\u00ebn OS jemi<\/h3>\n<p>\n<code>gRPC<\/code> p\u00ebrdoret gjer\u00ebsisht n\u00eb Linux, por p\u00ebr Windows \u00ebsht\u00eb ekzotike. Vendosa t\u00eb b\u00ebja nj\u00eb eksperiment q\u00eb funksionoi: krijova nj\u00eb makin\u00eb virtuale Linux, kompilova Elvinin p\u00ebr Linux dhe e vendosa.<\/p>\n<p><img decoding=\"async\" alt=\"Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs \u00e7on n\u00eb rritje t\u00eb vones\u00ebs\" src=\"\/wp-content\/uploads\/2019\/05\/ee74c16de7e1ac6c286e401660e94ca1.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nDhe ja \u00e7far\u00eb ndodhi: n\u00eb serverin ping-pong Linux nuk kishte ato vonesa si n\u00eb nodin p\u00ebrkat\u00ebs Windows, megjith\u00ebse burimi i t\u00eb dh\u00ebnave nuk ndryshonte. Doli se problemi ishte n\u00eb implementimin e gRPC p\u00ebr Windows.<\/p>\n<h3>Algoritmi Neigel<\/h3>\n<p>\nGjat\u00eb gjith\u00eb k\u00ebsaj kohe mendoja se m\u00eb mungonte flagu <code>gRPC<\/code>. Tani e kuptoj se n\u00eb t\u00eb v\u00ebrtet\u00eb mungonte flagu n\u00eb <code>gRPC<\/code> Windows. Gjeta nj\u00eb bibliotek\u00eb t\u00eb brendshme RPC, p\u00ebr t\u00eb cil\u00ebn isha i sigurt se punonte mir\u00eb p\u00ebr t\u00eb gjith\u00eb flagat e instaluara <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/winsock\/windows-sockets-start-page-2\">Winsock<\/a><\/noindex>. M\u00eb pas, i shtova t\u00eb gjitha k\u00ebto flamuj n\u00eb gRPC dhe e zhvillova Alvinin n\u00eb Windows, n\u00eb serverin e rregulluar ping-pong n\u00ebn Windows!<\/p>\n<p><img decoding=\"async\" alt=\"Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs \u00e7on n\u00eb rritje t\u00eb vones\u00ebs\" src=\"\/wp-content\/uploads\/2019\/05\/ce3a4066c78f9f6a63fd68578224d6e5.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<i>Gati<\/i> : fillova t\u00eb hiqja flamujt e shtuar nj\u00eb nga nj\u00eb, derisa t\u00eb rikthehej regresioni, k\u00ebshtu q\u00eb arrita t\u00eb identifikoj sakt\u00ebsisht shkakun e tij. Ishte ai i njohur <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/api\/winsock\/nf-winsock-setsockopt\">TCP_NODELAY<\/a><\/noindex>, nd\u00ebrruesi i algoritmit Nagle.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Nagle%27s_algorithm\">Algoritmi Neigel<\/a><\/noindex> p\u00ebrpiqet t\u00eb reduktoj\u00eb numrin e paketimeve t\u00eb d\u00ebrguara n\u00eb rrjet duke vonuar d\u00ebrgimin e mesazheve derisa madh\u00ebsia e paket\u00ebs t\u00eb kaloj\u00eb nj\u00eb num\u00ebr t\u00eb caktuar bajt\u00ebsh. Nd\u00ebrsa kjo mund t\u00eb jet\u00eb e dobishme p\u00ebr p\u00ebrdoruesit e zakonsh\u00ebm, \u00ebsht\u00eb shkat\u00ebrruese p\u00ebr serverat n\u00eb koh\u00eb reale, pasi OS do t\u00eb vonoj\u00eb disa mesazhe, duke shkaktuar vonesa n\u00eb nj\u00eb QPS t\u00eb ul\u00ebt. Ky <code>gRPC<\/code> flamur ishte vendosur n\u00eb implementimin Linux p\u00ebr soket TCP, por jo p\u00ebr Windows. E kuptova k\u00ebt\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/grpc\/grpc\/commit\/1dce1009e67ea4b5934a61b1bcf8a217bd12cc76\">rregullova<\/a><\/noindex>.<\/p>\n<h1>P\u00ebrfundim<\/h1>\n<p>\nVonesa e madhe n\u00eb nj\u00eb QPS t\u00eb ul\u00ebt ishte shkaktuar nga optimizimi i OS-s\u00eb. Duke e par\u00eb mbrapa, profilizimi nuk zbuloi vones\u00ebn, sepse u krye n\u00eb modin b\u00ebrtham\u00eb dhe jo n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/blog.codinghorror.com\/understanding-user-and-kernel-mode\/\">modin e p\u00ebrdoruesit<\/a><\/noindex>. Nuk e di n\u00ebse mund t\u00eb v\u00ebzhgohet algoritmi Nagle p\u00ebrmes kapjesh ETW, por kjo do t\u00eb ishte interesante.<\/p>\n<p>Sa i p\u00ebrket eksperimentit localhost, ndoshta nuk ishte n\u00eb lidhje me kodin e v\u00ebrtet\u00eb t\u00eb rrjetit, dhe algoritmi Nagle nuk ishte aktivizuar, prandaj problemet me vonesat u zhduk\u00ebn kur klienti iu drejtua Alvinit p\u00ebrmes localhost.<\/p>\n<p>Her\u00ebn tjet\u00ebr q\u00eb do t\u00eb shihni nj\u00eb rritje t\u00eb vonesave kur t\u00eb ulni numrin e k\u00ebrkesave p\u00ebr sekond\u00eb, algoritmi Nagle duhet t\u00eb jet\u00eb n\u00eb list\u00ebn tuaj t\u00eb t\u00eb dyshuarve!<br \/>\n<br \/>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/451904\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u0442\u043e\u0432, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u0443 \u0441\u043b\u0443\u0436\u0431\u0443 \u042d\u043b\u0432\u0438\u043d. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u043d\u0435 \u0441\u0430\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043c\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u0440\u0435\u0431\u044f\u0442\u0430 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u044f \u043f\u0440\u043e\u0441\u043d\u0443\u043b\u0441\u044f \u043e\u0442 \u043d\u0435\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a \u0443 \u042d\u043b\u0432\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 99-\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0432 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":25389,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-33707","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u0442\u043e\u0432, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u0443 \u0441\u043b\u0443\u0436\u0431\u0443 \u042d\u043b\u0432\u0438\u043d.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/inogda-bolshe-eto-menshe-kogda-umenshenie-nagruzki-privodit-k-uvelicheniyu-zaderzhki\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u044d\u0442\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u041a\u043e\u0433\u0434\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u0442\u043e\u0432, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u0443 \u0441\u043b\u0443\u0436\u0431\u0443 \u042d\u043b\u0432\u0438\u043d.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/inogda-bolshe-eto-menshe-kogda-umenshenie-nagruzki-privodit-k-uvelicheniyu-zaderzhki\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:54:17+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:54:17+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Ndonj\u00ebher\u00eb m\u00eb shum\u00eb \u00ebsht\u00eb m\u00eb pak. Kur ulja e ngarkes\u00ebs shkakton rritjen e vones\u00ebs | ProHoster","description":"Si n\u00eb shumic\u00ebn e postimeve, kishte nj\u00eb problem me sh\u00ebrbimin e shp\u00ebrndar\u00eb, ta quajm\u00eb k\u00ebt\u00eb sh\u00ebrbim Alvin.","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/inogda-bolshe-eto-menshe-kogda-umenshenie-nagruzki-privodit-k-uvelicheniyu-zaderzhki","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u044d\u0442\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u041a\u043e\u0433\u0434\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 | ProHoster","og:description":"\u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u0442\u043e\u0432, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u0443 \u0441\u043b\u0443\u0436\u0431\u0443 \u042d\u043b\u0432\u0438\u043d.","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/inogda-bolshe-eto-menshe-kogda-umenshenie-nagruzki-privodit-k-uvelicheniyu-zaderzhki","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:54:17+00:00","article:modified_time":"2019-10-31T18:54:17+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"33707","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 16:23:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 02:35:31","updated":"2026-01-21 16:23:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/33707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=33707"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/33707\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/25389"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=33707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=33707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=33707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}