{"id":315654,"date":"2020-12-28T09:01:19","date_gmt":"2020-12-28T09:01:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315654"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-12-28T09:01:19","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315654","title":{"rendered":"\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Node.JS"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e Node.JS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0448\u0435\u0433\u043e <a href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/516384\/\">\u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430<\/a> \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <a href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/487380\/\">\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043b\u043e\u0433\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 PostgreSQL<\/a>.  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6y\/lm\/82\/6ylm82ls0alocnpdwphcxqlun-q.jpeg\"><\/div>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0441 \u043e\u0434\u043d\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438, \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c.<br \/>  \u0420\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0441\u0431\u043e\u0440, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043b\u043e\u0433\u043e\u0432 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 PostgreSQL. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0431\u043e\u0440 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u2014 \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 IO-\u0437\u0430\u0434\u0430\u0447\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 nodejs \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0430. \u0410 \u0432\u043e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043f\u043b\u0430\u043d\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u2014 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e CPU-\u0435\u043c\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0430\u044f event-loop. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u0440\u043a\u0435\u0440 \u0438\u043b\u0438 \u043f\u0443\u043b \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043e\u0431\u043c\u0435\u043d\u0430 IPC-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438.  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ko\/_3\/wl\/ko_3wlisbcb-ev66l6cbdp54wmi.png\"><\/div>\n<p>  \u0420\u0430\u043d\u044c\u0448\u0435, \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043f\u043b\u0430\u043d\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u041d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2014 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e IPC \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043f\u043e IPC \u0431\u0443\u0444\u0435\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 &#8216;test&#8217; \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u0442\u0440\u043e\u043a\u0438:  <\/p>\n<pre><code class=\"javascript\">'{&quot;type&quot;:&quot;Buffer&quot;,&quot;data&quot;:[116,101,115,116]}'<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c\u0438:  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/el\/is\/ad\/elisad_qb5hdzcaqnpffjtzen2i.png\"><\/div>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043d\u0430\u0441 \u0441\u0442\u0430\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 worker_threads, \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0432 Node.JS 10.5.0, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 <a href=\"https:\/\/nodejs.org\/api\/worker_threads.html#worker_threads_port_postmessage_value_transferlist\">\u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438<\/a>.<br \/>  \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c:  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zy\/ig\/0p\/zyig0pthaqtipyhkew08k1m0vyw.png\"><\/div>\n<p>  \u0410 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0435\u0439 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043a \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 CPU \u0432\u043d\u0443\u0442\u0440\u0438 worker_thread \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<br \/>  \u0422.\u0435. \u0440\u0430\u043d\u044c\u0448\u0435, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430-\u0432\u043e\u0440\u043a\u0435\u0440\u0430, \u043c\u044b \u0438\u0437\u043c\u0435\u0440\u044f\u043b\u0438 CPU-usage \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>process.cpuUsage()<\/i> \u0438 <i>process.hrtime()<\/i> \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"javascript\"> let startCpuUsage = process.cpuUsage(); let startTime = process.hrtime(); let n = 1000; while (n--) Math.sin(n); let {user, system} = process.cpuUsage(startCpuUsage); \/\/ \u0432\u0440\u0435\u043c\u044f \u0432 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 let time = process.hrtime(startTime); \/\/ \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b let cpuUsage = 100 * 1000 * (user + system) \/ (time[0] * 1e9 + time[1]); <\/code><\/pre>\n<p>  \u041d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441 worker_threads \u0432\u044b\u0437\u043e\u0432 <i>process.cpuUsage()<\/i> \u0432\u044b\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044f \u0432\u0441\u0435 \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0438. \u0418 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c <i>process.cpuUsage()<\/i> \u0438\u0437\u043d\u0443\u0442\u0440\u0438 worker_thread.<br \/>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<br \/>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e \u0447\u0442\u043e <i>process.cpuUsage()<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 <a href=\"https:\/\/github.com\/nodejs\/node\/blob\/v15.4.0\/src\/node_process_methods.cc#L112\">uv_getrusage<\/a>, \u0430 \u0442\u043e\u0442 \u0432 \u041e\u0421 Linux \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <a href=\"https:\/\/github.com\/nodejs\/node\/blob\/v15.4.0\/deps\/uv\/src\/unix\/core.c#L973\">getrusage<\/a> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <a href=\"https:\/\/man7.org\/linux\/man-pages\/man2\/getrusage.2.html\">RUSAGE_SELF<\/a>, \u0442.\u0435. \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0434\u043b\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0443 \u043f\u043e \u0432\u0441\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430\u043c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u2014 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041a\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c CPU-usage \u0434\u043b\u044f worker_threads \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432 Node.JS \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f CPU worker_threrads?<br \/>  <a href=\"https:\/\/github.com\/nodejs\/node\/issues\/30061#issuecomment-545298800\">\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 worker_threads<\/a>.<br \/>  \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u2014 \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <i>gettid()<\/i> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c tid \u0434\u043b\u044f worker_thread \u0438 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \/proc\/${tid}, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <i>getrusage()<\/i> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c RUSAGE_THREAD, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430.<br \/>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f CPU \u0438 \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0432\u0441\u0435\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0438 worker_threads.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0441 \u044d\u0442\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043c\u044b \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 worker_threads, \u0438 \u043d\u0435 \u043d\u0430\u0448\u043b\u0438\u2026 \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 <a href=\"https:\/\/github.com\/MGorkov\/node-sysstat\/\"> \u0441\u0432\u043e\u0439 <\/a>, \u0437\u0430\u043e\u0434\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e \u0432\u044b\u0434\u0430\u0447\u0443 \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u0440\u0438\u043a \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 Node.JS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/328920\/\">\u0441\u0432\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u0430 \u043c\u0435\u0442\u0440\u0438\u043a <\/a>.<\/p>\n<h4>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 CPU<\/h4>\n<p>  \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f CPU \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043e\u0442 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u0438 worker_threads, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043e\u0431\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 CPU \u0438 \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u044f\u0434\u0435\u0440:<\/p>\n<ul>\n<li>\u0414\u043b\u044f \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u0432 \u0446\u0435\u043b\u043e\u043c:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/th\/3-\/6r\/th3-6rpfgwkihgqxndolnwg2fvy.png\"><\/div>\n<p>  <\/li>\n<li>\u0414\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/el\/fh\/_o\/elfh_oejgj4fx8gxuslx_smm060.png\"><\/div>\n<p>  <\/li>\n<li>\u0414\u043b\u044f worker_threads (\u043f\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0438\u0437 \u043f\u0443\u043b\u0430, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0438 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u0432\u043e\u0440\u043a\u0435\u0440\u0430):<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kv\/l6\/oy\/kvl6oy2h18wojsrk5o-yexih0eg.png\"><\/div>\n<p>  <\/li>\n<li>\u041e\u0431\u0449\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 CPU \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/95\/r5\/5p\/95r55pmrgte3dpp1j0rewpuqudg.png\"><\/div>\n<p>  <\/li>\n<\/ul>\n<p>  \u0421 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 CPU \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0430 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0438\u043d\u0433\u0430 worker_threads?<br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0435\u0441\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <i>node &#8212;prof<\/i>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> const { Worker, isMainThread} = require('worker_threads'); const crypto = require('crypto');  function mainTest() {   let cnt = 10000;   while (cnt--) crypto.randomBytes(cnt); }  function threadTest() {   let cnt = 10000;   while (cnt--) crypto.randomBytes(cnt); }  if (isMainThread) {   let worker = new Worker(__filename);   setInterval(mainTest, 1000); } else {   setInterval(threadTest, 1000); } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u0432\u0430 isolate-* \u0444\u0430\u0439\u043b\u0430, \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0438 \u0434\u043b\u044f worker_thread.<br \/>  \u0414\u0430\u043b\u0435\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>node &#8212;prof-process &lt;isolate_file&gt;<\/i> \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0430\u0439\u043b.<br \/>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 &#8212;no-logfile-per-isolate \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 isolate* \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u2014 v8.log \u0441 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u043e\u0442\u043e\u043a\u0430\u043c, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439.<\/p>\n<p>  \u0418 \u0435\u0449\u0435 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u043f\u0446\u0438\u044e <i>node &#8212;inspect<\/i> \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0430\u0432 \u0441\u0438\u0433\u043d\u0430\u043b SIGUSR1 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0441 \u0446\u0435\u043b\u044c\u044e \u0441\u043d\u044f\u0442\u044c CPU \u043f\u0440\u043e\u0444\u0430\u0439\u043b \u0432 Chrome DevTools, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/h4>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0434\u043b\u044f CPU, \u0441\u043d\u0438\u043c\u0430\u044f \u043f\u0440\u043e\u0444\u0430\u0439\u043b \u0432 Chrome DevTools \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c Heap snapshot \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430.<br \/>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 node 12.17.0 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c heap snapshot \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0434\u0430 worker_threads \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 <a href=\"https:\/\/nodejs.org\/docs\/latest-v12.x\/api\/worker_threads.html#worker_threads_worker_getheapsnapshot\">worker.getHeapSnapshot()<\/a>, \u0430 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 11.13.0 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u043c <a href=\"https:\/\/nodejs.org\/docs\/latest-v12.x\/api\/v8.html#v8_v8_getheapsnapshot\">v8.getHeapSnapshot()<\/a><\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> const { Worker, isMainThread } = require('worker_threads'); const v8 = require('v8'); const fs = require('fs');  if (isMainThread) {   let worker = new Worker(__filename);   let mainArray = [];   function mainTest() {     let cnt = 100;     while (cnt--) mainArray.push(`main-msg-${cnt}`);   }   process.on('SIGUSR2', () =&gt; {     v8.getHeapSnapshot().pipe(fs.createWriteStream(`process_${process.pid}.heapsnapshot`));     worker.getHeapSnapshot().then((heapsnapshot) =&gt; {       heapsnapshot.pipe(fs.createWriteStream(`process_${process.pid}_wt_${worker.threadId}.heapsnapshot`));     })   });   setInterval(mainTest, 1000); } else {   let threadArray = [];   function threadTest() {     let cnt = 100;     while (cnt--) threadArray.push(`thread-msg-${cnt}`);   }   setInterval(threadTest, 1000); } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041f\u043e\u0441\u043b\u0430\u0432 \u0441\u0438\u0433\u043d\u0430\u043b <i>SIGUSR2<\/i> \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0432\u0430 heapsnapshot, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 Chrome DevTools:<\/p>\n<ul>\n<li>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5c\/jw\/v9\/5cjwv9wtoqx2m_7iqfxhcuxtaz0.png\"><\/div>\n<p>  <\/li>\n<li>worker_thread:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/es\/l7\/ld\/esl7ld5arreo0mfhisoaauanjia.png\"><\/div>\n<p>  <\/li>\n<\/ul>\n<p>  \u041a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430?<br \/>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0435, \u0447\u0442\u043e \u0432\u044b\u0434\u0430\u0435\u0442 <a href=\"https:\/\/nodejs.org\/docs\/latest-v12.x\/api\/process.html#process_process_memoryusage\">process.memoryUsage()<\/a> \u2014 rss, heapTotal, heapUsed, external.<br \/>  \u0418 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/nodejs.org\/docs\/latest-v12.x\/api\/process.html#process_process_memoryusage\">v8.getHeapSpaceStatistics()<\/a>, \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u043c Heap \u2014 new_space, old_space, code_space, large_object_space.<br \/>  rss \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u2014 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<ul>\n<li>\u0421\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043f\u043e \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nf\/jg\/hg\/nfjghgwjyotebiapsmjrr4bxaf8.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u043e \u0432\u043e\u0440\u043a\u0435\u0440\u0443:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bq\/ea\/dx\/bqeadxregjymv-qmq59owjq5c9c.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u043e worker_threads:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gi\/p_\/t6\/gip_t6i8wwim-pi1y1argmavkvc.png\"><\/div>\n<p>  <\/li>\n<\/ul>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430<\/h4>\n<p>  \u0422.\u043a. \u0432 \u043a\u0430\u0436\u0434\u043e\u043c worker_thread \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Node.JS \u0441 v8\/libuv, \u0442\u043e \u0438 GC \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u0436\u0435 \u0441\u0432\u043e\u0439 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0438\u0445 \u043d\u0430\u0434\u043e \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<br \/>  \u0414\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 GC \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u043e\u0431\u0449\u0435\u0439 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0443\u0441\u043e\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432 \u0438 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430.<br \/>  \u0423\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e, \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 8.5.0, \u0432 Node.JS \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <a href=\"https:\/\/nodejs.org\/docs\/latest-v12.x\/api\/perf_hooks.html#perf_hooks_class_perf_hooks_performanceobserver\">PerformanceObserver<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u0440\u043e\u043c\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0446\u0438\u043a\u043b\u0430\u043c GC.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> const { PerformanceObserver, constants } = require('perf_hooks'); let stats = {}; let gcObserver = new PerformanceObserver((list) =&gt; {   list     .getEntries()     .map(({kind, duration}) =&gt; {       stats['gc.time'] += duration;       switch (kind) {         case constants.NODE_PERFORMANCE_GC_MINOR:           stats['gc.Scavenge.count']++;           stats['gc.Scavenge.time'] += duration;           break;         case constants.NODE_PERFORMANCE_GC_MAJOR:           stats['gc.MarkSweepCompact.count']++;           stats['gc.MarkSweepCompact.time'] += duration;           break;         case constants.NODE_PERFORMANCE_GC_INCREMENTAL:           stats['gc.IncrementalMarking.count']++;           stats['gc.IncrementalMarking.time'] += duration;           break;         case constants.NODE_PERFORMANCE_GC_WEAKCB:           stats['gc.ProcessWeakCallbacks.count']++;           stats['gc.ProcessWeakCallbacks.time'] += duration;           break;       }     }) });  function resetStats() {   Object.assign(stats, {     'gc.time': 0,     'gc.Scavenge.count': 0,     'gc.Scavenge.time': 0,     'gc.MarkSweepCompact.count': 0,     'gc.MarkSweepCompact.time': 0,     'gc.IncrementalMarking.count': 0,     'gc.IncrementalMarking.time': 0,     'gc.ProcessWeakCallbacks.count': 0,     'gc.ProcessWeakCallbacks.time': 0,   }); }  resetStats(); gcObserver.observe({entryTypes: ['gc'], buffered: true});  function triggerScavenge() {   let arr = [];   for (let i = 0; i &lt; 5000; i++) {     arr.push({});   }    setTimeout(triggerScavenge, 50); }  let ds = [];  function triggerMarkCompact() {   for (let i = 0; i &lt; 10000; i++) {     ds.push(new ArrayBuffer(1024));   }    if (ds.length &gt; 40000) {     ds = [];   }    setTimeout(triggerMarkCompact, 200); }  triggerScavenge(); triggerMarkCompact();  setInterval(() =&gt; {   console.log(stats);   resetStats(); }, 5000); <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"javascript\"> {   'gc.time': 158.716144,   'gc.Scavenge.count': 11,   'gc.Scavenge.time': 135.690545,   'gc.MarkSweepCompact.count': 2,   'gc.MarkSweepCompact.time': 22.96941,   'gc.IncrementalMarking.count': 2,   'gc.IncrementalMarking.time': 0.056189,   'gc.ProcessWeakCallbacks.count': 0,   'gc.ProcessWeakCallbacks.time': 0 } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0442\u0430\u043a \u0438 \u0432 worker_threads, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0441 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443:  <\/p>\n<ul>\n<li>\u041f\u043e \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/le\/zg\/vl\/lezgvlwvf6geit2yigh99rd0er4.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u043e worker_threads<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/su\/ls\/zl\/sulszlxxdwb4t9f_bke8nkelcgm.png\"><\/div>\n<p>  <\/li>\n<li>\u041e\u0431\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f GC \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yy\/js\/gq\/yyjsgqcyvc37djbzofbshwrkpgc.png\"><\/div>\n<p>  <\/li>\n<li>\u041e\u0431\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f GC \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 worker_threads<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8c\/vx\/gv\/8cvxgvq3nhiyptvfqrq1wk86nja.png\"><\/div>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h4>Event-loop latency<\/h4>\n<p>  \u0414\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a event-loop \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 11.10.0 <a href=\"https:\/\/nodejs.org\/docs\/latest-v12.x\/api\/perf_hooks.html#perf_hooks_perf_hooks_monitoreventloopdelay_options\">monitorEventLoopDelay<\/a> \u2014 \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0438 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438.<br \/>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c max, min, mean, \u0438 percentile(99):  <\/p>\n<ul>\n<li>\u0421\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yz\/a9\/af\/yza9af9ycpzlanz8tk18120zxo8.png\"><\/div>\n<p>  <\/li>\n<li>\u0421\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043f\u043e worker_threads<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ak\/xx\/4s\/akxx4swncxyuyjwxqrmbhqmu9m4.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u043e \u0432\u043e\u0440\u043a\u0435\u0440\u0443<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/i3\/ea\/ea\/i3eaeaifvdfkdzfqmwkr-cl3j2e.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u043e worker_thread<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/md\/d0\/ia\/mdd0ia7z8cvouqpbdeuls-l7uis.png\"><\/div>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0443\u043b\u0430 worker_threads<\/h4>\n<p>  \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0443\u043b\u0430 \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432\u044b\u0448\u0435, \u0430 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/>  \u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u043e\u0440\u043a\u0435\u0440 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0443\u043b \u0441 \u043e\u0434\u043d\u0438\u043c worker_thread, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0445 \u043f\u043b\u0430\u043d\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<br \/>  \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 worker_thread \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u043f\u0440\u0438 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0434\u043e\u043b\u044c\u0448\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0437\u0430\u0434\u0430\u0447<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">   const SPAWN_LAG = 2000;   this._queue = [];    assignTask(msg) {     if (this.mainExplainer.ready === true) {       this.mainExplainer.ready = false;       this.mainExplainer.sendMessage(msg);     } else if (this._idleExplainers.length &gt; 0) {       let explainer = this._idleExplainers.pop();       clearTimeout(explainer.timeoutIdle);       explainer.sendMessage(msg);     } else {       this._checkAndStartNew(msg);     }   }    _checkAndStartNew(msg) {     let ts = Date.now();     let q = this._queue;     if (msg &amp;&amp; process[hasFreeRAM]) q.push({msg, ts});     if (this._canCreateExplainer &amp;&amp; q.length &gt; this._workersCnt() &amp;&amp; q[0].ts + SPAWN_LAG &lt; ts) {       this._createExplainer();     }   }    explainer.on('explainDone', (msg) =&gt; {     explainer.pulse();   });    explainer.pulse = () =&gt; {     if (this._queue.length &gt; explainer.id) {       explainer.sendMessage(this._queue.shift().msg);     } else if (this._isMain(explainer)) {       explainer.ready = true;     } else {       this._idleExplainers.push(explainer);       explainer.unpool();     }   };  <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412\u0430\u0436\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 \u043f\u0443\u043b\u0430 worker_thread \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432:  <\/p>\n<ul>\n<li>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/43\/hc\/zw\/43hczwdy4f8i7w7htxxhyjmtw14.png\"><\/div>\n<p>  <\/li>\n<\/ul>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c worker_thread \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u0432 \u0446\u0435\u043b\u043e\u043c:  <\/p>\n<ul>\n<li>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043b\u0430\u043d\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tz\/rc\/ep\/tzrcep7nc5iigykrgh6xdrju7vm.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0437\u0430\u0434\u0430\u0447:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6b\/_j\/cr\/6b_jcrs0uvvavplwpbrlpznm6hc.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ox\/8s\/bz\/ox8sbzec13blfexnd4bqeiekaga.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c worker_thread \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0437\u0430\u0434\u0430\u0447:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p1\/9s\/yo\/p19syojn-sywmph-6lqrbv7ane8.png\"><\/div>\n<p>  <\/li>\n<li>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c worker_thread \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<br \/> \n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/k9\/lv\/jp\/k9lvjp6pciqhhlqw8lr08n_gkdc.png\"><\/div>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Node.JS.<br \/>  \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u2014 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Application_performance_management\">APM<\/a>.<\/div>\n<p> \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\/tensor\/blog\/533738\/\"> https:\/\/habr.com\/ru\/company\/tensor\/blog\/533738\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e Node.JS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0448\u0435\u0433\u043e <a href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/516384\/\">\u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430<\/a> \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <a href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/487380\/\">\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043b\u043e\u0433\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 PostgreSQL<\/a>.  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6y\/lm\/82\/6ylm82ls0alocnpdwphcxqlun-q.jpeg\"><\/div>\n<p>  <\/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-315654","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315654","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=315654"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315654\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}