{"id":349708,"date":"2023-07-04T09:01:01","date_gmt":"2023-07-04T09:01:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=349708"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=349708","title":{"rendered":"<span>Project Loom \u0438 Spring Boot: \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0433\u043e\u0442\u043e\u0432 \u043b\u0438 <a href=\"https:\/\/openjdk.org\/jeps\/436\" rel=\"noopener noreferrer nofollow\"><u>Project Loom<\/u><\/a> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c Spring WebFlux \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/strong><\/p>\n<p>WebFlux &#8212;  \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0441 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043e\u0434\u043d\u0430\u043a\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a\u043e\u0434 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0435\u043a\u0442\u0440\u0435\u0439\u0441\u044b \u043c\u0430\u043b\u043e\u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u043e\u0448\u0438\u0431\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b\/\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435<\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Project Loom:<\/h3>\n<ul>\n<li>\n<p>\u0412 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u043f\u0440\u0435\u0432\u044c\u044e-\u0444\u0438\u0447\u0438 \u0441 Java 19,\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=T-8fA3dEUlg&amp;t=9s\" rel=\"noopener noreferrer nofollow\"><u>\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b\u0430 \u0432 2017<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 &#8212; <a href=\"https:\/\/openjdk.org\/jeps\/425\" rel=\"noopener noreferrer nofollow\">\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438<\/a>, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. <em>(\u041f\u0440\u0438\u043c. \u043f\u0435\u0440. \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0430\u0432\u0442\u043e\u0440\u0443 \u0441\u0442\u043e\u0438\u043b\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043c\u044b\u0441\u043b\u044c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0435\u0448\u0435\u0432\u044b, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0442\u043e\u0436\u0435 \u0434\u0435\u0448\u0435\u0432\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0442.\u043a. \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c )<\/em><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0435\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0445\u0438\u043f\u0435 JVM<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ee5\/84d\/185\/ee584d185405336385a5e80ab8ea9cfb.png\" alt=\"\u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445\" title=\"\u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445\" width=\"700\" height=\"551\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee5\/84d\/185\/ee584d185405336385a5e80ab8ea9cfb.png\"\/><\/p>\n<div><figcaption>\u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u0442\u044c \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e Project Loom \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b. \u041d\u043e \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438?<\/p>\n<h2>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u043d\u0435\u043a\u043e\u0435\u043c\u0443 \u0442\u0440\u0435\u0442\u044c\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0432 500\u043c\u0441. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/Aleksandr-Filichkin\/spring-boot-loom-performance-test\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c 3 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430:<\/p>\n<ul>\n<li>\n<p>Spring Boot (Tomcat) + Project Loom<\/p>\n<\/li>\n<li>\n<p>Spring Webflux<\/p>\n<\/li>\n<li>\n<p>Spring Webflux + Project Loom<\/p>\n<\/li>\n<\/ul>\n<h3>\u0416\u0435\u043b\u0435\u0437\u043e:<\/h3>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043a\u0440\u0443\u0442\u044f\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 AWS EC2<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0434\u0435 t2.micro (1 CPU, 1 GB)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0434\u0435 t2.medium (2 CPU, 4GB)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c EC2<\/p>\n<\/li>\n<\/ul>\n<h2>Tomcat + Loom<\/h2>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Spring Boot, \u0447\u0442\u043e\u0431\u044b Tomcat \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 Spring MVC<\/p>\n<pre><code class=\"java\">@Configuration  public class Config {       @Bean       AsyncTaskExecutor applicationTaskExecutor() {      \/\/ enable async servlet support             ExecutorService executorService = Executors.newVirtualThreadPerTaskExecutor();             return new TaskExecutorAdapter(executorService);       }          @Bean       TomcatProtocolHandlerCustomizer&lt;?> protocolHandlerVirtualThreadExecutorCustomizer() {             return protocolHandler -> protocolHandler.setExecutor(Executors.newVirtualThreadPerTaskExecutor());       } }  @RestController public class Controller {       private final RestTemplate restTemplate = new RestTemplate();      private final String host = \"http:\/\/test:7000\/address\/\";        @GetMapping(\"\/address\/{timeout}\")       String getAddress(@PathVariable long timeout) throws URISyntaxException {      URI uri = new URI(host + timeout);             return restTemplate.getForObject(uri, String.class);       } }<\/code><\/pre>\n<h2>WebFlux<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 WebFlux \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e http-\u043a\u043b\u0438\u0435\u043d\u0442 WebClient. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"java\">@RestController public class Controller {      private final WebClient webClient = init();   private final String host = \"http:\/\/test:7000\/address\/\";      private WebClient init() {             String connectionProviderName = \"myConnectionProvider\";             HttpClient httpClient = HttpClient.create(ConnectionProvider.builder(connectionProviderName)                         .maxConnections(10_000)                         .pendingAcquireMaxCount(10_000)                         .pendingAcquireTimeout(Duration.of(100, ChronoUnit.SECONDS))                         .build()               );     return WebClient.builder()                       .clientConnector(new ReactorClientHttpConnector(httpClient)).build();   }      private Mono&lt;String> getAddressInternal(long timeout) {             return webClient.get()                       .uri(host + timeout)                       .exchangeToMono(clientResponse -> clientResponse.bodyToMono(String.class))                       .timeout(Duration.ofSeconds(200));       }      @GetMapping(\"\/address-reactive\/{timeout}\")       Mono&lt;String> getAddress(@PathVariable long timeout) {             return getAddressInternal(timeout);       } }<\/code><\/pre>\n<h2>WebFlux + Project Loom<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u043d\u043e \u043d\u0430 \u043f\u0443\u043b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 Executors.<em>newVirtualThreadPerTaskExecutor<\/em>(). \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432 Mono.<\/p>\n<pre><code class=\"java\">@GetMapping(\"\/address-loom\/{timeout}\") Mono&lt;String> getAddressWithLoom(@PathVariable long timeout) {      return Mono.fromFuture(     CompletableFuture       .supplyAsync(() ->                     getAddressInternal(timeout).block(),                     Executors.newVirtualThreadPerTaskExecutor()   )); }<\/code><\/pre>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5ed\/dc8\/ae2\/5eddc8ae295bf974112c91b74fa17621.png\" width=\"700\" height=\"444\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ed\/dc8\/ae2\/5eddc8ae295bf974112c91b74fa17621.png\"\/><\/figure>\n<p>Tomcat + Loom \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b <em>(\u041f\u0440\u0438\u043c. \u043f\u0435\u0440. \u0415\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c, \u0447\u0442\u043e &#171;\u043f\u0440\u043e\u0441\u0442\u043e&#187; Tomcat \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0431\u044b \u0434\u0430\u0436\u0435 \u0438 \u0442\u0430\u043a\u0438\u0445)<\/em>. \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043d\u0435\u0432\u044b\u0441\u043e\u043a\u0430 \u0438\u0437-\u0437\u0430 <strong>\u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 GC<\/strong> (~50CPU).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/124\/511\/248\/124511248278fed69f6d6e675534b591.png\" alt=\"Tomcat +Loom \u0434\u043b\u044f 4k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" title=\"Tomcat +Loom \u0434\u043b\u044f 4k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" width=\"700\" height=\"319\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/124\/511\/248\/124511248278fed69f6d6e675534b591.png\"\/><\/p>\n<div><figcaption>Tomcat +Loom \u0434\u043b\u044f 4k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0432\u044f\u0437\u043a\u0430 Tomcat + Loom \u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0432 4k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u0434\u043b\u044f 8k \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 OOM.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 heap dump \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0437\u0430\u043d\u044f\u0442\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c\u0438  SocketWrapper, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 Tomcat. \u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0442.\u043a. \u0434\u0438\u0437\u0430\u0439\u043d Tomcat \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c &#171;1 \u0437\u0430\u043f\u0440\u043e\u0441 &#8212; 1 \u043f\u043e\u0442\u043e\u043a&#187;.  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0441\u043b\u0438\u0448\u043a\u043e\u043c &#171;\u0442\u044f\u0436\u0435\u043b\u044b&#187;, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u043e\u0442\u043e\u043a\u0430\u043c \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3b6\/c5b\/705\/3b6c5b705c245e324e3b8c827b4e4fec.png\" alt=\"Tomcat +Loom: heap dump report\" title=\"Tomcat +Loom: heap dump report\" width=\"700\" height=\"333\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b6\/c5b\/705\/3b6c5b705c245e324e3b8c827b4e4fec.png\"\/><\/p>\n<div><figcaption>Tomcat +Loom: heap dump report<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u043f\u0440\u043e\u0444\u0438\u043b\u0438 WebFlux \u0438 WebFlux + Loom<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d91\/b4a\/786\/d91b4a786cc422561c7357b28932f015.png\" alt=\"Webflux: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" title=\"Webflux: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" width=\"700\" height=\"332\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d91\/b4a\/786\/d91b4a786cc422561c7357b28932f015.png\"\/><\/p>\n<div><figcaption>Webflux: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d78\/07f\/549\/d7807f549a558e2f642202b6d2d9678a.png\" alt=\"Webflux+ Loom: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" title=\"Webflux+ Loom: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" width=\"700\" height=\"342\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d78\/07f\/549\/d7807f549a558e2f642202b6d2d9678a.png\"\/><\/p>\n<div><figcaption>Webflux+ Loom: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u043e\u0444\u0438\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c, CPU \u0438 GC \u043f\u043e\u0445\u043e\u0436\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0443\u044e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u0445\u043e\u0442\u044f \u0434\u043b\u044f 10k \u0437\u0430\u043f\u0440\u043e\u0441 Loom \u0434\u0430\u0436\u0435 \u0432\u044b\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0440\u0435\u0434.<\/p>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>Project Loom \u044d\u0442\u043e &#171;game changer&#187;. \u041c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u043e\u043b\u044c \u0436\u0435 , \u043a\u0430\u043a \u043a\u043e\u0434 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439\/\u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430 Loom \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0435\u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0442\u0438\u043f\u0430 Hibernate. \u041d\u043e \u043c\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 Netty+WebFlux \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0442.\u043a. Tomcat \u043f\u043e\u043a\u0430 \u0447\u0442\u043e by-design \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<h2>P.S. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f Project Loom<\/h2>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u0441\u0435 \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d, \u0435\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0412\u044b\u0437\u043e\u0432\u044b \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430\/\u043c\u0435\u0442\u043e\u0434. \u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ReentrantLock \u0438 -Djdk.tracePinnedThreads=full<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0435\u043d\u044b \u0441 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 synchronized \u043d\u0430 ReentrantLock. \u0421\u043c. <a href=\"https:\/\/github.com\/pgjdbc\/pgjdbc\/issues\/1951\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pgjdbc\/pgjdbc\/issues\/1951<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/745748\/\"> https:\/\/habr.com\/ru\/articles\/745748\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0433\u043e\u0442\u043e\u0432 \u043b\u0438 <a href=\"https:\/\/openjdk.org\/jeps\/436\" rel=\"noopener noreferrer nofollow\"><u>Project Loom<\/u><\/a> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c Spring WebFlux \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/strong><\/p>\n<p>WebFlux &#8212;  \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0441 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043e\u0434\u043d\u0430\u043a\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a\u043e\u0434 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0435\u043a\u0442\u0440\u0435\u0439\u0441\u044b \u043c\u0430\u043b\u043e\u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u043e\u0448\u0438\u0431\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b\/\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435<\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Project Loom:<\/h3>\n<ul>\n<li>\n<p>\u0412 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u043f\u0440\u0435\u0432\u044c\u044e-\u0444\u0438\u0447\u0438 \u0441 Java 19,\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=T-8fA3dEUlg&amp;t=9s\" rel=\"noopener noreferrer nofollow\"><u>\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b\u0430 \u0432 2017<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 &#8212; <a href=\"https:\/\/openjdk.org\/jeps\/425\" rel=\"noopener noreferrer nofollow\">\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438<\/a>, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. <em>(\u041f\u0440\u0438\u043c. \u043f\u0435\u0440. \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0430\u0432\u0442\u043e\u0440\u0443 \u0441\u0442\u043e\u0438\u043b\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043c\u044b\u0441\u043b\u044c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0435\u0448\u0435\u0432\u044b, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0442\u043e\u0436\u0435 \u0434\u0435\u0448\u0435\u0432\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0442.\u043a. \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c )<\/em><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0435\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0445\u0438\u043f\u0435 JVM<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u0442\u044c \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e Project Loom \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b. \u041d\u043e \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438?<\/p>\n<h2>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u043d\u0435\u043a\u043e\u0435\u043c\u0443 \u0442\u0440\u0435\u0442\u044c\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0432 500\u043c\u0441. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/Aleksandr-Filichkin\/spring-boot-loom-performance-test\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c 3 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430:<\/p>\n<ul>\n<li>\n<p>Spring Boot (Tomcat) + Project Loom<\/p>\n<\/li>\n<li>\n<p>Spring Webflux<\/p>\n<\/li>\n<li>\n<p>Spring Webflux + Project Loom<\/p>\n<\/li>\n<\/ul>\n<h3>\u0416\u0435\u043b\u0435\u0437\u043e:<\/h3>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043a\u0440\u0443\u0442\u044f\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 AWS EC2<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0434\u0435 t2.micro (1 CPU, 1 GB)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0434\u0435 t2.medium (2 CPU, 4GB)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c EC2<\/p>\n<\/li>\n<\/ul>\n<h2>Tomcat + Loom<\/h2>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Spring Boot, \u0447\u0442\u043e\u0431\u044b Tomcat \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 Spring MVC<\/p>\n<pre><code class=\"java\">@Configuration  public class Config {       @Bean       AsyncTaskExecutor applicationTaskExecutor() {      \/\/ enable async servlet support             ExecutorService executorService = Executors.newVirtualThreadPerTaskExecutor();             return new TaskExecutorAdapter(executorService);       }          @Bean       TomcatProtocolHandlerCustomizer&lt;?> protocolHandlerVirtualThreadExecutorCustomizer() {             return protocolHandler -> protocolHandler.setExecutor(Executors.newVirtualThreadPerTaskExecutor());       } }  @RestController public class Controller {       private final RestTemplate restTemplate = new RestTemplate();      private final String host = \"http:\/\/test:7000\/address\/\";        @GetMapping(\"\/address\/{timeout}\")       String getAddress(@PathVariable long timeout) throws URISyntaxException {      URI uri = new URI(host + timeout);             return restTemplate.getForObject(uri, String.class);       } }<\/code><\/pre>\n<h2>WebFlux<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 WebFlux \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e http-\u043a\u043b\u0438\u0435\u043d\u0442 WebClient. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"java\">@RestController public class Controller {      private final WebClient webClient = init();   private final String host = \"http:\/\/test:7000\/address\/\";      private WebClient init() {             String connectionProviderName = \"myConnectionProvider\";             HttpClient httpClient = HttpClient.create(ConnectionProvider.builder(connectionProviderName)                         .maxConnections(10_000)                         .pendingAcquireMaxCount(10_000)                         .pendingAcquireTimeout(Duration.of(100, ChronoUnit.SECONDS))                         .build()               );     return WebClient.builder()                       .clientConnector(new ReactorClientHttpConnector(httpClient)).build();   }      private Mono&lt;String> getAddressInternal(long timeout) {             return webClient.get()                       .uri(host + timeout)                       .exchangeToMono(clientResponse -> clientResponse.bodyToMono(String.class))                       .timeout(Duration.ofSeconds(200));       }      @GetMapping(\"\/address-reactive\/{timeout}\")       Mono&lt;String> getAddress(@PathVariable long timeout) {             return getAddressInternal(timeout);       } }<\/code><\/pre>\n<h2>WebFlux + Project Loom<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u043d\u043e \u043d\u0430 \u043f\u0443\u043b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 Executors.<em>newVirtualThreadPerTaskExecutor<\/em>(). \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432 Mono.<\/p>\n<pre><code class=\"java\">@GetMapping(\"\/address-loom\/{timeout}\") Mono&lt;String> getAddressWithLoom(@PathVariable long timeout) {      return Mono.fromFuture(     CompletableFuture       .supplyAsync(() ->                     getAddressInternal(timeout).block(),                     Executors.newVirtualThreadPerTaskExecutor()   )); }<\/code><\/pre>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h2>\n<figure class=\"full-width\"><\/figure>\n<p>Tomcat + Loom \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b <em>(\u041f\u0440\u0438\u043c. \u043f\u0435\u0440. \u0415\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c, \u0447\u0442\u043e &#171;\u043f\u0440\u043e\u0441\u0442\u043e&#187; Tomcat \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0431\u044b \u0434\u0430\u0436\u0435 \u0438 \u0442\u0430\u043a\u0438\u0445)<\/em>. \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043d\u0435\u0432\u044b\u0441\u043e\u043a\u0430 \u0438\u0437-\u0437\u0430 <strong>\u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 GC<\/strong> (~50CPU).<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Tomcat +Loom \u0434\u043b\u044f 4k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0432\u044f\u0437\u043a\u0430 Tomcat + Loom \u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0432 4k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u0434\u043b\u044f 8k \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 OOM.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 heap dump \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0437\u0430\u043d\u044f\u0442\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c\u0438  SocketWrapper, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 Tomcat. \u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0442.\u043a. \u0434\u0438\u0437\u0430\u0439\u043d Tomcat \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c &#171;1 \u0437\u0430\u043f\u0440\u043e\u0441 &#8212; 1 \u043f\u043e\u0442\u043e\u043a&#187;.  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0441\u043b\u0438\u0448\u043a\u043e\u043c &#171;\u0442\u044f\u0436\u0435\u043b\u044b&#187;, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u043e\u0442\u043e\u043a\u0430\u043c \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Tomcat +Loom: heap dump report<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u043f\u0440\u043e\u0444\u0438\u043b\u0438 WebFlux \u0438 WebFlux + Loom<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Webflux: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>Webflux+ Loom: 8k \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u043e\u0444\u0438\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c, CPU \u0438 GC \u043f\u043e\u0445\u043e\u0436\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0443\u044e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u0445\u043e\u0442\u044f \u0434\u043b\u044f 10k \u0437\u0430\u043f\u0440\u043e\u0441 Loom \u0434\u0430\u0436\u0435 \u0432\u044b\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0440\u0435\u0434.<\/p>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>Project Loom \u044d\u0442\u043e &#171;game changer&#187;. \u041c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u043e\u043b\u044c \u0436\u0435 , \u043a\u0430\u043a \u043a\u043e\u0434 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439\/\u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430 Loom \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0435\u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0442\u0438\u043f\u0430 Hibernate. \u041d\u043e \u043c\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 Netty+WebFlux \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0442.\u043a. Tomcat \u043f\u043e\u043a\u0430 \u0447\u0442\u043e by-design \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<h2>P.S. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f Project Loom<\/h2>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u0441\u0435 \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d, \u0435\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0412\u044b\u0437\u043e\u0432\u044b \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430\/\u043c\u0435\u0442\u043e\u0434. \u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ReentrantLock \u0438 -Djdk.tracePinnedThreads=full<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0435\u043d\u044b \u0441 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 synchronized \u043d\u0430 ReentrantLock. \u0421\u043c. <a href=\"https:\/\/github.com\/pgjdbc\/pgjdbc\/issues\/1951\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pgjdbc\/pgjdbc\/issues\/1951<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/745748\/\"> https:\/\/habr.com\/ru\/articles\/745748\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-349708","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349708","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=349708"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349708\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}