当前位置: 首页 > news >正文

kong 网关和spring cloud gateway网关性能测试对比

在这里插入图片描述

该测试只是简单在同一台机器设备对spring cloud gateway网关和kong网关进行对比,受限于笔者所拥有的资源,此处仅做简单评测。

一、使用spring boot 的auth-service作为服务提供者

该服务提供了一个/health接口,接口返回"OK",运行的地址为:192.168.188.108:8174

二、使用kong 网关代理该服务
2.1、创建service
curl -i -s -X POST http://localhost:8001/services   --data name=auth-service   --data url='http://192.168.188.108:8174'
2.2. 给服务绑定route
curl -i -X POST http://localhost:8001/services/auth-service/routes   --data 'paths[]=/auth-service'  --data name=auth-service_route
2.3、测试通过kong网关来进行访问
[root@localhost ~]# curl -X GET http://192.168.188.101:8000/auth-service/health
ok
2.4、使用upstream来进行负载均衡
  • 创建upstream
curl -X POST http://localhost:8001/upstreams --data name=auth_upstream
  • 给upstream绑定目标服务
curl -X POST http://localhost:8001/upstreams/auth_upstream/targets --data target='192.168.188.108:8174'
curl -X POST http://localhost:8001/upstreams/auth_upstream/targets --data target='192.168.188.108:8176'
  • 更新service指定的url地址
curl -X PATCH http://localhost:8001/services/auth-service --data host='auth_upstream'
三、搭建spring cloud 的gateway网关环境
<?xml version="1.0" encoding="UTF-8"?>
<!--suppress MavenPropertyInParent -->
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>api-module-gateways</artifactId><groupId>com.api</groupId><version>${env.project.version}</version></parent><modelVersion>4.0.0</modelVersion><artifactId>manager-gateway</artifactId><packaging>jar</packaging><description>后台管理网关</description><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target></properties><!-- 具体的jar包依赖 --><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId><exclusions><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></exclusion></exclusions></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-gateway</artifactId></dependency><!-- 注册中心与配置中心 --><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId></dependency><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-openfeign-core</artifactId></dependency><dependency><groupId>io.github.openfeign</groupId><artifactId>feign-okhttp</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><scope>provided</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>2.1.0.RELEASE</version><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build></project>

bootstrap.yaml

server:port: 8171
spring:cloud:gateway:discovery:locator:enabled: true routes:- id: auth-serviceuri: lb://auth-servicepredicates:- Path=/auth-service/**filters:- RewritePath=/auth-service/(?<path>.*), /$\{path}
feign:client:config:default:connectTimeout: 10000readTimeout: 10000 
open:gateway:excludes: skipUrl:- /config/all/content- /auth/manager/captcha- /auth/manager/login- /auth/manager/isAlreadylogin- /config/dick/selectAllDick- /config/menu/selectTreeDick- /health

测试接口能否正常使用:

curl -X GET http://192.168.188.108:8171/auth-service/health
四、性能测试对比
4.1、1000个请求、100并发场景
  • kong 网关

    [root@localhost wrk-4.2.0]# ab -n 1000 -c 100 http://192.168.188.101:8000/auth-service/health
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.101 (be patient)
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Completed 500 requests
    Completed 600 requests
    Completed 700 requests
    Completed 800 requests
    Completed 900 requests
    Completed 1000 requests
    Finished 1000 requestsServer Software:        kong/3.9.0.0-enterprise-edition
    Server Hostname:        192.168.188.101
    Server Port:            8000Document Path:          /auth-service/health
    Document Length:        2 bytesConcurrency Level:      100
    Time taken for tests:   0.321 seconds
    Complete requests:      1000
    Failed requests:        0
    Write errors:           0
    Total transferred:      325331 bytes
    HTML transferred:       2000 bytes
    Requests per second:    3112.66 [#/sec] (mean)
    Time per request:       32.127 [ms] (mean)
    Time per request:       0.321 [ms] (mean, across all concurrent requests)
    Transfer rate:          988.91 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
    Connect:        1    8   3.9      8      17
    Processing:     3   21   9.9     18      67
    Waiting:        3   19   9.3     15      62
    Total:         10   29  10.8     28      79Percentage of the requests served within a certain time (ms)50%     2866%     3075%     3380%     3690%     4495%     4898%     6299%     70100%     79 (longest request)
    
  • spring cloud gateway

[root@localhost wrk-4.2.0]# ab -n 1000 -c 100 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.108 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requestsServer Software:
Server Hostname:        192.168.188.108
Server Port:            8171Document Path:          /auth-service/health
Document Length:        2 bytesConcurrency Level:      100
Time taken for tests:   0.676 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      182000 bytes
HTML transferred:       2000 bytes
Requests per second:    1478.79 [#/sec] (mean)
Time per request:       67.623 [ms] (mean)
Time per request:       0.676 [ms] (mean, across all concurrent requests)
Transfer rate:          262.83 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
Connect:        0    9   7.2      7      32
Processing:    13   55  19.6     50     108
Waiting:       12   53  18.5     50     104
Total:         24   63  18.4     57     113Percentage of the requests served within a certain time (ms)50%     5766%     6975%     7880%     8290%     9095%     9898%    10599%    111100%    113 (longest request)
4.2、10000个请求、100并发场景
  • kong网关

    [root@localhost wrk-4.2.0]# ab -n 10000 -c 100 http://192.168.188.101:8000/auth-service/health
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.101 (be patient)
    Completed 1000 requests
    Completed 2000 requests
    Completed 3000 requests
    Completed 4000 requests
    Completed 5000 requests
    Completed 6000 requests
    Completed 7000 requests
    Completed 8000 requests
    Completed 9000 requests
    Completed 10000 requests
    Finished 10000 requestsServer Software:        kong/3.9.0.0-enterprise-edition
    Server Hostname:        192.168.188.101
    Server Port:            8000Document Path:          /auth-service/health
    Document Length:        2 bytesConcurrency Level:      100
    Time taken for tests:   1.549 seconds
    Complete requests:      10000
    Failed requests:        0
    Write errors:           0
    Total transferred:      3250520 bytes
    HTML transferred:       20000 bytes
    Requests per second:    6455.87 [#/sec] (mean)
    Time per request:       15.490 [ms] (mean)
    Time per request:       0.155 [ms] (mean, across all concurrent requests)
    Transfer rate:          2049.31 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
    Connect:        1    5   2.0      5      13
    Processing:     2   10   4.4     10      44
    Waiting:        2   10   4.0      9      42
    Total:          4   15   5.0     14      49Percentage of the requests served within a certain time (ms)50%     1466%     1675%     1880%     1990%     2395%     2598%     2899%     31100%     49 (longest request)
    
  • spring cloud gateway

[root@localhost wrk-4.2.0]# ab -n 10000 -c 100 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.108 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requestsServer Software:
Server Hostname:        192.168.188.108
Server Port:            8171Document Path:          /auth-service/health
Document Length:        2 bytesConcurrency Level:      100
Time taken for tests:   4.399 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1820000 bytes
HTML transferred:       20000 bytes
Requests per second:    2273.37 [#/sec] (mean)
Time per request:       43.988 [ms] (mean)
Time per request:       0.440 [ms] (mean, across all concurrent requests)
Transfer rate:          404.06 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
Connect:        0    4   4.7      2      36
Processing:     6   40   9.5     39      89
Waiting:        6   39   9.7     38      89
Total:         13   44   8.7     42      91Percentage of the requests served within a certain time (ms)50%     4266%     4575%     4780%     4990%     5595%     5998%     6699%     72100%     91 (longest request)
4.3、100000个请求、500并发场景
  • kong网关

    [root@localhost wrk-4.2.0]# ab -n 100000 -c 500 http://192.168.188.101:8000/auth-service/health
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.101 (be patient)
    Completed 10000 requests
    Completed 20000 requests
    Completed 30000 requests
    Completed 40000 requests
    Completed 50000 requests
    Completed 60000 requests
    Completed 70000 requests
    Completed 80000 requests
    Completed 90000 requests
    Completed 100000 requests
    Finished 100000 requestsServer Software:        kong/3.9.0.0-enterprise-edition
    Server Hostname:        192.168.188.101
    Server Port:            8000Document Path:          /auth-service/health
    Document Length:        2 bytesConcurrency Level:      500
    Time taken for tests:   14.316 seconds
    Complete requests:      100000
    Failed requests:        0
    Write errors:           0
    Total transferred:      32598168 bytes
    HTML transferred:       200000 bytes
    Requests per second:    6985.06 [#/sec] (mean)
    Time per request:       71.581 [ms] (mean)
    Time per request:       0.143 [ms] (mean, across all concurrent requests)
    Transfer rate:          2223.64 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
    Connect:        0   33  64.3     29    3032
    Processing:    13   38  18.7     35     353
    Waiting:        3   37  18.5     35     352
    Total:         23   70  67.0     65    3067Percentage of the requests served within a certain time (ms)50%     6566%     6775%     6980%     7190%     7595%     8198%     9399%    120100%   3067 (longest request)
    
  • spring cloud gateway

[root@localhost wrk-4.2.0]# ab -n 100000 -c 500 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.108 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requestsServer Software:
Server Hostname:        192.168.188.108
Server Port:            8171Document Path:          /auth-service/health
Document Length:        2 bytesConcurrency Level:      500
Time taken for tests:   41.851 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Total transferred:      18200000 bytes
HTML transferred:       200000 bytes
Requests per second:    2389.42 [#/sec] (mean)
Time per request:       209.256 [ms] (mean)
Time per request:       0.419 [ms] (mean, across all concurrent requests)
Transfer rate:          424.68 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
Connect:        0  130 711.8      2   15067
Processing:     7   73  13.3     71     285
Waiting:        6   73  13.0     70     234
Total:         19  203 712.8     74   15156Percentage of the requests served within a certain time (ms)50%     7466%     7775%     8180%     8490%    10495%   107898%   307299%   3093100%  15156 (longest request)
kong网关与Spring cloud网关的性能对比
测试场景指标Kong 网关Spring Cloud Gateway
十万 请求, 10并发请求完成时间 (秒)37.81553.754
每秒请求数 (#/sec)2644.481860.34
平均每个请求时间 (ms)3.7815.375
传输速率 (Kbytes/sec)839.31330.65
50% 响应时间 (ms)35
95% 响应时间 (ms)87
最大响应时间 (ms)2083
十万 请求, 50并发请求完成时间 (秒)17.01839.327
每秒请求数 (#/sec)5876.282542.79
平均每个请求时间 (ms)8.50919.663
传输速率 (Kbytes/sec)1865.07451.94
50% 响应时间 (ms)819
95% 响应时间 (ms)1326
最大响应时间 (ms)59162
十万 请求, 100 并发请求完成时间 (秒)15.57339.906
每秒请求数 (#/sec)6421.282505.89
平均每个请求时间 (ms)15.57339.906
传输速率 (Kbytes/sec)2031.99445.38
50% 响应时间 (ms)1538
95% 响应时间 (ms)2555
最大响应时间 (ms)76183
十万 请求, 200 并发请求完成时间 (秒)14.86141.003
每秒请求数 (#/sec)6729.092438.82
平均每个请求时间 (ms)29.72282.007
传输速率 (Kbytes/sec)2049.31433.46
50% 响应时间 (ms)2979
95% 响应时间 (ms)4298
最大响应时间 (ms)120212
十万 请求, 500 并发请求完成时间 (秒)15.05443.48
每秒请求数 (#/sec)6642.812299.91
平均每个请求时间 (ms)75.269217.4
传输速率 (Kbytes/sec)2108.14408.77
50% 响应时间 (ms)6881
95% 响应时间 (ms)961091
最大响应时间 (ms)111115144
Kong 网关在高并发情况下整体性能优于 Spring Cloud Gateway,主要体现在更快的响应时间、更高的每秒请求数以及较低的延迟波动。

相关文章:

kong 网关和spring cloud gateway网关性能测试对比

该测试只是简单在同一台机器设备对spring cloud gateway网关和kong网关进行对比&#xff0c;受限于笔者所拥有的资源&#xff0c;此处仅做简单评测。 一、使用spring boot 的auth-service作为服务提供者 该服务提供了一个/health接口&#xff0c;接口返回"OK"&…...

DDoS攻击防护能力测试:Python版脚本

引言 在互联网服务日益复杂和流量持续增长的今天&#xff0c;确保服务器能够应对高并发请求并具备良好的抗DDoS攻击的能力至关重要。声明以下代码仅在合法的前提下使用。 工具设计原理 脚本的核心在于它能够创建多个线程来并发执行不同的攻击方法&#xff0c;从而实现对目标…...

白玉微瑕:闲谈 SwiftUI 过渡(Transition)动画的“口是心非”(下)

概述 秃头小码农们都知道&#xff0c;SwiftUI 不仅仅是一个静态 UI 构建框架那么简单&#xff0c;辅以海量默认或自定义的动画和过渡&#xff08;Transition&#xff09;特效&#xff0c;我们可以将 App 界面的绚丽升华到极致。 不过&#xff0c;目前 SwiftUI 中的过渡&#x…...

5.4 解锁 OpenAI - Translator:模块设计,构建翻译系统的 “基石”

OpenAI-Translator 模块设计 OpenAI-Translator 作为一款基于 OpenAI GPT 模型的智能翻译助手,其模块设计至关重要。为了保证翻译的高效性、准确性与可扩展性,系统需要一个结构清晰、功能强大的模块化设计。本文将对 OpenAI-Translator 的各个模块进行详细解析,涵盖其核心功…...

数据分析 变异系数

目录 变异系数的应用场景包括&#xff1a; 特点&#xff1a; 注意事项&#xff1a; np.nanvar——方差&#xff0c;np.sanstd标准差 简单来讲就是平均值/标准差 变异系数&#xff08;Coefficient of Variation, CV&#xff09;是一种相对量的变异指标&#xff0c;常用于衡…...

C语言——编译与链接

目录 前言 一程序的两种环境 1翻译环境 2执行环境 二预处理 1预处理符号 2#define 2.1#define 定义标识符 2.2#define 定义宏 2.2.1#和## 2.3带副作用的宏参数 2.4宏和函数的比较 2.5命名约定 3#undef 4命令行定义 5条件编译 5.1单分支 5.2多分支 5.3判断是…...

NewStar CTF week1 web wp

谢谢皮蛋 做这题之前需要先去学习一些数据库的知识 1 order by 2 1可以理解为输入的id&#xff0c;是一个占位符&#xff0c;按第二列排序用来测试列数&#xff0c;如果没有两列则会报错-1 union select 1,2 -1同样是占位符&#xff0c;union的作用是将注入语句合并到原始语句…...

Android BitmapShader简洁实现马赛克,Kotlin(一)

Android BitmapShader简洁实现马赛克&#xff0c;Kotlin&#xff08;一&#xff09; 这一篇&#xff0c; Android使用PorterDuffXfermode模式PorterDuff.Mode.SRC_OUT橡皮擦实现马赛克效果&#xff0c;Kotlin&#xff08;3&#xff09;-CSDN博客 基于PorterDuffXfermode实现马…...

NavVis手持激光扫描帮助舍弗勒快速打造“数字孪生”工厂-沪敖3D

在全球拥有近100家工厂的舍弗勒&#xff0c;从2016年开启数字化运营进程&#xff0c;而当前制造、库存、劳动力和物流的数字化&#xff0c;已无法支持其进一步简化工作流程&#xff0c;亟需数字化物理制造环境&#xff0c;打造“数字孪生”工厂。 NavVis为其提供NavVis VLX 3…...

web服务器 网站部署的架构

WEB服务器工作原理 Web web是WWW(World Wide Web)的简称&#xff0c;基本原理是&#xff1a;请求(客户端)与响应(服务器端)原理&#xff0c;由遍布在互联网中的Web服务器和安装了Web浏览器的计算机组成 客户端发出请求的方式&#xff1a;地址栏请求、超链接请求、表单请求 …...

ecovadis验厂相关要求

EcoVadis验厂的相关要求主要包括以下几个方面&#xff1a; 一、企业基本资质要求 合法注册与运营&#xff1a;企业必须是合法注册并运营的法人实体&#xff0c;具备合法的经营资质&#xff0c;如营业执照、税务登记证等。无严重违法记录&#xff1a;在过去三年内&#xff0c;…...

SSM开发(一)JAVA,javaEE,spring,springmvc,springboot,SSM,SSH等几个概念区别

目录 JAVA 框架 javaEE spring springmvc springboot SSM SSH maven JAVA 一种面向对象、高级编程语言&#xff0c;Python也是高级编程语言&#xff1b;不是框架(框架&#xff1a;一般用于大型复杂需求项目&#xff0c;用于快速开发)具有三大特性&#xff0c;所谓Jav…...

Spring Boot中选择性加载Bean的几种方式

说明&#xff1a;用过Spring框架的都知道其自动装配的特性&#xff0c;本文介绍几种选择性加载Bean的方式。Spring自动装配参考以下两篇文章&#xff1a; 基于SpringBoot的三层架构开发&统一响应结果 SpringBoot自动装配原理简单分析 ConditionalOnProperty Conditiona…...

【JVM】垃圾收集器详解

你将学到 1. Serial 收集器 2. ParNew 收集器 3. Parallel Scavenge 收集器 4. Serial Old 收集器 5. Parallel Old 收集器 6. CMS 收集器 7. G1 收集器 在 Java 中&#xff0c;垃圾回收&#xff08;GC&#xff09;是自动管理内存的一个重要机制。HotSpot JVM 提供了多种…...

【实用技能】如何在Stimulsoft产品中使用用户函数,快速创建报表及仪表盘

Stimulsoft Ultimate &#xff08;原Stimulsoft Reports.Ultimate&#xff09;是用于创建报表和仪表板的通用工具集。该产品包括用于WinForms、ASP.NET、.NET Core、JavaScript、WPF、PHP、Java和其他环境的完整工具集。无需比较产品功能&#xff0c;Stimulsoft Ultimate包含了…...

MySQL四种隔离级别

MySQL的隔离级别是在事务这个大主题下面产生的说法。 那么什么是事务&#xff0c;事务就是一组sql语句&#xff0c;要么全部执行成功&#xff0c;要么都不执行&#xff0c;不能只执行成功其中的部分sql。事务的最终目的是为了保证数据库数据的完整性、一致性和可用性。 要保…...

Unity入门1

安装之后无法获得许可证&#xff0c;可以考虑重装 新建项目 单击空白处生成脚本 双击c#文件 会自动打开vstudio 检查引用 如果没有引用&#xff0c;重开vstu&#xff0c;或者重新加载项目 hierarchy层级 scenes场景 assets资产 inspector督察 icon图标 资源链接&…...

qml Loader详解

1、概述 QML Loader是Qt Quick框架中的一个关键元素&#xff0c;它允许开发者动态地加载和卸载QML组件。这种动态加载机制对于提升应用程序的性能、响应速度和用户体验至关重要。通过Loader&#xff0c;应用程序可以在需要时才加载特定的组件&#xff0c;而不是在启动时一次性…...

《安富莱嵌入式周报》第349期:VSCode正式支持Matlab调试,DIY录音室级麦克风,开源流体吊坠,物联网在军工领域的应用,Unicode字符压缩解压

周报汇总地址&#xff1a;嵌入式周报 - uCOS & uCGUI & emWin & embOS & TouchGFX & ThreadX - 硬汉嵌入式论坛 - Powered by Discuz! 视频版&#xff1a; 《安富莱嵌入式周报》第349期&#xff1a;VSCode正式支持Matlab调试&#xff0c;DIY录音室级麦克风…...

web端ActiveMq测试工具

如何用vue3创建简单的web端ActiveMq测试工具&#xff1f; 1、复用vue3模板框架 创建main.js,引入APP文件&#xff0c;createApp创建文件&#xff0c;并加载element插件&#xff0c;然后挂载dom节点 2、配置vue.config.js脚本配置 mport { defineConfig } from "vite&qu…...

1561. 你可以获得的最大硬币数目

class Solution:def maxCoins(self, piles: List[int]) -> int:piles.sort()res,n0,len(piles)for i in range(n//3):respiles[n-2-2*i]return res这里如果"你"想要获取最大&#xff0c;那么从最大的开始找 每隔俩算一个最大累计&#xff0c;Bob默认自己从最小那找…...

NIO | 什么是Java中的NIO —— 结合业务场景理解 NIO (二)

实时通信应用 的主流技术 并非NIO &#xff0c; 整理本文的目的是 更好的理解 NIO 。 在现代的 即时聊天应用中&#xff0c;使用 WebSocket、MQTT 或 SignalR 等协议更为普遍。 若您想了解 当前主流的有关 实时通信应用 的技术 &#xff0c; 请移步他文。 (一) 业务场景 实…...

GD32L233RB 驱动数码管

1.数码管有8段A、B、C、D、E、F、G 和 H小数点 以及片选信号&#xff08;DIG&#xff09; DIG用来选择那一位&#xff0c;A-G 用来显示段 静态显示每次只能一次显示单个位 动态显示&#xff08;动态扫描&#xff09;所有的位显示结束要在10ms左右 显示2ms 消光1ms 实…...

AIGC视频生成模型:Stability AI的SVD(Stable Video Diffusion)模型

大家好&#xff0c;这里是好评笔记&#xff0c;公主号&#xff1a;Goodnote&#xff0c;专栏文章私信限时Free。本文详细介绍Stability AI的视频生成模型SVD(Stable Video Diffusion)模型&#xff0c;这家公司在图像生成领域富有盛名&#xff0c;开发并维护了知名开源项目SD系列…...

Linux 系统错误处理简介

Linux 系统错误处理简介 1. errno&#xff1a;错误代码的载体2. strerror()&#xff1a;错误信息的翻译官3. perror()&#xff1a;便捷的错误信息输出4. 系统调用与库函数的区别5. 错误处理的最佳实践 在 C/C 程序开发中&#xff0c;我们经常需要处理各种错误情况 Linux 系统提…...

systemC示例

main.cpp #include <memory> using namespace std; #include "top.h" int sc_main(int i, char *av[]) { // 关闭关于 IEEE 1666 标准中过时特性的警告 sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", SC_DO_NOTHING); cout <…...

C++打字模拟

改进于 文宇炽筱_潜水 c版的打字效果_c自动打字-CSDN博客https://blog.csdn.net/2401_84159494/article/details/141023898?ops_request_misc%257B%2522request%255Fid%2522%253A%25227f97863ddc9d1b2ae9526f45765b1744%2522%252C%2522scm%2522%253A%252220140713.1301023…...

国产低功耗带LCD驱动和触摸按键功能的MCU

以下是国产低功耗、集成LCD驱动和触摸按键功能的MCU精选型号及其核心特性&#xff0c;结合性能、功耗和适用场景进行综合推荐&#xff1a; 1.灵动微MM32L0130系列 257 核心特性&#xff1a;低功耗&#xff1a;待机模式功耗低至100nA&#xff0c;支持多种低功耗模式。 LCD驱动&a…...

在 imx93 平台调试 nau88c10 声卡

一、环境介绍 linux 版本&#xff1a;6.6.52 soc&#xff1a;imx9331 codec&#xff1a;nau88c10 使用的内核文件为 Image&#xff0c;dtb 文件为&#xff1a;imx93-11x11-evk.dtb 二、硬件检查 i2s 信号线要接对 i2c 控制信号建议为 4.7k 上拉 codec 供电可以按参考设计…...

机器学习-分类算法评估标准

一. 准确率 accuracy 将预测结果和测试集的目标值比较&#xff0c;计算预测正确的百分比 准确率越高说明模型效果越好 from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier #加载鸢尾花…...

美区TikTok解封后如何回归使用?

随着2025年初美区TikTok解封的消息引起了广泛关注&#xff0c;许多用户纷纷开始重新关注这一全球最受欢迎的短视频平台。在经历了数月的禁用期后&#xff0c;TikTok在美国市场的回归&#xff0c;代表了这一平台的巨大潜力和挑战。从用户的使用习惯&#xff0c;到平台的内容策略…...

行人识别检测数据集,yolo格式,PASICAL VOC XML,COCO JSON,darknet等格式的标注都支持,准确识别率可达99.5%

作者简介&#xff1a; 高科&#xff0c;先后在 IBM PlatformComputing从事网格计算&#xff0c;淘米网&#xff0c;网易从事游戏服务器开发&#xff0c;拥有丰富的C&#xff0c;go等语言开发经验&#xff0c;mysql&#xff0c;mongo&#xff0c;redis等数据库&#xff0c;设计模…...

grafana + Prometheus + node_exporter搭建监控大屏

本文介绍生产系统监控大屏的搭建&#xff0c;比较实用也是实际应用比较多的方式&#xff0c;希望能够帮助大家对监控系统有一定的认识。 0、规划 grafana主要是展示和报警&#xff0c;Prometheus用于保存监控数据&#xff0c;node_exporter用于实时采集各个应用服务器的事实状…...

【腾讯云】docker创建网络遇到Unable to enable SKIP DNAT rule

docker创建网络遇到Unable to enable SKIP DNAT rule 背景 今天打算在服务器上安装es,但是在创建网络时&#xff0c;提示 Error response from daemon: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER…...

DeepSeek R1模型解读与使用

DeepSeek在推出R1预览版两个月后&#xff0c;发布了R1的正式版本&#xff0c;并且开源了模型&#xff0c;开放了API调用。我们直接来解读一下这款模型。 这是官方的性能评测图。从左到右分别是DeepSeek-R1&#xff0c;o1正式版&#xff0c;32B蒸馏版R1&#xff0c;o1-mini&…...

AI新玩法:Flux.1图像生成结合内网穿透远程生图的解决方案

文章目录 前言1. 本地部署ComfyUI2. 下载 Flux.1 模型3. 下载CLIP模型4. 下载 VAE 模型5. 演示文生图6. 公网使用 Flux.1 大模型6.1 创建远程连接公网地址 7. 固定远程访问公网地址 前言 在这个AI技术日新月异的时代&#xff0c;图像生成模型已经成为了创意工作者和开发者手中…...

api开发如何确保通过非官方库解析口令的合法性?

通过非官方库解析淘宝口令可能存在违反淘宝平台规则以及法律法规的风险&#xff0c;很难完全确保其合法性。如果确实有需求&#xff0c;可从以下几个方面尽量降低风险&#xff0c;提高合法性&#xff1a; 了解法律法规 《中华人民共和国网络安全法》&#xff1a;需确保解析行为…...

第6章 ThreadGroup详细讲解(Java高并发编程详解:多线程与系统设计)

1.ThreadGroup 与 Thread 在Java程序中&#xff0c; 默认情况下&#xff0c; 新的线程都会被加入到main线程所在的group中&#xff0c; main线程的group名字同线程名。如同线程存在父子关系一样&#xff0c; Thread Group同样也存在父子关系。图6-1就很好地说明了父子thread、父…...

如何使用Python脚本将本地项目上传到 GitHub

前言 这里我们通过创建一个新的github仓库&#xff0c;来测试我们的脚本能否上传我们本地的项目&#xff0c;并且进行更新。首先你需要先安装 Git&#xff0c;关于这部分我好像没有记录过&#xff0c;这里我搜索看了一下&#xff0c;这篇博客写的Git安装详解应该是比较齐全的&…...

css动画水球图

由于echarts水球图动画会导致ios卡顿&#xff0c;所以纯css模拟 展示效果 组件 <template><div class"water-box"><div class"water"><div class"progress" :style"{ --newProgress: newProgress % }"><…...

Shellcode

什么是shellcode shellcode通常是软件漏洞利用过程中使用一小段机器代码 作用 1.启动shell&#xff0c;进行交互 2.打开服务器端口等待连接 3.反向连接端口 4.。。。 如何编写shellcode 1.设置rdi指向/bin/sh 2.rsi0,rdx0 3.rax0x3b 4.syscall进行系统调用 64位系统…...

Element使用表单重置如果不使用prop,重置无法生效

文章目录 为什么需要 prop&#xff1f;示例&#xff1a;使用 prop 的正确方式关键点总结 在 element-ui 的 el-form 组件中&#xff0c; prop 属性是与表单验证和表单字段绑定密切相关的&#xff0c;尤其在使用 resetFields() 重置表单数据时。 如果不使用 prop&#xff0…...

[Qt]系统相关-网络编程-TCP、UDP、HTTP协议

目录 前言 一、UDP网络编程 1.Qt项目文件 2.UDP类 QUdpSocket QNetworkDatagram 3.UDP回显服务器案例 细节 服务器设计 客户端设计 二、TCP网络编程 1.TCP类 QTcpServer QTcpSocket 2.TCP回显服务器案例 细节 服务器设计 客户端设计 三、HTTP客户端 1.HTTP…...

两台局域网电脑通过飞秋传输大文件失败的解决方案

问题描述&#xff1a; 局域网两台电脑之间传输大文件&#xff08;超过20G&#xff09;&#xff0c;不想太复杂&#xff0c;就各装个飞秋。但是通过直接发送文件发现总是失败&#xff0c;一会就中断了。 解决方法&#xff1a; 主界面上有一个文件共享的按钮&#xff0c;通过文…...

安卓程序作为web服务端的技术实现(二):Room 实现数据存储

已经实现web服务器安卓程序作为web服务端的技术实现&#xff1a;AndServer 实现登录权限拦截-CSDN博客 现在需要和正常web项目类似&#xff0c;那么就需要操作数据库 一般web项目都是选择较为重型的数据库如MySQL&#xff0c;SQL server等 这里是安卓项目&#xff0c;我目前…...

代码工艺:实践 Spring Boot TDD 测试驱动开发

TDD 的核心理念是 “先写测试&#xff0c;再写功能”&#xff0c;其过程遵循一个严格的循环&#xff0c;即 Red-Green-Refactor&#xff1a; TDD 的流程 1. Red&#xff08;编写失败的测试&#xff09; 根据需求&#xff0c;先编写一个测试用例&#xff0c;描述期望的行为。…...

MySQL命令及用法(精华版)

目录 DDL&#xff08;数据定义语言&#xff09; 数据库操作 表操作 DML&#xff08;数据操作语言&#xff09; DQL&#xff08;数据查询语言&#xff09; 基本查询 条件查询 聚合函数 分组查询 排序查询 分页查询 DCL&#xff08;数据控制语言&#xff09; 用户…...

73,【5】BUUCTF WEB [网鼎杯 2020 玄武组]SSRFMe(未解出)

进入靶场 又是代码又是代码又是代码又是代码又是代码又是代码又是代码又是代码又是代码又是代码又是代码又是代码又是代码又是代码 <?php // 检查 URL 是否为内部 IP 地址 function check_inner_ip($url) {// 使用正则表达式检查 URL 格式是否以 http、https、gopher 或 d…...

修改word的作者 最后一次保存者 总编辑时间 创建时间 最后一次保存的日期

作者&#xff1a; 1.打开word文件 2.点击左上角的文件 3.选项 4.用户信息 5.将用户信息中的 姓名改为你需要的名字 最后一次保存者 1.word重命名为.zip文件 2.docProps中有个core.xml 3.用记事本打开有个lastModifiedBy标签&#xff0c;将里面内容改为你需要的名字 总编辑时…...

深入MapReduce——引入

引入 前面我们已经深入了HDFS的设计与实现&#xff0c;对于分布式系统也有了不错的理解。 但HDFS仅仅解决了海量数据存储和读写的问题。要想让数据产生价值&#xff0c;一定是需要从数据中挖掘出价值才行&#xff0c;这就需要我们拥有海量数据的计算处理能力。 下面我们还是…...