Spring Boot中Tomcat、Jetty、Undertow哪个嵌入式服务器最好?

devtools/2024/10/21 7:50:48/

b587c37962bd7c0e9f2928b1dfeda182.jpeg

当我们使用  Spring Boot 创建一个 Web 应用程序时,Apache Tomcat 是默认的嵌入式 Web 服务器。然而,我们也可以选择其他选项,如 Jetty 和 Undertow。但哪一个才是最佳选择呢?一起来探讨一下!

为此,我们将构建一个名为 Greetings API 的简单 Spring Boot 应用程序。我们将在应用程序的 pom.xml 中添加 Maven 配置文件,以便通过选择适当的配置文件在不同的嵌入式 Web 服务器之间切换。Tomcat 将是默认选项,但我们还将为 Jetty 和 Undertow 设置配置文件。

设置好配置文件后,我们将为每个 Web 服务器创建 Docker 镜像,并在单独的容器中运行它们。然后,我们将根据启动时间、CPU 和内存使用情况以及请求处理性能对它们进行比较。

测试应用

Greetings API 是一个简单的应用程序,它公开了一个端点 /greetings?name=?,该端点返回一个问候语。如果没有提供name,它将返回“[greeting-word] World!”。否则,它将返回“[greeting-word] [name]!”。

它的实现如下:

@Service
public class GreetingsService {private static final String[] greetingWord = new String[]{"Hello", "Hi", "Olá", "Oi", "Hallo"};public String randomGreetings(String name) {try {String word = greetingWord[ThreadLocalRandom.current().nextInt(greetingWord.length)];Thread.sleep(1000);return "%s %s!".formatted(word, name);} catch (InterruptedException e) {throw new RuntimeException(e);}}
}
@RestController
@RequestMapping("/greetings")
public class GreetingsController {private final GreetingsService greetingsService;public GreetingsController(GreetingsService greetingsService) {this.greetingsService = greetingsService;}@GetMappingpublic String greeting(@RequestParam(required = false, defaultValue = "World") String name) {return greetingsService.randomGreetings(name);}
}
@Service
public class GreetingsService {private static final String[] greetingWord = new String[]{"Hello", "Hi", "Olá", "Oi", "Hallo"};public String randomGreetings(String name) {try {String word = greetingWord[ThreadLocalRandom.current().nextInt(greetingWord.length)];Thread.sleep(1000);return "%s %s!".formatted(word, name);} catch (InterruptedException e) {throw new RuntimeException(e);}}
}@RestController
@RequestMapping("/greetings")
public class GreetingsController {private final GreetingsService greetingsService;public GreetingsController(GreetingsService greetingsService) {this.greetingsService = greetingsService;}@GetMappingpublic String greeting(@RequestParam(required = false, defaultValue = "World") String name) {return greetingsService.randomGreetings(name);}
}
@Service
public class GreetingsService {private static final String[] greetingWord = new String[]{"Hello", "Hi", "Olá", "Oi", "Hallo"};public String randomGreetings(String name) {try {String word = greetingWord[ThreadLocalRandom.current().nextInt(greetingWord.length)];Thread.sleep(1000);return "%s %s!".formatted(word, name);} catch (InterruptedException e) {throw new RuntimeException(e);}}
}@RestController
@RequestMapping("/greetings")
public class GreetingsController {private final GreetingsService greetingsService;public GreetingsController(GreetingsService greetingsService) {this.greetingsService = greetingsService;}@GetMappingpublic String greeting(@RequestParam(required = false, defaultValue = "World") String name) {return greetingsService.randomGreetings(name);}
}

Jetty和Undertow的配置

在pom.xml中增加Jetty和Undertow的配置

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" ...>...<dependencies>...</dependencies><profiles><!-- Jetty Profile --><profile><id>jetty</id><activation><activeByDefault>false</activeByDefault></activation><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- Exclude the Tomcat dependency --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions></dependency><!-- Use Jetty instead --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jetty</artifactId></dependency></dependencies></profile><!-- Undertow Profile --><profile><id>undertow</id><activation><activeByDefault>false</activeByDefault></activation><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- Exclude the Tomcat dependency --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions></dependency><!-- Use Undertow instead --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-undertow</artifactId></dependency></dependencies></profile></profiles><build>...</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" ...>...<dependencies>...</dependencies><profiles><!-- Jetty Profile --><profile><id>jetty</id><activation><activeByDefault>false</activeByDefault></activation><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- Exclude the Tomcat dependency --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions></dependency><!-- Use Jetty instead --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jetty</artifactId></dependency></dependencies></profile><!-- Undertow Profile --><profile><id>undertow</id><activation><activeByDefault>false</activeByDefault></activation><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- Exclude the Tomcat dependency --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions></dependency><!-- Use Undertow instead --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-undertow</artifactId></dependency></dependencies></profile></profiles><build>...</build></project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" ...>...<dependencies>...</dependencies><profiles><!-- Jetty Profile --><profile><id>jetty</id><activation><activeByDefault>false</activeByDefault></activation><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- Exclude the Tomcat dependency --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions></dependency><!-- Use Jetty instead --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jetty</artifactId></dependency></dependencies></profile><!-- Undertow Profile --><profile><id>undertow</id><activation><activeByDefault>false</activeByDefault></activation><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- Exclude the Tomcat dependency --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions></dependency><!-- Use Undertow instead --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-undertow</artifactId></dependency></dependencies></profile></profiles><build>...</build></project>

application.properties 配置

分别配置Tomcat、Jetty和Undertow线程配置,具体如下:

# Maximum amount of worker threads. 200 is the default.
server.tomcat.threads.max=200
# Maximum number of threads. 200 is the default.
server.jetty.threads.max=200
# Number of worker threads. The default is 8 times the number of I/O threads.
# The number of I/O threads is set by the property "server.undertow.threads.io" whose default is derived from the number of available processors.
server.undertow.threads.worker=200
# Maximum amount of worker threads. 200 is the default.
server.tomcat.threads.max=200# Maximum number of threads. 200 is the default.
server.jetty.threads.max=200# Number of worker threads. The default is 8 times the number of I/O threads.
# The number of I/O threads is set by the property "server.undertow.threads.io" whose default is derived from the number of available processors.
server.undertow.threads.worker=200
# Maximum amount of worker threads. 200 is the default.
server.tomcat.threads.max=200# Maximum number of threads. 200 is the default.
server.jetty.threads.max=200# Number of worker threads. The default is 8 times the number of I/O threads.
# The number of I/O threads is set by the property "server.undertow.threads.io" whose default is derived from the number of available processors.
server.undertow.threads.worker=200

这里我们将所有Web服务器的最大线程数设置为200

我们创建了一个高质量的技术交流群,与优秀的人在一起,自己也会优秀起来,赶紧点击加群,享受一起成长的快乐。

更多关于Spring的技术学习,可关注 https://spring4all.com,专注讨论关于Spring的一切。

构建Docker镜像

上面我们已经为 Jetty 和 Undertow 配置了 Maven 配置文件,所以我们可以为每个嵌入式 Web 服务器构建 Docker 镜像。

# 构建Tomcat的镜像
./mvnw clean -DskipTests spring-boot:build-image  \-Dspring-boot.build-image.imageName=greetings-api-tomcat:latest
# 构建Jetty的镜像
./mvnw clean -DskipTests spring-boot:build-image -Pjetty \-Dspring-boot.build-image.imageName=greetings-api-jetty:latest
# 构建Undertow的镜像
./mvnw clean -DskipTests spring-boot:build-image -Pundertow \-Dspring-boot.build-image.imageName=greetings-api-undertow:latest
# 构建Tomcat的镜像
./mvnw clean -DskipTests spring-boot:build-image  \-Dspring-boot.build-image.imageName=greetings-api-tomcat:latest# 构建Jetty的镜像
./mvnw clean -DskipTests spring-boot:build-image -Pjetty \-Dspring-boot.build-image.imageName=greetings-api-jetty:latest# 构建Undertow的镜像
./mvnw clean -DskipTests spring-boot:build-image -Pundertow \-Dspring-boot.build-image.imageName=greetings-api-undertow:latest
# 构建Tomcat的镜像
./mvnw clean -DskipTests spring-boot:build-image  \-Dspring-boot.build-image.imageName=greetings-api-tomcat:latest# 构建Jetty的镜像
./mvnw clean -DskipTests spring-boot:build-image -Pjetty \-Dspring-boot.build-image.imageName=greetings-api-jetty:latest# 构建Undertow的镜像
./mvnw clean -DskipTests spring-boot:build-image -Pundertow \-Dspring-boot.build-image.imageName=greetings-api-undertow:latest

基准测试

为了从我们的 Docker 容器中收集基准测试的重要数据,我们将使用这个开源项目:https://github.com/ivangfr/api-oha-benchmarker ,

基准测试将包括对每个嵌入式 Web 服务器的 Docker 容器进行负载测试。每次迭代,我们将进行如下操作:

  1. 启动 Docker 容器

  2. 使用 100、300、900 和最终 2700 个并发请求进行 OHA 测试

  3. 关闭 Docker 容器。

下面,我们在使用 OHA 对 Docker 容器进行 100、300、900 和最终 2700 个并发请求的负载测试后,获得的结果数据:

Application | numRequests | Concurrency | Success rate(%) | Total(secs) | Slowest(secs) | Fastest(secs) | Average(secs) | Requests/sec |
---------------------- + ----------- + ----------- + --------------- + ----------- + ------------- + ------------- + ------------- + ------------ |greetings-api-tomcat |         100 |         100 |          100.00 |      1.2949 |        1.2942 |        1.2701 |        1.2822 |      77.2256 |greetings-api-tomcat |         300 |         300 |          100.00 |      2.1069 |        2.0835 |        1.0311 |        1.4158 |     142.3913 |greetings-api-tomcat |         900 |         900 |          100.00 |      5.1386 |        5.0797 |        1.0283 |        2.8856 |     175.1446 |greetings-api-tomcat |        2700 |        2700 |          100.00 |     14.3752 |       14.2423 |        1.0296 |        7.4867 |     187.8241 |
...................... + ........... + ........... + ............... + ........... + ............. + ............. + ............. + ............ |greetings-api-jetty |         100 |         100 |          100.00 |      2.0717 |        2.0708 |        1.2639 |        1.5895 |      48.2692 |greetings-api-jetty |         300 |         300 |          100.00 |      3.1081 |        3.1056 |        1.0307 |        1.7496 |      96.5223 |greetings-api-jetty |         900 |         900 |          100.00 |      5.1943 |        5.1762 |        1.0381 |        3.0216 |     173.2659 |greetings-api-jetty |        2700 |        2700 |          100.00 |     15.3022 |       15.2278 |        1.0160 |        7.9127 |     176.4455 |
...................... + ........... + ........... + ............... + ........... + ............. + ............. + ............. + ............ |
greetings-api-undertow |         100 |         100 |          100.00 |      1.3076 |        1.3066 |        1.2665 |        1.2833 |      76.4765 |
greetings-api-undertow |         300 |         300 |          100.00 |      2.0819 |        2.0776 |        1.0413 |        1.4058 |     144.0982 |
greetings-api-undertow |         900 |         900 |          100.00 |      5.1443 |        5.1121 |        1.0780 |        2.8783 |     174.9493 |
greetings-api-undertow |        2700 |        2700 |          100.00 |     14.1748 |       14.0861 |        1.0758 |        7.3721 |     190.4783 |
Application | numRequests | Concurrency | Success rate(%) | Total(secs) | Slowest(secs) | Fastest(secs) | Average(secs) | Requests/sec |
---------------------- + ----------- + ----------- + --------------- + ----------- + ------------- + ------------- + ------------- + ------------ |greetings-api-tomcat |         100 |         100 |          100.00 |      1.2949 |        1.2942 |        1.2701 |        1.2822 |      77.2256 |greetings-api-tomcat |         300 |         300 |          100.00 |      2.1069 |        2.0835 |        1.0311 |        1.4158 |     142.3913 |greetings-api-tomcat |         900 |         900 |          100.00 |      5.1386 |        5.0797 |        1.0283 |        2.8856 |     175.1446 |greetings-api-tomcat |        2700 |        2700 |          100.00 |     14.3752 |       14.2423 |        1.0296 |        7.4867 |     187.8241 |
...................... + ........... + ........... + ............... + ........... + ............. + ............. + ............. + ............ |greetings-api-jetty |         100 |         100 |          100.00 |      2.0717 |        2.0708 |        1.2639 |        1.5895 |      48.2692 |greetings-api-jetty |         300 |         300 |          100.00 |      3.1081 |        3.1056 |        1.0307 |        1.7496 |      96.5223 |greetings-api-jetty |         900 |         900 |          100.00 |      5.1943 |        5.1762 |        1.0381 |        3.0216 |     173.2659 |greetings-api-jetty |        2700 |        2700 |          100.00 |     15.3022 |       15.2278 |        1.0160 |        7.9127 |     176.4455 |
...................... + ........... + ........... + ............... + ........... + ............. + ............. + ............. + ............ |
greetings-api-undertow |         100 |         100 |          100.00 |      1.3076 |        1.3066 |        1.2665 |        1.2833 |      76.4765 |
greetings-api-undertow |         300 |         300 |          100.00 |      2.0819 |        2.0776 |        1.0413 |        1.4058 |     144.0982 |
greetings-api-undertow |         900 |         900 |          100.00 |      5.1443 |        5.1121 |        1.0780 |        2.8783 |     174.9493 |
greetings-api-undertow |        2700 |        2700 |          100.00 |     14.1748 |       14.0861 |        1.0758 |        7.3721 |     190.4783 |
Application | numRequests | Concurrency | Success rate(%) | Total(secs) | Slowest(secs) | Fastest(secs) | Average(secs) | Requests/sec |
---------------------- + ----------- + ----------- + --------------- + ----------- + ------------- + ------------- + ------------- + ------------ |greetings-api-tomcat |         100 |         100 |          100.00 |      1.2949 |        1.2942 |        1.2701 |        1.2822 |      77.2256 |greetings-api-tomcat |         300 |         300 |          100.00 |      2.1069 |        2.0835 |        1.0311 |        1.4158 |     142.3913 |greetings-api-tomcat |         900 |         900 |          100.00 |      5.1386 |        5.0797 |        1.0283 |        2.8856 |     175.1446 |greetings-api-tomcat |        2700 |        2700 |          100.00 |     14.3752 |       14.2423 |        1.0296 |        7.4867 |     187.8241 |
...................... + ........... + ........... + ............... + ........... + ............. + ............. + ............. + ............ |greetings-api-jetty |         100 |         100 |          100.00 |      2.0717 |        2.0708 |        1.2639 |        1.5895 |      48.2692 |greetings-api-jetty |         300 |         300 |          100.00 |      3.1081 |        3.1056 |        1.0307 |        1.7496 |      96.5223 |greetings-api-jetty |         900 |         900 |          100.00 |      5.1943 |        5.1762 |        1.0381 |        3.0216 |     173.2659 |greetings-api-jetty |        2700 |        2700 |          100.00 |     15.3022 |       15.2278 |        1.0160 |        7.9127 |     176.4455 |
...................... + ........... + ........... + ............... + ........... + ............. + ............. + ............. + ............ |
greetings-api-undertow |         100 |         100 |          100.00 |      1.3076 |        1.3066 |        1.2665 |        1.2833 |      76.4765 |
greetings-api-undertow |         300 |         300 |          100.00 |      2.0819 |        2.0776 |        1.0413 |        1.4058 |     144.0982 |
greetings-api-undertow |         900 |         900 |          100.00 |      5.1443 |        5.1121 |        1.0780 |        2.8783 |     174.9493 |
greetings-api-undertow |        2700 |        2700 |          100.00 |     14.1748 |       14.0861 |        1.0758 |        7.3721 |     190.4783 |

下图显示了启动时间以及最大 CPU 和内存消耗:

Application | StartUpTime(sec) | Max CPU(%) | Max Memory(MB) |
---------------------- + ---------------- + ---------- + -------------- |greetings-api-tomcat |           1.8920 |     101.26 |         269.10 |greetings-api-jetty |           1.9790 |     100.40 |         217.70 |
greetings-api-undertow |           2.0450 |     124.15 |         237.50 |
Application | StartUpTime(sec) | Max CPU(%) | Max Memory(MB) |
---------------------- + ---------------- + ---------- + -------------- |greetings-api-tomcat |           1.8920 |     101.26 |         269.10 |greetings-api-jetty |           1.9790 |     100.40 |         217.70 |
greetings-api-undertow |           2.0450 |     124.15 |         237.50 |
Application | StartUpTime(sec) | Max CPU(%) | Max Memory(MB) |
---------------------- + ---------------- + ---------- + -------------- |greetings-api-tomcat |           1.8920 |     101.26 |         269.10 |greetings-api-jetty |           1.9790 |     100.40 |         217.70 |
greetings-api-undertow |           2.0450 |     124.15 |         237.50 |

响应时间

9954cfbaec70982012d9fe8f24b2ca74.png

我们可以看到,在处理 100 个并发请求时,使用 Tomcat 的应用程序最快,时间为 1.2949 秒,紧随其后的是使用 Undertow 的应用程序,时间为 1.3076 秒。使用 Jetty 的应用程序最慢,时间为 2.0717 秒。

在处理 300 个并发请求时,使用 Undertow 的应用程序略快,时间为 2.0819 秒,紧随其后的是使用 Tomcat 的应用程序,时间为 2.1069 秒。使用 Jetty 的应用程序最慢,时间为 3.1081 秒。

对于 900 个并发请求,使用 Tomcat 的应用程序略快,时间为 5.1386 秒,紧随其后的是使用 Undertow 的应用程序,时间为 5.1443 秒,以及使用 Jetty 的应用程序,时间为 5.1943 秒。

最后,在处理 2700 个并发请求时,使用 Undertow 的应用程序最快,时间为 14.1748 秒,紧随其后的是使用 Tomcat 的应用程序,时间为 14.3752 秒。使用 Jetty 的应用程序最慢,时间为 15.3022 秒。

启动时间

f0dbb9590c4222742ee343abf0b440ac.png

可以看到,使用 Tomcat 的应用程序启动时间最快,为 1.8920 秒,紧随其后的是使用 Jetty 的应用程序,时间为 1.9790 秒。启动最慢的是使用 Undertow 的应用程序,耗时 2.0450 秒。

内存占用

81ede1a6e95ee4e84a4b42a62fe9b64c.png

可以看到,使用 Jetty 的应用程序最大内存消耗最低,为 217.70 MB,紧随其后的是使用 Undertow 的应用程序,为 237.50 MB。最大内存消耗最高的是使用 Tomcat 的应用程序,为 269.10 MB。

CPU占用

8202dfbd41f6752eb1fefb76d6bf13a0.png

以看到,使用 Jetty 的应用程序最大 CPU 使用率最低,为 100.40%,紧随其后的是使用 Tomcat 的应用程序,为 101.26%。最高 CPU 使用率的是使用 Undertow 的应用程序,为 124.15%。

结论

根据上面的测试,可以看到Tomcat、Jetty 和 Undertow 各有优势。使用 Tomcat 的应用程序启动速度最快,并且能够很好地处理不同级别的流量,尽管它使用更多的内存。使用 Undertow 的应用程序在处理大量流量时表现最佳,但它的 CPU 使用率更高,启动时间稍长。使用 Jetty 的应用程序在响应流量方面较慢,但它使用的内存和 CPU 更少,如果你希望节省资源,这是一个不错的选择。

选择最佳的 Web 服务器取决于你的需求。如果你的应用程序将处理大量流量,Undertow 可能是最佳选择。如果你想要一个全能的选择,Tomcat 是一个可靠的选择。而如果节省内存和 CPU 是最重要的,Jetty 是一个不错的选择。

最后,留言区说说你目前用的哪个呢?

来源:https://spring4all.com/forum-post/7674.html

我们创建了一个高质量的技术交流群,与优秀的人在一起,自己也会优秀起来,赶紧点击加群,享受一起成长的快乐。


你还在购买国内的各种昂贵又低质的技术教程吗?这里给大家推荐下我们自研的Youtube视频语音转换插件(https://youtube-dubbing.com/),一键外语转中文,英语不好的小伙伴也可以轻松的学习油管上的优质教程了,下面是演示视频,可以直观的感受一下:

如果您觉得这款插件不错,也可以推荐给您身边的朋友,目前我们开通了分享赚钱功能,只要安装本插件登录注册之后,获取邀请链接,放到你的博客侧边栏、友情链接或者发到朋友圈、微博、X等社交平台,就能获得积分,积分现在是可以i直接提现的哦~

推荐阅读

  • 如何在 Spring Boot 中创建自定义注解简化重复编码

  • Spring AI 更新:支持OpenAI的结构化输出,增强对JSON响应的支持

  • IntelliJ IDEA 2024.2 发布:Spring Data JPA即时查询、自动补全cron表达式

  • Spring Boot 中使用 JSON Schema 来校验复杂JSON数据


http://www.ppmy.cn/devtools/105299.html

相关文章

一文读懂 服务器

一文读懂 服务器 马上就是毕业季了&#xff0c;做好的毕设不免上云服务器来演示一下&#xff0c;让自己答辩时加分。但相信很多小伙伴对服务器没有一个实体的概念&#xff0c;不明白什么是服务器&#xff0c;和平时使用的计算机又有什么区别。在网络上&#xff0c;经常看见的什…

分布式事务Seata

分布式事务介绍 举个例子&#xff0c;商城系统&#xff0c;订单、购物车、商品分别在三个不同的微服务&#xff0c;而每个微服务都有自己独立的数据库&#xff0c;因此下单过程中就会跨多个数据库完成业务。而每个微服务都会执行自己的本地事务&#xff1a; 交易服务&#xf…

Unity (编辑器)数据持久化 之 ScriptableObject初识与创建

1.什么是ScriptableObject ScriptableObject - Unity 手册 如题&#xff0c;一个可以在Unity编辑器中方便编辑数据的工具 一个脚本继承该类&#xff0c;并且序列化或者有公共变量&#xff0c;即可在Inspector窗口看到它们 其特点&#xff1a; Q:是否可以将 ScriptableObject…

SQL 数据查询

文章目录 3.4.1 单表查询定义特点单表无条件查询单表带条件查询对查询结果进行排序限制查询结果数量 3.4.2 分组查询定义特点&#xff1a;聚集函数GROUP BY短语HAVING子句分组查询小结 3.4.3 连接查询定义特点&#xff1a;等值连接与非等值连接查询自然连接&#xff08;内连接&…

Apache DolphinScheduler大规模任务调度系统对大数据实时Flink任务支持

转载自神龙大侠 我是用olphinScheduler 3.2.1版本做源代码编译部署&#xff08;部署方式参考我的另外一篇文档《源代码编译&#xff0c;Apache DolphinScheduler前后端分离部署解决方案》&#xff09; 二进制文件部署本文也适用&#xff0c;只需要修改相对应的配置即可。 资…

怎么摆脱非自然链接?

什么是非自然链接&#xff1f; 非自然链接是人为创建的链接&#xff0c;用于操纵网站在搜索引擎中的排名。非自然链接违反了Google 的准则&#xff0c;网站可能会因此受到惩罚。 它们不是由网站所有者编辑放置或担保的。示例包括带有过度优化锚文本的链接、通过 PR 的广告、嵌…

Leetcode 146. LRU 缓存(Medium)

请你设计并实现一个满足 LRU (最近最少使用) 缓存 约束的数据结构。 实现 LRUCache 类&#xff1a; LRUCache(int capacity) 以 正整数 作为容量 capacity 初始化 LRU 缓存int get(int key) 如果关键字 key 存在于缓存中&#xff0c;则返回关键字的值&#xff0c;否则返回 -…

基于yolov5的猪只识别计数检测系统python源码+onnx模型+评估指标曲线+精美GUI界面

【算法介绍】 基于YOLOv5的猪只识别计数检测系统是一种创新的农业应用解决方案&#xff0c;它结合了深度学习和计算机视觉技术&#xff0c;专为提高养猪业的管理效率和精确度而设计。该系统利用YOLOv5这一先进的目标检测模型&#xff0c;能够实时、准确地在图像或视频中识别并…