{"id":38666,"date":"2026-03-26T18:50:12","date_gmt":"2026-03-26T15:50:12","guid":{"rendered":"https:\/\/www.fl.ru\/projects\/5496694\/stabilizatsiya-websocket-podklyucheniy-k-birjam.html"},"modified":"2026-03-26T18:50:12","modified_gmt":"2026-03-26T15:50:12","slug":"%d1%81%d1%82%d0%b0%d0%b1%d0%b8%d0%bb%d0%b8%d0%b7%d0%b0%d1%86%d0%b8%d1%8f-websocket-%d0%bf%d0%be%d0%b4%d0%ba%d0%bb%d1%8e%d1%87%d0%b5%d0%bd%d0%b8%d0%b9-%d0%ba-%d0%b1%d0%b8%d1%80%d0%b6%d0%b0%d0%bc","status":"publish","type":"post","link":"https:\/\/texnolenta.ru\/job\/2026\/03\/26\/%d1%81%d1%82%d0%b0%d0%b1%d0%b8%d0%bb%d0%b8%d0%b7%d0%b0%d1%86%d0%b8%d1%8f-websocket-%d0%bf%d0%be%d0%b4%d0%ba%d0%bb%d1%8e%d1%87%d0%b5%d0%bd%d0%b8%d0%b9-%d0%ba-%d0%b1%d0%b8%d1%80%d0%b6%d0%b0%d0%bc\/","title":{"rendered":"\u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f WEBSOCKET-\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a \u0431\u0438\u0440\u0436\u0430\u043c (\u0434\u043b\u044f \u0432\u0441\u0435\u0445)"},"content":{"rendered":"<p> \u0422\u0417: \u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f WEBSOCKET-\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a \u0431\u0438\u0440\u0436\u0430\u043c<br \/>\n=================================================  s:\/\/github.com\/arrrtem0607\/exchange-data-collector<br \/>\n s:\/\/github.com\/arrrtem0607\/exchange-data-collector<br \/>\n s:\/\/github.com\/arrrtem0607\/exchange-data-collector \u041a\u041e\u041d\u0422\u0415\u041a\u0421\u0422 \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a 6 \u0431\u0438\u0440\u0436\u0430\u043c (Binance, Bybit, Bitget, Gate.io, KuCoin,<br \/>\nHyperliquid) \u043f\u043e WebSocket, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 orderbook \u0438 mark price \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<br \/>\n\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430 &#8212; \u0447\u0430\u0441\u0442\u044b\u0435 \u043e\u0431\u0440\u044b\u0432\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0435 \u043f\u043e\u0442\u0435\u0440\u0438<br \/>\n\u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438. \u0417\u0430\u0434\u0430\u0447\u0430: \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c, \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u041f\u0420\u041e\u0411\u041b\u0415\u041c\u0410 1: Binance &#8212; \u0447\u0430\u0441\u0442\u044b\u0435 \u043e\u0431\u0440\u044b\u0432\u044b WS-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Binance-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043e\u0431\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f (EOF, unexpected EOF,<br \/>\nconnection reset by peer). \u042d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0431\u0438\u0440\u0436\u0430 \u0441 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u043c\u0438 \u043e\u0431\u0440\u044b\u0432\u0430\u043c\u0438 &#8212;<br \/>\n\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0435\u0435. \u0424\u0430\u0439\u043b\u044b: &#8212; internal\/binance\/ws.go (readLoop, handleConnection, buildURL, batchSymbols) &#8212; internal\/binance\/provider.go &#8212; config.json (\u0441\u0435\u043a\u0446\u0438\u044f binance) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u041f\u0420\u041e\u0411\u041b\u0415\u041c\u0410 2: KuCoin &#8212; \u043e\u0431\u0440\u044b\u0432\u044b Pro API \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; KuCoin Pro API \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438 &#8212; \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043f\u0430\u0434\u0430\u044e\u0442<br \/>\n\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0442\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443<br \/>\n\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0424\u0430\u0439\u043b\u044b: &#8212; internal\/kucoin\/ws.go (orderBookLoopPro, handleOrderBookConnectionPro, subscribePro, dialPro) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u041f\u0420\u041e\u0411\u041b\u0415\u041c\u0410 3: \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0435 stale drops \u043d\u0430 \u0432\u0441\u0435\u0445 \u0431\u0438\u0440\u0436\u0430\u0445<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 &gt; 1 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f (MaxStaleLatency). \u041e\u0431\u044a\u0451\u043c<br \/>\n\u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0433\u0440\u043e\u043c\u0435\u043d &#8212; \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b OB \u0438 \u0441\u043e\u0442\u043d\u0438 \u0442\u044b\u0441\u044f\u0447 MP \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0447\u0430\u0441.<br \/>\n\u041d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a, \u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u043e\u0433. \u0424\u0430\u0439\u043b\u044b: &#8212; \u043b\u043e\u0433\u0438\u043a\u0430 \u0434\u0440\u043e\u043f\u0430 \u0432 ws.go \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0438\u0440\u0436\u0438 (\u043f\u043e\u0438\u0441\u043a \u043f\u043e obStaleCount, mpStaleCount) &#8212; \u043f\u043e\u0440\u043e\u0433 \u0437\u0430\u0434\u0430\u043d \u0432 \u043a\u0430\u0436\u0434\u043e\u043c provider.go (MaxStaleLatency: time.Second) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u041f\u0420\u041e\u0411\u041b\u0415\u041c\u0410 4: \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0442\u0438\u043a\u0435\u0440\u043e\u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 &#171;\u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438&#187;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; \u0422\u0438\u043a\u0435\u0440 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f stale \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0435\u0433\u043e \u0431\u0438\u0440\u0436\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438<br \/>\nreconnecting (internal\/store\/store.go, \u043c\u0435\u0442\u043e\u0434 ComputeStats). \u0418\u0437-\u0437\u0430 \u0447\u0430\u0441\u0442\u044b\u0445<br \/>\n\u043e\u0431\u0440\u044b\u0432\u043e\u0432 Binance (\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 1) \u0432\u0441\u0435 \u0435\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e stale &#8212; \u044d\u0442\u043e 70%+<br \/>\n\u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0442\u0438\u043a\u0435\u0440\u043e\u0432. \u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c 1-3 \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u0439\u0442\u0438 \u043f\u0440\u0438 \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0438. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u041f\u0420\u041e\u0411\u041b\u0415\u041c\u0410 5: P95\/P99 latency \u0443\u043f\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u0442\u043e\u043b\u043e\u043a \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; \u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438 latency \u0443 \u0432\u0441\u0435\u0445 \u0431\u0438\u0440\u0436 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0431\u0430\u043a\u0435\u0442\u0430<br \/>\n\u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b (1000ms). \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442<br \/>\n\u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 &gt;500ms. \u0424\u0430\u0439\u043b\u044b: &#8212; internal\/store\/store.go (\u0442\u0438\u043f latencyHistogram, \u043c\u0435\u0442\u043e\u0434 Percentile) ===========================================================================<br \/>\n\u041a\u0420\u0418\u0422\u0415\u0420\u0418\u0418 \u041f\u0420\u0418\u0401\u041c\u041a\u0418<br \/>\n=========================================================================== \u0417\u0430\u043c\u0435\u0440 \u0437\u0430 1 \u0447\u0430\u0441 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b (go run .): \u041c\u0435\u0442\u0440\u0438\u043a\u0430 \u0421\u0435\u0439\u0447\u0430\u0441 \u0426\u0435\u043b\u044c &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;- Binance WS \u043e\u0431\u0440\u044b\u0432\u043e\u0432\/\u0447\u0430\u0441 \u0441\u043e\u0442\u043d\u0438 &lt;&gt;70% &lt; 5% P95 latency 1000ms (\u043f\u043e\u0442\u043e\u043b\u043e\u043a) &lt; 500ms \u0412\u0441\u0435 6 \u0431\u0438\u0440\u0436 \u0432 &#171;\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f:&#187; 5 \u0438\u0437 6 6 \u0438\u0437 6 go test .\/&#8230; pass pass \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043a\u0430\u0436\u0434\u044b\u0435 5 \u0441\u0435\u043a\u0443\u043d\u0434. \u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438: \u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445: OK &lt;- \u0446\u0435\u043b\u044c \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: Binance 15\/15 | &#8230; &lt;- \u0432\u0441\u0435 active = total stale drops: 0 OB, 0 MP &lt;- \u0446\u0435\u043b\u044c  <\/p>\n","protected":false},"excerpt":{"rendered":"<p> \u0422\u0417: \u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f WEBSOCKET-\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a \u0431\u0438\u0440\u0436\u0430\u043c<br \/>\n=================================================  s:\/\/github.com\/arrrtem0607\/exchange-data-collector<br \/>\n s:\/\/github.com\/arrrtem0607\/exchange-data-collector<br \/>\n s:\/\/github.com\/arrrtem0607\/exchange-data-collector \u041a\u041e\u041d\u0422\u0415\u041a\u0421\u0422 \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a 6 \u0431\u0438\u0440\u0436\u0430\u043c (Binance, Bybit, Bitget, Gate.io, KuCoin,<br \/>\nHyperliquid) \u043f\u043e WebSocket, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 orderbook \u0438 mark price \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<br \/>\n\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430 -&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[13],"class_list":["post-38666","post","type-post","status-publish","format-standard","hentry","category-flrusoft","tag-13"],"_links":{"self":[{"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/posts\/38666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/comments?post=38666"}],"version-history":[{"count":0,"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/posts\/38666\/revisions"}],"wp:attachment":[{"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/media?parent=38666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/categories?post=38666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/texnolenta.ru\/job\/wp-json\/wp\/v2\/tags?post=38666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}