{"id":288583,"date":"2018-08-27T17:00:02","date_gmt":"2018-08-27T13:00:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=288583"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=288583","title":{"rendered":"LAppS: \u041f\u043e\u043b \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 1KB-WebSocket \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0441 TLS \u043d\u0430 \u043e\u0434\u043d\u043e\u043c CPU"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/421421\/\" class=\"post__text post__text-html js-mediator-article\">\n<p>\u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u0443\u0440\u0441\u0435: <a href=\"https:\/\/github.com\/ITpC\/LAppS\">LAppS \u2014 Lua Application Server<\/a>, \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u043a nginx \u0438\u043b\u0438 apache, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f WebSocket \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0432\u043c\u0435\u0441\u0442\u043e HTTP. <\/p>\n<p>  <\/p>\n<p>HTTP \u0432 \u043d\u0451\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Upgrade \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>  <\/p>\n<p>LAppS \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u0430\u0447\u0438\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0434\u043e\u0441\u0442\u0438\u0433 \u043f\u0438\u043a\u0430 \u0441\u0432\u043e\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u043c\u043e\u0451\u043c \u0436\u0435\u043b\u0435\u0437\u0435 (\u043d\u0443 \u043f\u043e\u0447\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043b\u0433\u0438\u0439 \u0438 \u0443\u043f\u043e\u0440\u043d\u044b\u0439 \u0442\u0440\u0443\u0434).<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, LAppS \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 WebSocket \u0441\u0442\u0435\u043a\u0430, \u043f\u0440\u0435\u0432\u0437\u043e\u0448\u0451\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 uWebSockets, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u043c\u0430\u044f \u0431\u044b\u0441\u0442\u0440\u0430\u044f WebSocket \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0421 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043c\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e <strong>LAppS<\/strong> \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0436\u0435 \u043f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u043b\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439. LAppS \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0432\u0435\u0440\u0441\u0438\u0438 0.7.0, \u043e\u0431\u0440\u043e\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c \u0438 \u0432\u044b\u0440\u043e\u0441 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u0447\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u043e\u0431\u0435\u0449\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435). <\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0444\u0438\u0447: \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 WebSocket, \u2014 cws.<\/p>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e, \u044f \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0441\u043c\u043e\u0433 \u0432\u044b\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0437\u0436\u043d\u043e\u0435 \u0438\u0437 \u043c\u043e\u0435\u0433\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0430, \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c LAppS \u043f\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e echo \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 websocketpp (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 github \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u0430\u043b\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f, \u0442\u0430\u043a \u0435\u0449\u0451 \u0438 \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0443\u0435\u043c\u0430\u044f. \u0422\u0435\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u0430\u0447\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0442 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e awk \u0438 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430 \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u044b\u043b\u0438 \u0442\u0430\u043a\u0438\u043c\u0438:<\/p>\n<p>  <\/p>\n<table>\n<thead>\n<tr>\n<th>\u0421\u0435\u0440\u0432\u0435\u0440<\/th>\n<th>\u041a\u043e\u043b-\u0432\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432<\/th>\n<th>RPS \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/th>\n<th>RPS \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/th>\n<th>payload (bytes)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>LAppS 0.7.0<\/td>\n<td>240<\/td>\n<td>84997<\/td>\n<td>354.154<\/td>\n<td>128<\/td>\n<\/tr>\n<tr>\n<td>uWebSockets (latest)<\/td>\n<td>240<\/td>\n<td>74172.7<\/td>\n<td>309.053<\/td>\n<td>128<\/td>\n<\/tr>\n<tr>\n<td>LAppS 0.7.0<\/td>\n<td>240<\/td>\n<td>83627.4<\/td>\n<td>348.447<\/td>\n<td>512<\/td>\n<\/tr>\n<tr>\n<td>uWebSockets (latest)<\/td>\n<td>240<\/td>\n<td>71024.4<\/td>\n<td>295.935<\/td>\n<td>512<\/td>\n<\/tr>\n<tr>\n<td>LAppS 0.7.0<\/td>\n<td>240<\/td>\n<td>79270.1<\/td>\n<td>330.292<\/td>\n<td>1024<\/td>\n<\/tr>\n<tr>\n<td>uWebSockets (latest)<\/td>\n<td>240<\/td>\n<td>66499.8<\/td>\n<td>277.083<\/td>\n<td>1024<\/td>\n<\/tr>\n<tr>\n<td>LAppS 0.7.0<\/td>\n<td>240<\/td>\n<td>51621<\/td>\n<td>215.087<\/td>\n<td>8192<\/td>\n<\/tr>\n<tr>\n<td>uWebSockets (latest)<\/td>\n<td>240<\/td>\n<td>45341.6<\/td>\n<td>188.924<\/td>\n<td>8192<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043a\u0430\u043a \u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0430 \u0441\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0434\u0432\u043e\u0435 \u0432\u044b\u0448\u0435, \u0442.\u043a. \u0437\u0430\u043c\u0435\u0440 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 on_message \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 on_message \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0442\u043e\u0433\u043e-\u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0422.\u0435. \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u0438 \u0435\u0441\u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 RPS \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u043d\u0430 payload \u0438 \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0433\u0430\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 240 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0441\u0430\u043c\u043e\u043c\u0443 LAppS-\u0443 (\u043a\u0430\u043a \u0438 uWebSockets) \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0426\u041f\u0423.<\/p>\n<p>  <\/p>\n<p>\u042f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0434\u043b\u044f WebSocket \u043f\u043e\u0434 Lua, \u0438 \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e, \u044f-\u0431\u044b \u043c\u043e\u0433 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c LAppS. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0438\u043c\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u0433\u043e <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/WebSockets_API\">WebSocket API<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c (\u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0434\u0435\u043b\u043e\u043a \u0441 BitMEX):<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">bitmex={} bitmex.__index=bitmex  bitmex.init=function() end  - bitmex.run=function() -- \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a BitMEX local websocket,errmsg=cws:new(   \"wss:\/\/www.bitmex.com\/realtime\",   {     [\"onopen\"]=function(handler)     -- \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f WebSocket \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441        local result, errstr=cws:send(handler,[[{\"op\": \"subscribe\", \"args\": [\"orderBookL2:XBTUSD\"]}]],1);       -- \u0422\u0438\u043f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f 1 (OpCode 1 - \u0422\u0415\u0425\u0422)       if(not result) -- \u0435\u0441\u043b\u0438 \u043e\u0442\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439, - \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c       then         print(\"Error on websocket send at handler \"..handler..\": \"..errstr);       end     end,     [\"onmessage\"]=function(handler,message,opcode)       print(message) -- \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f BitMEX \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u043c\u0443 \u0442\u043e\u043f\u0438\u043a\u0443.     end,     [\"onerror\"]=function(handler, message) -- \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f       print(message..\". Socket FD:  \"..handler);     end,     [\"onclose\"]=function(handler) -- \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u043e\u043a\u0435\u0442\u0430       print(\"WebSocket \"..handler..\" is closed by peer.\");     end   });    if(websocket == nil) -- \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f   then    print(errmsg)   else     while not must_stop()     do       cws:eventLoop(); -- poll \u0441\u043e\u0431\u044b\u0442\u0438\u0439     end   end end  return bitmex;<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u044e, \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0438 \u043e\u043d \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f LAppS \u0438 \u043d\u0430\u0437\u0432\u0430\u043b \u0435\u0433\u043e \u0442\u0430\u043a-\u0436\u0435 \u043d\u0435\u0437\u0430\u0442\u0435\u0439\u043b\u0438\u0432\u043e <a href=\"https:\/\/github.com\/ITpC\/LAppS\/blob\/master\/apps\/benchmark\/benchmark.lua\">benchmark<\/a>.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 100 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a \u044d\u0445\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0443 WebSocket (\u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u043a\u0430\u043a\u043e\u043c\u0443), \u0438 \u043f\u0440\u0438 \u0443\u0434\u0430\u0447\u043d\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 1\u043a\u0431 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u041f\u0440\u0438 \u043f\u0440\u0438\u0451\u043c\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430\u0437\u0430\u0434. <\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u043a\u043e\u043c\u043f: Intel\u00ae Core(TM) i7-7700 CPU @ 3.60GHz, microcode 0x5e<br \/>  \u041f\u0430\u043c\u044f\u0442\u044c: DIMM DDR4 Synchronous Unbuffered (Unregistered) 2400 MHz (0,4 ns), Kingston KHX2400C15\/16G<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0451 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043b\u043e\u043a\u0430\u043b\u0445\u043e\u0441\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f <a href=\"https:\/\/github.com\/ITpC\/LAppS\/blob\/master\/examples\/echo\/echo.lua\">\u044d\u0445\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a> \u0432 LAppS:<\/p>\n<p>  <\/p>\n<pre><code>  \"echo\": {       \"auto_start\": true,       \"instances\": 2,       \"internal\": false,       \"max_inbound_message_size\": 16777216,       \"preload\": null,       \"protocol\": \"raw\",       \"request_target\": \"\/echo\"     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 instances \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442 LAppS \u0441\u0442\u0430\u0440\u0442\u0430 \u0434\u0432\u0443\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u0445\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 (\u043a\u043b\u0438\u0435\u043d\u0442\u0430):<\/p>\n<p>  <\/p>\n<pre><code>  \"benchmark\" : {     \"auto_start\" : true,     \"instances\": 4,     \"internal\": true,     \"preload\" : [ \"cws\", \"time\" ]   }<\/code><\/pre>\n<p>  <\/p>\n<p>T.e. \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f 4 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430-\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430<\/p>\n<p>  <\/p>\n<h2 id=\"rezultat-s-vklyuchennym-tls\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c TLS<\/h2>\n<p>  <\/p>\n<table>\n<thead>\n<tr>\n<th>\u0421\u0435\u0440\u0432\u0435\u0440<\/th>\n<th>\u041a\u043e\u043b-\u0432\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432<\/th>\n<th>RPS \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/th>\n<th>RPS \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/th>\n<th>payload (bytes)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>LAppS 0.7.0-Upstream<\/td>\n<td>400<\/td>\n<td><strong>257828<\/strong><\/td>\n<td>644.57<\/td>\n<td>1024<\/td>\n<\/tr>\n<tr>\n<td>nginx &amp;lua-resty-websocket 4 workers<\/td>\n<td>400<\/td>\n<td><strong>33788<\/strong><\/td>\n<td>84.47<\/td>\n<td>1024<\/td>\n<\/tr>\n<tr>\n<td>websocketpp<\/td>\n<td>400<\/td>\n<td><strong>9789.52<\/strong><\/td>\n<td>24.47<\/td>\n<td>1024<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/p>\n<p>uWebSockets \u043e\u0442\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u2014 TLS handshake \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 SSLv3 (\u043c\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 TLSv1.2 \u0438 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u043c \u043c\u043d\u043e\u0439 libreSSL SSLv3 \u0432\u044b\u0440\u0435\u0437\u0430\u043d).<\/p>\n<p>  <\/p>\n<h2 id=\"rezultat-bez-tls\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0435\u0437 TLS<\/h2>\n<p>  <\/p>\n<table>\n<thead>\n<tr>\n<th>\u0421\u0435\u0440\u0432\u0435\u0440<\/th>\n<th>\u041a\u043e\u043b-\u0432\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432<\/th>\n<th>RPS \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/th>\n<th>RPS \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/th>\n<th>payload (bytes)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>LAppS 0.7.0-upstream<\/td>\n<td>400<\/td>\n<td><strong>439700<\/strong><\/td>\n<td>1099.25<\/td>\n<td>1024<\/td>\n<\/tr>\n<tr>\n<td>uWebSockets-upstream<\/td>\n<td>400<\/td>\n<td><strong>247549<\/strong><\/td>\n<td>618.87<\/td>\n<td>1024<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 &#171;\u043f\u043e\u043b\u043c\u0438\u043b\u0438\u043e\u043d\u0430&#187; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0430 \u0432 \u0442\u0435\u0441\u0442\u0435 257828? \u041f\u043e\u0442\u043e\u043c\u0443-\u0447\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432\u0434\u0432\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 (\u043a\u0430\u043a \u0438 \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0435\u043d\u043e \u0432\u044b\u0448\u0435).<\/p>\n<p>  <\/p>\n<p>uWebsockets, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0434\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 1-\u043c \u044f\u0434\u0440\u0435, \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f uWebSockets \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 TLS \u0438\u043c\u0435\u0435\u0442 data-race \u0432 OpenSSL \u0441\u0442\u044d\u043a\u0435.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e uWebSockets \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 2-\u0445 \u044f\u0434\u0440\u0430\u0445 (\u043a\u0430\u043a 2 \u044d\u0445\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 LAppS), \u0442\u043e \u0435\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0447\u0435\u0441\u0442\u044c 495098 RPS (\u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0432\u043e\u0438\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b). <\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0445\u043e \u0441\u0435\u0440\u0432\u0435\u0440 (uWebSockets)(<a href=\"https:\/\/github.com\/ITpC\/LAppS\/blob\/master\/benchmark\/uWS\/uWS.cpp\">https:\/\/github.com\/ITpC\/LAppS\/blob\/master\/benchmark\/uWS\/uWS.cpp<\/a>) \u043d\u0438\u0447\u0435\u0433\u043e \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442, \u0430 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0437\u0430\u0434. LAppS-\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Lua \u0441\u0442\u0435\u043a, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443.<\/p>\n<p>  <\/p>\n<h1 id=\"chto-eschyo-novogo-poyavilos-v-lapps\">\u0427\u0442\u043e \u0435\u0449\u0451 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432 LAppS<\/h1>\n<p>  <\/p>\n<ul>\n<li>\u041c\u043e\u0434\u0443\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0447-\u0437 PAM: pam_auth<\/li>\n<li>\u041c\u043e\u0434\u0443\u043b\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439: mqr \u2014 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 LAppS (\u0434\u043b\u044f \u043c\u0443\u043b\u0442\u0438\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043e\u0431\u043c\u0435\u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e-\u0442\u043e \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: RabbitMQ, mosquitto, etc)<\/li>\n<li>ACL \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/ITpC\/LAppS\/wiki\">wiki<\/a> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430 \u0437\u0430\u043a\u0443\u0441\u043a\u0443, \u0434\u043b\u044f \u0446\u0435\u043d\u0438\u0442\u0435\u043b\u0435\u0439, \u0447\u0435\u043c \u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e LAppS \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0411\u0435\u0437 TLS<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u043b\u0438\u0434\u0435\u0440 iptables.      4.98%  lapps    [ip_tables]             [k] ipt_do_table  \u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432      3.80%  lapps    [kernel.vmlinux]        [.] syscall_return_via_sysret  \u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438 Lua \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438      3.52%  lapps    libluajit-5.1.so.2.0.5  [.] lj_str_new  \u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 WebSocket \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c      1.96%  lapps    lapps                   [.] WSStreamProcessing::WSStreamServerParser::parse  \u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u0430\u043c      1.88%  lapps    [kernel.vmlinux]        [k] copy_user_enhanced_fast_string      1.81%  lapps    [kernel.vmlinux]        [k] __fget      1.61%  lapps    [kernel.vmlinux]        [k] tcp_ack      1.49%  lapps    [kernel.vmlinux]        [k] _raw_spin_lock_irqsave      1.48%  lapps    [kernel.vmlinux]        [k] sys_epoll_ctl      1.45%  lapps    [xt_tcpudp]             [k] tcp_mt  \u0412\u043e\u0440\u043a\u0435\u0440\u044b LAppS      1.35%  lapps    lapps                   [.] LAppS::IOWorker&lt;false, true&gt;::execute  \u041a\u043b\u0438\u0435\u043d\u0442 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430      1.28%  lapps    lapps                   [.] cws_eventloop ...      1.27%  lapps    [nf_conntrack]          [k] __nf_conntrack_find_get.isra.11      1.14%  lapps    [kernel.vmlinux]        [k] __inet_lookup_established      1.14%  lapps    libluajit-5.1.so.2.0.5  [.] lj_BC_TGETS  \u042d\u0445\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0432\u0437\u0433\u043b\u044f\u0434 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b C++      1.01%  lapps    lapps                   [.] LAppS::Application&lt;false, true, (abstract::Application::Protocol)0&gt;::execute  ...      0.98%  lapps    [kernel.vmlinux]        [k] ep_send_events_proc      0.98%  lapps    [kernel.vmlinux]        [k] tcp_recvmsg      0.96%  lapps    libc-2.26.so            [.] __memmove_avx_unaligned_erms      0.93%  lapps    libc-2.26.so            [.] malloc      0.92%  lapps    [kernel.vmlinux]        [k] tcp_transmit_skb      0.88%  lapps    [kernel.vmlinux]        [k] sock_poll      0.85%  lapps    [nf_conntrack]          [k] nf_conntrack_in      0.83%  lapps    [nf_conntrack]          [k] tcp_packet      0.79%  lapps    [kernel.vmlinux]        [k] do_syscall_64      0.78%  lapps    [kernel.vmlinux]        [k] ___slab_alloc      0.78%  lapps    [kernel.vmlinux]        [k] _raw_spin_lock_bh      0.73%  lapps    libc-2.26.so            [.] _int_free      0.69%  lapps    [kernel.vmlinux]        [k] __slab_free      0.66%  lapps    libcryptopp.so.5.6.5    [.] CryptoPP::Rijndael::Base::UncheckedSetKey      0.66%  lapps    [kernel.vmlinux]        [k] tcp_write_xmit      0.65%  lapps    [kernel.vmlinux]        [k] sock_def_readable      0.65%  lapps    [kernel.vmlinux]        [k] tcp_sendmsg_locked      0.64%  lapps    libc-2.26.so            [.] vfprintf  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c (\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c - bemchmark)      0.64%  lapps    lapps                   [.] LAppS::ClientWebSocket::send ...      0.64%  lapps    [kernel.vmlinux]        [k] tcp_v4_rcv      0.63%  lapps    [kernel.vmlinux]        [k] __alloc_skb      0.61%  lapps    lapps                   [.] std::_Sp_counted_base&lt;(__gnu_cxx::_Lock_policy)2&gt;::_M_release      0.61%  lapps    [kernel.vmlinux]        [k] _raw_spin_lock      0.60%  lapps    libc-2.26.so            [.] __memset_avx2_unaligned_erms      0.60%  lapps    [kernel.vmlinux]        [k] kmem_cache_alloc_node      0.59%  lapps    libluajit-5.1.so.2.0.5  [.] lj_tab_get      0.59%  lapps    [kernel.vmlinux]        [k] __local_bh_enable_ip      0.58%  lapps    [kernel.vmlinux]        [k] __dev_queue_xmit      0.57%  lapps    [kernel.vmlinux]        [k] nf_hook_slow      0.55%  lapps    [kernel.vmlinux]        [k] ep_poll_callback      0.55%  lapps    [kernel.vmlinux]        [k] skb_release_data      0.54%  lapps    [kernel.vmlinux]        [k] native_queued_spin_lock_slowpath      0.54%  lapps    libc-2.26.so            [.] cfree@GLIBC_2.2.5      0.53%  lapps    [kernel.vmlinux]        [k] ip_finish_output2      0.49%  lapps    libluajit-5.1.so.2.0.5  [.] lj_BC_RET      0.49%  lapps    libc-2.26.so            [.] __strlen_avx2      0.48%  lapps    [kernel.vmlinux]        [k] _raw_spin_unlock_irqrestore<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0421 \u043d\u0430\u0439\u0434\u0451\u043c 10 \u043e\u0442\u043b\u0438\u0447\u0438\u0439 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 TLS<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>    3.73%  lapps    [kernel.vmlinux]        [k] syscall_return_via_sysret      3.49%  lapps    libcrypto.so.43.0.1     [.] gcm_ghash_clmul      3.42%  lapps    libcrypto.so.43.0.1     [.] aesni_ctr32_encrypt_blocks      2.74%  lapps    [ip_tables]             [k] ipt_do_table      2.17%  lapps    libluajit-5.1.so.2.0.5  [.] lj_str_new      1.41%  lapps    libpthread-2.26.so      [.] __pthread_mutex_lock      1.34%  lapps    libssl.so.45.0.1        [.] tls1_enc      1.32%  lapps    [kernel.vmlinux]        [k] __fget      1.16%  lapps    libcrypto.so.43.0.1     [.] getrn      1.06%  lapps    libc-2.26.so            [.] __memmove_avx_unaligned_erms      1.06%  lapps    lapps                   [.] WSStreamProcessing::WSStreamServerParser::parse      1.05%  lapps    [kernel.vmlinux]        [k] tcp_ack      1.02%  lapps    [kernel.vmlinux]        [k] copy_user_enhanced_fast_string      1.02%  lapps    [nf_conntrack]          [k] __nf_conntrack_find_get.isra.11      0.98%  lapps    lapps                   [.] cws_eventloop      0.98%  lapps    [kernel.vmlinux]        [k] native_queued_spin_lock_slowpath      0.93%  lapps    libcrypto.so.43.0.1     [.] aead_aes_gcm_open      0.92%  lapps    lapps                   [.] LAppS::IOWorker&lt;true, true&gt;::execute      0.91%  lapps    [kernel.vmlinux]        [k] tcp_recvmsg      0.89%  lapps    [kernel.vmlinux]        [k] sys_epoll_ctl      0.88%  lapps    libcrypto.so.43.0.1     [.] aead_aes_gcm_seal      0.84%  lapps    [kernel.vmlinux]        [k] do_syscall_64      0.82%  lapps    [kernel.vmlinux]        [k] __inet_lookup_established      0.82%  lapps    [kernel.vmlinux]        [k] tcp_transmit_skb      0.79%  lapps    libpthread-2.26.so      [.] __pthread_mutex_unlock_usercnt      0.77%  lapps    [kernel.vmlinux]        [k] _raw_spin_lock_irqsave      0.76%  lapps    [xt_tcpudp]             [k] tcp_mt      0.71%  lapps    libcrypto.so.43.0.1     [.] aesni_encrypt      0.70%  lapps    [kernel.vmlinux]        [k] _raw_spin_lock      0.67%  lapps    [kernel.vmlinux]        [k] ep_send_events_proc      0.66%  lapps    libcrypto.so.43.0.1     [.] ERR_clear_error      0.63%  lapps    [kernel.vmlinux]        [k] sock_def_readable      0.62%  lapps    lapps                   [.] LAppS::Application&lt;true, true, (abstract::Application::Protocol)0&gt;::execute      0.61%  lapps    libc-2.26.so            [.] malloc      0.61%  lapps    [nf_conntrack]          [k] nf_conntrack_in      0.58%  lapps    libssl.so.45.0.1        [.] ssl3_read_bytes      0.58%  lapps    libluajit-5.1.so.2.0.5  [.] lj_BC_TGETS      0.57%  lapps    [kernel.vmlinux]        [k] tcp_write_xmit      0.56%  lapps    libssl.so.45.0.1        [.] do_ssl3_write      0.55%  lapps    [kernel.vmlinux]        [k] __netif_receive_skb_core      0.54%  lapps    [kernel.vmlinux]        [k] ___slab_alloc      0.54%  lapps    libc-2.26.so            [.] __memset_avx2_unaligned_erms      0.51%  lapps    [kernel.vmlinux]        [k] _raw_spin_lock_bh      0.51%  lapps    libcrypto.so.43.0.1     [.] gcm_gmult_clmul      0.51%  lapps    [kernel.vmlinux]        [k] sock_poll      0.48%  lapps    [nf_conntrack]          [k] tcp_packet      0.48%  lapps    libc-2.26.so            [.] cfree@GLIBC_2.2.5      0.48%  lapps    libssl.so.45.0.1        [.] SSL_read      0.46%  lapps    [kernel.vmlinux]        [k] copy_user_generic_unrolled      0.45%  lapps    [kernel.vmlinux]        [k] tcp_sendmsg_locked      0.45%  lapps    lapps                   [.] LAppS::ClientWebSocket::send      0.44%  lapps    libc-2.26.so            [.] _int_free      0.44%  lapps    libssl.so.45.0.1        [.] ssl3_read_internal      0.43%  lapps    [kernel.vmlinux]        [k] futex_wake      0.42%  lapps    libluajit-5.1.so.2.0.5  [.] lj_tab_get      0.42%  lapps    libc-2.26.so            [.] vfprintf      0.41%  lapps    [kernel.vmlinux]        [k] tcp_v4_rcv<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/421421\/\"> https:\/\/habr.com\/post\/421421\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/421421\/\" class=\"post__text post__text-html js-mediator-article\">\n<p>\u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u0443\u0440\u0441\u0435: <a href=\"https:\/\/github.com\/ITpC\/LAppS\">LAppS \u2014 Lua Application Server<\/a>, \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u043a nginx \u0438\u043b\u0438 apache, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f WebSocket \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0432\u043c\u0435\u0441\u0442\u043e HTTP. <\/p>\n<p>  <\/p>\n<p>HTTP \u0432 \u043d\u0451\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Upgrade \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>  <\/p>\n<p>LAppS \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u0430\u0447\u0438\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0434\u043e\u0441\u0442\u0438\u0433 \u043f\u0438\u043a\u0430 \u0441\u0432\u043e\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u043c\u043e\u0451\u043c \u0436\u0435\u043b\u0435\u0437\u0435 (\u043d\u0443 \u043f\u043e\u0447\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043b\u0433\u0438\u0439 \u0438 \u0443\u043f\u043e\u0440\u043d\u044b\u0439 \u0442\u0440\u0443\u0434).<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, LAppS \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 WebSocket \u0441\u0442\u0435\u043a\u0430, \u043f\u0440\u0435\u0432\u0437\u043e\u0448\u0451\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 uWebSockets, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u043c\u0430\u044f \u0431\u044b\u0441\u0442\u0440\u0430\u044f WebSocket \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<\/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-288583","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288583","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=288583"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288583\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}