{"id":339232,"date":"2022-10-03T09:00:29","date_gmt":"2022-10-03T09:00:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=339232"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=339232","title":{"rendered":"<span>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0435 K6 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0438\u0441\u043a\u0430<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0448\u0430\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0438\u0441\u043a\u0430, \u043a\u0430\u043a \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c K6 \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 Elastic Search \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439.<\/p>\n<p>\u0422\u0417: \u041d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438-\u0442\u0435\u043d\u0430\u043d\u0442 (multi-tenant) \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0438\u0441\u043a\u0430. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u043d\u0430\u043d\u0442\u0430 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0432 Elastic Search. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u043d\u0430\u043d\u0442\u043e\u0432 = 100. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0435\u043d\u0430\u043d\u0442\u0435 = 500 000. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 90 \u0442\u0435\u043d\u0430\u043d\u0442\u043e\u0432 \u043f\u043e 20 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 + 10 \u0442\u0435\u043d\u0430\u043d\u0442\u043e\u0432 \u043f\u043e 100 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0440\u0430\u0437 \u0432 5 \u043c\u0438\u043d\u0443\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c.<\/p>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0431\u044b\u043b\u0430 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5f2\/055\/c8e\/5f2055c8e240abafcb13c2f8f19e2dbb.png\" width=\"935\" height=\"458\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f2\/055\/c8e\/5f2055c8e240abafcb13c2f8f19e2dbb.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0445\u0435\u043c\u0435 \u043f\u043e\u0434\u0445\u043e\u0434 &#171;\u0432 \u043b\u043e\u0431&#187; \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u0433\u0443\u0434 &#8212; \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u0438 \u0441\u0445\u0435\u043c\u0443<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/932\/70b\/d9b\/93270bd9b1dffd08bbb557727ee0d52b.png\" width=\"310\" height=\"228\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/932\/70b\/d9b\/93270bd9b1dffd08bbb557727ee0d52b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0436\u0435 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 Elastic \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043b\u043e\u0433\u0438\u043a\u0443, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443.<\/p>\n<p><strong>\u041c\u0438\u043d\u0443\u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/strong>: \u0415\u0441\u043b\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 &#8212; \u0442\u043e \u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.  <\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 Elastic \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0443 50 000 000 \u0440\u0430\u0437, \u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0431\u044b\u0441\u0442\u0440\u044b\u043c. \u0414\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u0432\u0435 \u0444\u0438\u0448\u043a\u0438: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 Elastic \u0431\u0430\u0442\u0447\u0430\u043c\u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441. \u0417\u0430\u0442\u0435\u043c \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437. <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 50 000 000 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u043b\u0438 \u0437\u0430 1 \u043c\u0438\u043d\u0443\u0442\u0443.<\/p>\n<p>\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b9c\/088\/9e2\/b9c0889e2b96f7d74ddd2a15a28f41cb.png\" width=\"922\" height=\"733\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b9c\/088\/9e2\/b9c0889e2b96f7d74ddd2a15a28f41cb.png\"\/><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Elastic \u0447\u0435\u0440\u0435\u0437 NEST<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">using Nest; using System; using System.Collections.Generic; using System.Dynamic;  namespace ElasticApiClient {     public class NestClient     {         private readonly ElasticClient _api;         public NestClient(string url, string user, string password)         {             var connectionSettings = new ConnectionSettings(new Uri(url));             _api = new ElasticClient(connectionSettings);             connectionSettings.BasicAuthentication(                 user,                 password);         }          public void DeleteUnusedIndices()         {             var response = _api.Indices.GetAsync(new GetIndexRequest(Indices.All)).GetAwaiter().GetResult();                          foreach (var index in response.Indices)             {                 var indexName = index.Key;                 var countRequest = new CountRequest(Indices.Index(indexName));                 var numberOfDocuments = _api.CountAsync(countRequest).GetAwaiter().GetResult().Count;                 if (numberOfDocuments == 0)                 {                     _api.Indices.DeleteAsync(indexName).GetAwaiter().GetResult();                 }             }         }          public void CloneIndices(string sourceName, List&lt;string> targetNames)         {             _api.Indices.UpdateSettingsAsync(Indices.Index(sourceName), u => u                 .IndexSettings(i => i                     .Setting(\"index.blocks.write\", true)                 )             ).GetAwaiter().GetResult();              foreach (var targetName in targetNames)             {                 _api.Indices.CloneAsync(new CloneIndexRequest(sourceName, targetName)).GetAwaiter().GetResult();             }              _api.Indices.UpdateSettingsAsync(Indices.Index(sourceName), u => u                 .IndexSettings(i => i                     .Setting(\"index.blocks.write\", false)                 )             ).GetAwaiter().GetResult();         }          public void DeleteTestIndices(List&lt;string> testTenantIds)         {             var testIndexNames = new List&lt;string>();             foreach (var testTenantId in testTenantIds)             {                 testIndexNames.Add($\"{testTenantId}-documents\");             }                          var response = _api.Indices.GetAsync(new GetIndexRequest(Indices.All)).GetAwaiter().GetResult();                          foreach (var index in response.Indices)             {                 var indexName = index.Key;                 if (testIndexNames.Contains(indexName.Name))                 {                     _api.Indices.DeleteAsync(indexName).GetAwaiter().GetResult();                 }             }         }          public void IndexMany(List&lt;ExpandoObject> expandos, string indexName)         {             var ids = new List&lt;Guid>();             foreach (var expando in expandos)             {                 var byName = (IDictionary&lt;string, object>)expando;                 var documentId = (Guid)byName[\"documentId\"];                 ids.Add(documentId);             }              var id = 0;             _api.Bulk(bd => bd.IndexMany(expandos, (descriptor, s) => descriptor.Index(indexName).Id(ids[id++])));         }     } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>K6 &#8212; \u044d\u0442\u043e \u043c\u0435\u0433\u0430\u043a\u0440\u0443\u0442\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438!<\/h2>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/k6.io\/\" rel=\"noopener noreferrer nofollow\">K6<\/a>. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"https:\/\/k6.io\/blog\/k6-vs-jmeter\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 K6 \u0438 JMeter<\/a>.<\/p>\n<p>\u0428\u0438\u043a\u0430\u0440\u043d\u0435\u0439\u0448\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u0430 \u043d\u0430\u043c \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/getting-started\/installation\/\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/getting-started\/running-k6\/\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043f\u0443\u0441\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/javascript-api\/k6-http\/post\/\" rel=\"noopener noreferrer nofollow\">\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/javascript-api\/k6-http\/batch\/\" rel=\"noopener noreferrer nofollow\">\u0411\u0430\u0442\u0447\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/using-k6\/checks\/\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/blog\/how-to-generate-a-constant-request-rate-with-the-new-scenarios-api\/\" rel=\"noopener noreferrer nofollow\">\u0424\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/using-k6\/thresholds\/\" rel=\"noopener noreferrer nofollow\">\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/benc-uk\/k6-reporter\" rel=\"noopener noreferrer nofollow\">\u041e\u0442\u0447\u0435\u0442\u044b<\/a><\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0442\u043e\u0433\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043d\u0430\u043c \u043d\u0438\u0448\u0442\u044f\u043a\u0430\u043c\u0438 \u0443\u043b\u043e\u0436\u0438\u043b\u0441\u044f \u0432 200 \u0441\u0442\u0440\u043e\u0447\u0435\u043a.<\/p>\n<h2>\u041a\u0430\u043a \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f Elastic \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439<\/h2>\n<p>\u0423 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Elastic. \u0412 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u043a\u0430\u043a <a href=\"https:\/\/www.elastic.co\/guide\/en\/cloud\/current\/ec-vcpu-boost-instance.html\" rel=\"noopener noreferrer nofollow\">CPU Credits<\/a>. \u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 Elastic \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442, \u0442\u043e CPU Credits \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0443\u0445\u043e\u0434\u044f\u0442 \u0432 \u043d\u043e\u043b\u044c, \u0430 response time \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0435\u0437\u043a\u043e \u0440\u0430\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0443\u0431\u0438\u0440\u0430\u0435\u043c, \u0442\u043e CPU Credits \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b24\/71f\/5cc\/b2471f5cc96004be08989a7872a80332.png\" width=\"1192\" height=\"730\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b24\/71f\/5cc\/b2471f5cc96004be08989a7872a80332.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0422\u0417 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c 9.33 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443<\/p>\n<pre><code>maxRequestsPerUser = once in 5 minutes = 0.2 requests per minute totalNumberOfUsers * maxRequestsPerUser = 2800 * 0.2 = 560 requests per minute = 9.33 requests per second maxRequestsPerSecond = 9.33 requests\\s<\/code><\/pre>\n<p>15 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043d\u0430\u0448 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Elastic \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b <a href=\"https:\/\/ivanfdemo.blob.core.windows.net\/sprints\/15-per-second-k6.html\" rel=\"noopener noreferrer nofollow\">\u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c<\/a>. \u0410 \u0432\u043e\u0442 \u043d\u0430 20 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 &#8212; \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0443\u0436\u0435 <a href=\"https:\/\/ivanfdemo.blob.core.windows.net\/sprints\/20-per-second-failed-k6.html\" rel=\"noopener noreferrer nofollow\">\u0431\u0443\u0434\u0443\u0442<\/a> \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0437\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Elastic.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u043e<\/h2>\n<p>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0441\u0432\u043e\u0438\u043b\u0438 K6, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0434\u043b\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044f\u0445. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0412\u0441\u0435\u043c \u043c\u0438\u0440\u0430!<\/p>\n<h2>P.S. \u0415\u0449\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e K6 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043e\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/vk\/blog\/563446\/\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b \u043a\u043e\u0434 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430<\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/554266\/\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e<\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/675044\/\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Grafana K6 \u0432 CI\/CD<\/a><\/p>\n<\/p>\n<\/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\/post\/691108\/\"> https:\/\/habr.com\/ru\/post\/691108\/<\/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 article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0448\u0430\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0438\u0441\u043a\u0430, \u043a\u0430\u043a \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c K6 \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 Elastic Search \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439.<\/p>\n<p>\u0422\u0417: \u041d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438-\u0442\u0435\u043d\u0430\u043d\u0442 (multi-tenant) \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0438\u0441\u043a\u0430. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u043d\u0430\u043d\u0442\u0430 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0432 Elastic Search. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u043d\u0430\u043d\u0442\u043e\u0432 = 100. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0435\u043d\u0430\u043d\u0442\u0435 = 500 000. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 90 \u0442\u0435\u043d\u0430\u043d\u0442\u043e\u0432 \u043f\u043e 20 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 + 10 \u0442\u0435\u043d\u0430\u043d\u0442\u043e\u0432 \u043f\u043e 100 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0440\u0430\u0437 \u0432 5 \u043c\u0438\u043d\u0443\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c.<\/p>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0431\u044b\u043b\u0430 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445<\/p>\n<figure class=\"bordered full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0445\u0435\u043c\u0435 \u043f\u043e\u0434\u0445\u043e\u0434 &#171;\u0432 \u043b\u043e\u0431&#187; \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u0433\u0443\u0434 &#8212; \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u0438 \u0441\u0445\u0435\u043c\u0443<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0436\u0435 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 Elastic \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043b\u043e\u0433\u0438\u043a\u0443, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443.<\/p>\n<p><strong>\u041c\u0438\u043d\u0443\u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/strong>: \u0415\u0441\u043b\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 &#8212; \u0442\u043e \u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.  <\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 Elastic \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0443 50 000 000 \u0440\u0430\u0437, \u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0431\u044b\u0441\u0442\u0440\u044b\u043c. \u0414\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u0432\u0435 \u0444\u0438\u0448\u043a\u0438: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 Elastic \u0431\u0430\u0442\u0447\u0430\u043c\u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441. \u0417\u0430\u0442\u0435\u043c \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437. <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 50 000 000 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u043b\u0438 \u0437\u0430 1 \u043c\u0438\u043d\u0443\u0442\u0443.<\/p>\n<p>\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Elastic \u0447\u0435\u0440\u0435\u0437 NEST<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">using Nest; using System; using System.Collections.Generic; using System.Dynamic;  namespace ElasticApiClient {     public class NestClient     {         private readonly ElasticClient _api;         public NestClient(string url, string user, string password)         {             var connectionSettings = new ConnectionSettings(new Uri(url));             _api = new ElasticClient(connectionSettings);             connectionSettings.BasicAuthentication(                 user,                 password);         }          public void DeleteUnusedIndices()         {             var response = _api.Indices.GetAsync(new GetIndexRequest(Indices.All)).GetAwaiter().GetResult();                          foreach (var index in response.Indices)             {                 var indexName = index.Key;                 var countRequest = new CountRequest(Indices.Index(indexName));                 var numberOfDocuments = _api.CountAsync(countRequest).GetAwaiter().GetResult().Count;                 if (numberOfDocuments == 0)                 {                     _api.Indices.DeleteAsync(indexName).GetAwaiter().GetResult();                 }             }         }          public void CloneIndices(string sourceName, List&lt;string> targetNames)         {             _api.Indices.UpdateSettingsAsync(Indices.Index(sourceName), u => u                 .IndexSettings(i => i                     .Setting(\"index.blocks.write\", true)                 )             ).GetAwaiter().GetResult();              foreach (var targetName in targetNames)             {                 _api.Indices.CloneAsync(new CloneIndexRequest(sourceName, targetName)).GetAwaiter().GetResult();             }              _api.Indices.UpdateSettingsAsync(Indices.Index(sourceName), u => u                 .IndexSettings(i => i                     .Setting(\"index.blocks.write\", false)                 )             ).GetAwaiter().GetResult();         }          public void DeleteTestIndices(List&lt;string> testTenantIds)         {             var testIndexNames = new List&lt;string>();             foreach (var testTenantId in testTenantIds)             {                 testIndexNames.Add($\"{testTenantId}-documents\");             }                          var response = _api.Indices.GetAsync(new GetIndexRequest(Indices.All)).GetAwaiter().GetResult();                          foreach (var index in response.Indices)             {                 var indexName = index.Key;                 if (testIndexNames.Contains(indexName.Name))                 {                     _api.Indices.DeleteAsync(indexName).GetAwaiter().GetResult();                 }             }         }          public void IndexMany(List&lt;ExpandoObject> expandos, string indexName)         {             var ids = new List&lt;Guid>();             foreach (var expando in expandos)             {                 var byName = (IDictionary&lt;string, object>)expando;                 var documentId = (Guid)byName[\"documentId\"];                 ids.Add(documentId);             }              var id = 0;             _api.Bulk(bd => bd.IndexMany(expandos, (descriptor, s) => descriptor.Index(indexName).Id(ids[id++])));         }     } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>K6 &#8212; \u044d\u0442\u043e \u043c\u0435\u0433\u0430\u043a\u0440\u0443\u0442\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438!<\/h2>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/k6.io\/\" rel=\"noopener noreferrer nofollow\">K6<\/a>. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"https:\/\/k6.io\/blog\/k6-vs-jmeter\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 K6 \u0438 JMeter<\/a>.<\/p>\n<p>\u0428\u0438\u043a\u0430\u0440\u043d\u0435\u0439\u0448\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u0430 \u043d\u0430\u043c \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/getting-started\/installation\/\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/getting-started\/running-k6\/\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043f\u0443\u0441\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/javascript-api\/k6-http\/post\/\" rel=\"noopener noreferrer nofollow\">\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/javascript-api\/k6-http\/batch\/\" rel=\"noopener noreferrer nofollow\">\u0411\u0430\u0442\u0447\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/using-k6\/checks\/\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/blog\/how-to-generate-a-constant-request-rate-with-the-new-scenarios-api\/\" rel=\"noopener noreferrer nofollow\">\u0424\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/k6.io\/docs\/using-k6\/thresholds\/\" rel=\"noopener noreferrer nofollow\">\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/benc-uk\/k6-reporter\" rel=\"noopener noreferrer nofollow\">\u041e\u0442\u0447\u0435\u0442\u044b<\/a><\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0442\u043e\u0433\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043d\u0430\u043c \u043d\u0438\u0448\u0442\u044f\u043a\u0430\u043c\u0438 \u0443\u043b\u043e\u0436\u0438\u043b\u0441\u044f \u0432 200 \u0441\u0442\u0440\u043e\u0447\u0435\u043a.<\/p>\n<h2>\u041a\u0430\u043a \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f Elastic \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439<\/h2>\n<p>\u0423 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Elastic. \u0412 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u043a\u0430\u043a <a href=\"https:\/\/www.elastic.co\/guide\/en\/cloud\/current\/ec-vcpu-boost-instance.html\" rel=\"noopener noreferrer nofollow\">CPU Credits<\/a>. \u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 Elastic \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442, \u0442\u043e CPU Credits \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0443\u0445\u043e\u0434\u044f\u0442 \u0432 \u043d\u043e\u043b\u044c, \u0430 response time \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0435\u0437\u043a\u043e \u0440\u0430\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0443\u0431\u0438\u0440\u0430\u0435\u043c, \u0442\u043e CPU Credits \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0422\u0417 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c 9.33 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443<\/p>\n<pre><code>maxRequestsPerUser = once in 5 minutes = 0.2 requests per minute totalNumberOfUsers * maxRequestsPerUser = 2800 * 0.2 = 560 requests per minute = 9.33 requests per second maxRequestsPerSecond = 9.33 requests\\s<\/code><\/pre>\n<p>15 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043d\u0430\u0448 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Elastic \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b <a href=\"https:\/\/ivanfdemo.blob.core.windows.net\/sprints\/15-per-second-k6.html\" rel=\"noopener noreferrer nofollow\">\u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c<\/a>. \u0410 \u0432\u043e\u0442 \u043d\u0430 20 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 &#8212; \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0443\u0436\u0435 <a href=\"https:\/\/ivanfdemo.blob.core.windows.net\/sprints\/20-per-second-failed-k6.html\" rel=\"noopener noreferrer nofollow\">\u0431\u0443\u0434\u0443\u0442<\/a> \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0437\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Elastic.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u043e<\/h2>\n<p>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0441\u0432\u043e\u0438\u043b\u0438 K6, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0434\u043b\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044f\u0445. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0412\u0441\u0435\u043c \u043c\u0438\u0440\u0430!<\/p>\n<h2>P.S. \u0415\u0449\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e K6 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043e\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/vk\/blog\/563446\/\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b \u043a\u043e\u0434 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430<\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/554266\/\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e<\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/675044\/\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Grafana K6 \u0432 CI\/CD<\/a><\/p>\n<\/p>\n<\/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\/post\/691108\/\"> https:\/\/habr.com\/ru\/post\/691108\/<\/a><br \/><\/br><\/br><\/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-339232","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339232","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=339232"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339232\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}