{"id":328825,"date":"2022-01-31T09:00:27","date_gmt":"2022-01-31T09:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328825"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328825","title":{"rendered":"<span>\u041f\u043e\u0438\u0441\u043a \u043f\u0440\u0438\u0447\u0438\u043d \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b redis \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/hf\/wo\/yd\/hfwoydhi8cr-efmfaqacmjlhx24.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/hf\/wo\/yd\/hfwoydhi8cr-efmfaqacmjlhx24.jpeg\" data-blurred=\"true\"\/><\/p>\n<p>  \u041f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0441\u0430\u043c\u044b\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0435\u0440\u0432\u043e\u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0441\u0431\u043e\u0435\u0432 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0435\u0434\u0438\u0441-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043b\u0438\u043b\u0430\u0441\u044c \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b, \u043d\u043e \u043c\u043e\u0433\u043b\u0430 \u0431\u044b\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0430 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u0438\u0437 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. <\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 <\/h3>\n<p>  \u0418\u043c\u0435\u0435\u0442\u0441\u044f 3 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432: <\/p>\n<ul>\n<li>8 CPU Intel\u00ae Xeon\u00ae E3-1270 v5 @ 3.60GHz<\/li>\n<li>64 GB DDR3 RAM 1600MHz<\/li>\n<li>SSD 447 GB \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u043c \/var\/lib\/redis<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043d\u0438\u0445 (\u0434\u0432\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043e\u0434\u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430) \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e 2 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 redis, \u043c\u0430\u0441\u0442\u0435\u0440 \u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0430. \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0438\u0437 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432, \u0437\u0430\u043f\u0438\u0441\u044c \u2013 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c. \u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438: <\/p>\n<p>  <img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/nx\/qo\/1g\/nxqo1gmazgzwqnyrlaztbqljbgm.png\"\/><\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 redis \u043f\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c: <\/p>\n<p>  <img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/sn\/sc\/ib\/snscibzfya4hejl9om2cecylo3q.png\"\/><\/p>\n<p>  \u0417\u0430\u043c\u0435\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u043c\u0430\u0441\u0442\u0435\u0440 \u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u0421\u0434\u0435\u043b\u0430\u043b\u0438 \u0440\u0443\u0447\u043d\u043e\u0439 failover, \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. <br \/>  \u0418 \u0432\u0441\u0435 \u0431\u044b \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u0440\u043e\u043d\u0430 \u0432 \u0447\u0430\u0441 \u043d\u043e\u0447\u0438 \u043c\u0430\u0441\u0442\u0435\u0440 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 10.0.0.3 <s>\u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 \u0442\u044b\u043a\u0432\u0443<\/s> \u0441\u043d\u043e\u0432\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0436\u0430\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 10.0.0.1. <\/p>\n<p>  \u041b\u043e\u0433 \u043c\u0430\u0441\u0442\u0435\u0440\u0430:   <\/p>\n<pre><code class=\"bash\"># Connection with slave client id #123 lost. # Failover auth denied to 10.0.0.1:6382 its master is up # Configuration change detected. Reconfiguring myself as a replica of  10.0.0.1:6382<\/code><\/pre>\n<p>  \u041b\u043e\u0433 \u0440\u0435\u043f\u043b\u0438\u043a\u0438:  <\/p>\n<pre><code class=\"bash\">FAIL message received from 10.0.0.2:6381 about 10.0.0.3:6381 # Cluster state changed: fail # Failover auth granted to 10.0.0.1:6382 for epoch 799 # Cluster state changed: ok Clear FAIL state for node 10.0.0.3:6381: master without slots is reachable again. Marking node 10.0.0.3:6381 as failing (quorum reached). Clear FAIL state for node 10.0.0.3:6381: slave is reachable again.<\/code><\/pre>\n<p>  \u0422\u0430\u043a, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u0440\u043e\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u0430\u0441\u0442\u0435\u0440, \u043e\u043d \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438 \u043a\u0432\u043e\u0440\u0443\u043c \u0435\u0433\u043e \u0432\u044b\u0433\u043e\u043d\u044f\u0435\u0442, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u043d \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0434\u0430\u0440\u0430\u0445, \u043d\u043e \u0432 \u0440\u043e\u043b\u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0438. <br \/>  \u041f\u0440\u0438\u0447\u0435\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u0440\u043e\u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043c\u0430\u0441\u0442\u0435\u0440. <\/p>\n<h3>\u041d\u0443\u0436\u043d\u043e \u043b\u0438 \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443?<\/h3>\n<p>  \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435, \u0434\u0432\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u0440\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f (\u043e\u0442 15 \u043c\u0438\u043d\u0443\u0442). \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u043d\u0435\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u0443 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. <br \/>  \u0410 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435? \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u0440\u043e\u043d\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u0442\u0430\u0439\u043c\u0430\u0443\u0442, \u0442\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043d\u043e\u0432\u044c \u043d\u0430\u0447\u043d\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u0437 \u043a\u0432\u043e\u0440\u0443\u043c\u0430. <\/p>\n<p>  \u0422\u0430\u0439\u043c\u0430\u0443\u0442 \u0431\u044b\u043b \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d \u0441 5 \u0434\u043e 10 \u0441\u0435\u043a\u0443\u043d\u0434, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e, \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0430\u0448\u0438\u043d\u0443 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f. \u0415\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0430\u0439\u043c\u0430\u0443\u0442? \u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u043c \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0430\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0442\u044f\u043d\u0443\u0442\u044c\u0441\u044f. <\/p>\n<h3>\u041f\u043e\u0438\u0441\u043a \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.<\/h3>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u043a\u0440\u043e\u043d-\u0437\u0430\u0434\u0430\u0447\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u043f\u0440\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445?<\/p>\n<ul>\n<li>\u0420\u0435\u0441\u0443\u0440\u0441\u044b? \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 10.0.0.3 \u0445\u0443\u0434\u0448\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0447\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435? \u041d\u0435\u0442. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0430, \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430 10% \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u043e\u043d\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. <\/li>\n<li>\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438? \u041d\u0435\u0442, \u0437\u0434\u0435\u0441\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043c\u0435\u0436\u0434\u0443 \u0432\u0441\u0435\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435. <\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"bash\"># iperf -c 10.0.0.3 ------------------------------------------------------------ Client connecting to 10.0.0.3, TCP port 5001 TCP window size: 85.0 KByte (default) ------------------------------------------------------------ [  3] local 10.0.0.2 port 47646 connected with 10.0.0.3 port 5001 [ ID] Interval       Transfer     Bandwidth [  3]  0.0-10.0 sec  1.10 GBytes   946 Mbits\/sec<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0434\u0438\u0441\u043a\u0430\u043c\u0438? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u043b\u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438? \u0427\u0442\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 10.0.0.3 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u043e:<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"bash\">Server-s1# hdparm -Tt \/dev\/sda \/dev\/sda:  Timing cached reads:   33894 MB in  2.00 seconds = 16967.92 MB\/sec  Timing buffered disk reads: 538 MB in  3.00 seconds = 179.22 MB\/sec  Server-v3# hdparm -Tt \/dev\/xvda5  \/dev\/xvda5:  Timing cached reads:   7352 MB in  1.99 seconds = 3700.67 MB\/sec  Timing buffered disk reads: 186 MB in  3.00 seconds =  61.98 MB\/sec<\/code><\/pre>\n<p>  \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e:  <\/p>\n<pre><code class=\"bash\">Server-s1# sync; dd if=\/dev\/zero of=\/var\/lib\/redis\/tempfile bs=1M count=5024; sync 5024+0 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e 5024+0 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e  \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e 5268045824 \u0431\u0430\u0439\u0442\u0430 (5,3 GB), 9,31237 c, 566 MB\/c  Server-v3# sync; dd if=\/dev\/zero of=\/var\/lib\/redis\/tempfile bs=1M count=5024; sync 5024+0 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e 5024+0 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e  \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e 5268045824 \u0431\u0430\u0439\u0442\u0430 (5,3 GB), 12,0484 c, 437 MB\/c<\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u0438\u0434\u0435\u0438 \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b redis-benchmark \u044f\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 10.0.0.3 redis \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 8-10 \u0440\u0430\u0437 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c. <\/p>\n<p>  Redis-benchmark \u043d\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435:   <\/p>\n<pre><code class=\"bash\"># redis-benchmark -h 10.0.0.2 -p 6381 -q PING_INLINE: 223214.28 requests per second PING_BULK: 237529.69 requests per second SET: 222717.16 requests per second GET: 237529.69 requests per second INCR: 227272.73 requests per second LPUSH: 213219.61 requests per second LPOP: 241545.89 requests per second SADD: 234741.78 requests per second SPOP: 225225.22 requests per second LPUSH (needed to benchmark LRANGE): 218340.61 requests per second LRANGE_100 (first 100 elements): 242718.45 requests per second LRANGE_300 (first 300 elements): 242718.45 requests per second LRANGE_500 (first 450 elements): 230414.75 requests per second LRANGE_600 (first 600 elements): 222222.23 requests per second MSET (10 keys): 177304.97 requests per second<\/code><\/pre>\n<p>  Redis-benchmark \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435:   <\/p>\n<pre><code class=\"bash\"># redis-benchmark -h 10.0.0.3 -p 6381 -q PING_INLINE: 25542.79 requests per second PING_BULK: 27434.84 requests per second SET: 30797.66 requests per second GET: 26673.78 requests per second INCR: 31113.88 requests per second LPUSH: 32133.68 requests per second LPOP: 32331.07 requests per second SADD: 29594.55 requests per second SPOP: 30826.14 requests per second LPUSH (needed to benchmark LRANGE): 30988.54 requests per second LRANGE_100 (first 100 elements): 26413.10 requests per second LRANGE_300 (first 300 elements): 27100.27 requests per second LRANGE_500 (first 450 elements): 22706.63 requests per second LRANGE_600 (first 600 elements): 29429.08 requests per second MSET (10 keys): 23468.67 requests per second<\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0445\u0443\u0434\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u044e\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0432\u044b\u0448\u0435. \u041d\u043e \u0432 10 \u043b\u0438 \u0440\u0430\u0437?<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0432 \u0433\u0443\u0433\u043b\u0435 \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u0412\u0434\u0440\u0443\u0433, \u043d\u0430 <a href=\"https:\/\/www.objectrocket.com\/blog\/how-to\/thoughts-redis-performance\/\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 ObjectRocket<\/a> \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0438\u043d\u043e\u0432\u0430\u0442 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 \u0438 \u0436\u0438\u0442\u0435\u0439\u0441\u043a\u0438\u0439 \u0441\u043e\u0432\u0435\u0442, \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c redis \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Xen:   <\/p>\n<pre><code class=\"bash\">Probably the two most common operational choices which cause Redis to slow down is to 1) put it on a virtual machine \u2013 especially a Xen hypervisor based one and 2) heavy disk persistence.<\/code><\/pre>\n<p>  \u0422\u0430\u043a, \u0430 \u043a\u0430\u043a\u043e\u0439 \u0443 \u043d\u0430\u0441 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435?  <\/p>\n<pre><code class=\"bash\"># virt-what xen xen-hvm<\/code><\/pre>\n<p>  \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u044f \u043e\u0442\u043a\u0440\u044b\u043b \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 <a href=\"https:\/\/redis.io\/topics\/latency\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u0433\u0434\u0435 \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b redis \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e fork  <\/p>\n<pre><code class=\"bash\">Latency generated by fork In order to generate the RDB file in background, or to rewrite the Append Only File if AOF persistence is enabled, Redis has to fork background processes. The fork operation (running in the main thread) can induce latency by itself.<\/code><\/pre>\n<p>  \u0410 \u0440\u0430\u0437\u0432\u044f\u0437\u043a\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Xen \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442\u0441\u044f:  <\/p>\n<pre><code class=\"bash\">Fork time in different systems Modern hardware is pretty fast at copying the page table, but Xen is not. The problem with Xen is not virtualization-specific, but Xen-specific.<\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0430\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043a\u0430\u043a \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c Amazon, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e.   <\/p>\n<pre><code class=\"bash\">For EC2 users, make sure you use HVM based modern EC2 instances, like m3.medium. Otherwise fork() is too slow.<\/code><\/pre>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>  \u041f\u0440\u0438\u0447\u0438\u043d, \u0432\u043b\u0438\u044f\u044e\u0449\u0438\u0445 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043c\u0430\u043b\u043e, \u043f\u0440\u0438 \u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0436\u0435 \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0432\u0430\u0448\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>  P.S.: \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 DevOps \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/t.me\/devops_fm\">telegram-\u043a\u0430\u043d\u0430\u043b DevOps FM <\/a><\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/591555\/\"> https:\/\/habr.com\/ru\/company\/nixys\/blog\/591555\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/hf\/wo\/yd\/hfwoydhi8cr-efmfaqacmjlhx24.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/hf\/wo\/yd\/hfwoydhi8cr-efmfaqacmjlhx24.jpeg\" data-blurred=\"true\"\/><\/p>\n<p>  \u041f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0441\u0430\u043c\u044b\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0435\u0440\u0432\u043e\u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0441\u0431\u043e\u0435\u0432 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0435\u0434\u0438\u0441-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043b\u0438\u043b\u0430\u0441\u044c \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b, \u043d\u043e \u043c\u043e\u0433\u043b\u0430 \u0431\u044b\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0430 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u0438\u0437 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-328825","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=328825"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328825\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}