八,iperf3源代码分析:状态机及状态转换过程--->运行正向TCP单向测试时的客户端代码

本文主要是介绍八,iperf3源代码分析:状态机及状态转换过程--->运行正向TCP单向测试时的客户端代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

本文目录

  • 一、测试用命令
  • 二、客户端与服务端测试业务控制流程与状态机交换
  • 三、iperf3客户端状态机中各个状态解析
    • 状态机迁移图
    • 运行正向TCP单向测试时的客户端的状态列表
  • 四、iperf3客户端状态机迁移分析
    • A-初始化测试对象(NA--->初始化状态):
    • B-建立控制连接,等待服务端PARAM_EXCHANGE的指令(初始化状态--->PARAM_EXCHANGE状态):
    • C-完成服务端与客户端的配置参数交换(PARAM_EXCHANGE状态--->CREATE_STREAM状态):
    • D-发起创建TCP测试链接(CREATE_STREAM状态--->TEST_START状态):
    • E-创建客户端为TCP测试流使用的各种定时器及其它资源(TEST_START状态--->TEST_RUNNING状态):
    • F-发送TCP测试数据流,直到本次测试结束(TEST_RUNNING状态--->TEST_END状态):
    • G-不做什么,等待服务端下一条指令(TEST_END状态--->EXCHANGE_RESULT状态):
    • H-把测试结果发送给服务端(EXCHANGE_RESULT状态--->DISPLAY_RESULTS状态) :
    • I-打印测试报告,并向服务端发IPERF_DONE指令(DISPLAY_RESULTS状态--->IPERF_DONE状态):
    • J-本次测试完成,释放所有资源,退出iperf3客户端程序(IPERF_DONE状态--->NA):

这里描述的是iperf3进行单向TCP正向流测试时的iperf3客户端的状态机转换过程,以及转换过程中的代码调用关系。通过前面的iperf3代码主要架构分析之main函数主要流程我们已经知道iperf3虽然是C语言编写的,但它是以面向对象的方式实现的,所以本文中讲述的状态机是以每个测试对象(即为每次测试实例的运行过程创建一个测试对象,从测试开始到测试进行到测试结束输入测试报告管理测试实例的整个生命周期)为单位的。每个测试对象都拥有独立的状态机。所以这里同时也引也客户端和服务端都有自己的独立的状态机,服务端和客户端的状态会通过控制链接相互同步。

一、测试用命令

在正常的测试过程中,使用如下图描述的命令启动iperf3进行单向TCP正向流测试:

  • 服务端
iperf3 -s
  • 客户端
    总共发送8K数据,每次发送1K
iperf3 -c 127.0.0.1 -n 8K -l 1K

二、客户端与服务端测试业务控制流程与状态机交换

在进行TCP业务测试时,客户端与服务端有一个动态的业务控制流程,其中还要同步二侧的状态机,以保证测试业务逻辑的完整性,参照:九,iperf3源代码分析:正向TCP单向测试时服务端和客户端的交互过程详解

三、iperf3客户端状态机中各个状态解析

状态机迁移图

有限状态机编程通常是由当前状态,事件+条件,动作,状态迁移(或称为目标状态)的五元组组成的。所以下面我们也会用这五元组来描述状态。如图所示,iperf3客户端在正常情况下(客户端启动测试后,就一直跑到测试完成,中途不中断测试)有9个状态。状态迁移方向如如箭头所示,状态迁移发生的”事件+条件“由箭头上的字母标识,会在下一章中详细解析。
在这里插入图片描述

运行正向TCP单向测试时的客户端的状态列表

  • 初始化状态
  • PARAM_EXCHANGE状态
  • CREATE_STREAM状态
  • TEST_START状态
  • TEST_RUNNING状态
  • TEST_END状态
  • EXCHANGE_RESULT状态
  • DISPLAY_RESULT状态
  • IPERF_DONE状态

四、iperf3客户端状态机迁移分析

这一章节描述各个状态下有限状态机迁移五元组源代码调用过程。

A-初始化测试对象(NA—>初始化状态):

服务端开始运行,创建测试对象后,对象状态会直接初始化初始化状态,函数调用关系如下

-----------------------------------------------------------------------------------
debug out: func = main                     ,line =   62, file = main.c
debug out: func = iperf_new_test           ,line = 2748, file = iperf_api.c
debug out: func = iperf_defaults           ,line = 2812, file = iperf_api.c
debug out: func = iperf_parse_arguments    ,line = 1136, file = iperf_api.c
debug out: test state is 0 
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态
事件+条件perf3做为客户端被启动运行
动作A-初始化测试对象
下一状态初始化状态

B-建立控制连接,等待服务端PARAM_EXCHANGE的指令(初始化状态—>PARAM_EXCHANGE状态):

根据用户的输入参数,向服务端发起连接请求,等链接建立成功后,调用iperf_handle_message_client()函数来等待服务端发送过来的“准备好做PARAM_EXCHANGE的指令”(通过test->ctrl_sck指向的控制链接) 。

......
-----------------------------------------------------------------------------------
debug out: func = main                     ,line =   62, file = main.c
debug out: func = iperf_new_test           ,line = 2748, file = iperf_api.c
debug out: func = iperf_defaults           ,line = 2812, file = iperf_api.c
debug out: func = iperf_parse_arguments    ,line = 1136, file = iperf_api.c
debug out: test state is 0 
-----------------------------------------------------------------------------------
debug out: func = run                      ,line =  145, file = main.c
debug out: func = run                      ,line =  196, file = main.c
debug out: func = iperf_run_client         ,line =  536, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  566, file = iperf_client_api.c
debug out: func = iperf_connect            ,line =  376, file = iperf_client_api.c
debug out: func = make_cookie              ,line =  119, file = iperf_util.c
debug out: func = netdial                  ,line =  237, file = net.c
debug out: create control link
debug out: func = create_socket            ,line =  129, file = net.c
debug out: func = timeout_connect          ,line =   87, file = net.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 0 to 9
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态初始化状态
事件+条件无条件向下执行
动作B-建立控制连接,等待服务端PARAM_EXCHANGE的指令
下一状态PARAM_EXCHANGE状态

C-完成服务端与客户端的配置参数交换(PARAM_EXCHANGE状态—>CREATE_STREAM状态):

在收以服务端发过来的PARAM_EXCHANGE指令后,调用iperf_exchange_parameters函数,通过控制链接向服务端发送配置参数,完成服务端与客户端的参数交换后,重新调用iperf_handle_message_client()等待服务端发送CREATE_STREAM指令

......
-----------------------------------------------------------------------------------
debug out: func = run                      ,line =  145, file = main.c
debug out: func = run                      ,line =  196, file = main.c
debug out: func = iperf_run_client         ,line =  536, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  566, file = iperf_client_api.c
debug out: func = iperf_connect            ,line =  376, file = iperf_client_api.c
debug out: func = make_cookie              ,line =  119, file = iperf_util.c
debug out: func = netdial                  ,line =  237, file = net.c
debug out: create control link
debug out: func = create_socket            ,line =  129, file = net.c
debug out: func = timeout_connect          ,line =   87, file = net.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 0 to 9
-----------------------------------------------------------------------------------
debug out: func = iperf_exchange_parameters,line = 2076, file = iperf_api.c
debug out: func = send_parameters          ,line = 2160, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  908, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  921, file = iperf_api.c
Connecting to host 127.0.0.1, port 5201
debug out: func = iperf_on_connect         ,line =  952, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 9 to 10
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态PARAM_EXCHANGE状态
事件+条件收到服务端发过来的PARAM_EXCHANGE指令
动作C-完成服务端与客户端的配置参数交换,等待服务端的下一条指令
下一状态CREATE_STREAM状态

D-发起创建TCP测试链接(CREATE_STREAM状态—>TEST_START状态):

在收到服务端发过来的CREATE_STREAM指令后,调用iperf_create_streams函数,创建本次新的TCP测试流实例 ,重新调用iperf_handle_message_client()等待服务端发起的TEST_START指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_exchange_parameters,line = 2076, file = iperf_api.c
debug out: func = send_parameters          ,line = 2160, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  908, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  921, file = iperf_api.c
Connecting to host 127.0.0.1, port 5201
debug out: func = iperf_on_connect         ,line =  952, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 9 to 10
-----------------------------------------------------------------------------------
debug out: func = iperf_create_streams     ,line =   69, file = iperf_client_api.c
debug out: func = create_socket            ,line =  129, file = net.c
debug out: func = iperf_new_stream         ,line = 4241, file = iperf_api.c
debug out: func = iperf_add_stream         ,line = 4453, file = iperf_api.c
[  5] local 127.0.0.1 port 59494 connected to 127.0.0.1 port 5201
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 10 to 1
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态CREATE_STREAM状态
事件+条件收到服务端发起的CREATE_STREAM指令
动作D-发起创建TCP测试链接,等待服务端的TEST_START指令
下一状态TEST_START状态

E-创建客户端为TCP测试流使用的各种定时器及其它资源(TEST_START状态—>TEST_RUNNING状态):

进入TEST_START状态后,无条件的开始创建客户端为TCP测试流使用的各种定时器及其它资源,然后等待服务端发过来TEST_RUNNING指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 10 to 1
-----------------------------------------------------------------------------------
debug out: func = iperf_init_test          ,line = 1972, file = iperf_api.c
debug out: func = create_client_timers     ,line =  179, file = iperf_client_api.c
debug out: func = create_client_omit_timer ,line =  234, file = iperf_client_api.c
debug out: func = iperf_create_send_timers ,line = 2011, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 1 to 2
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态TEST_START状态
事件+条件进入TEST_START状态后,无条件开始以下动作
动作E-创建客户端为TCP测试流使用的各种定时器及其它资源
下一状态TEST_RUNNING状态

F-发送TCP测试数据流,直到本次测试结束(TEST_RUNNING状态—>TEST_END状态):

调用iperf_run_client函数,直接进入TEST_RUNNING分支后,调用iperf_send函数里的sp->snd和test->protocol->send二个函数指针,最终调用iperf_tcp_send()函数向服务端发送测试数据开始测试,直到本次测试结束后进入到TEST_END状态,并向服务端发送TEST_END指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_init_test          ,line = 1972, file = iperf_api.c
debug out: func = create_client_timers     ,line =  179, file = iperf_client_api.c
debug out: func = create_client_omit_timer ,line =  234, file = iperf_client_api.c
debug out: func = iperf_create_send_timers ,line = 2011, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 1 to 2
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  633, file = iperf_client_api.c
debug out: func = iperf_send               ,line = 1890, file = iperf_api.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_stats_callback     ,line = 3237, file = iperf_api.c
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
wangsheng: set the state from 2 to 4
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态TEST_RUNNING状态
事件+条件进入TEST_RUNNING状态后,无条件开始以下动作
动作F-发送TCP测试数据流,直到本次测试结束
下一状态TEST_END状态

G-不做什么,等待服务端下一条指令(TEST_END状态—>EXCHANGE_RESULT状态):

调用iperf_handle_message_client()等待服务端发过来的EXCHANGE_RESULT指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_stats_callback     ,line = 3237, file = iperf_api.c
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
wangsheng: set the state from 2 to 4
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 4 to 13
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态TEST_END状态
事件+条件收到服务端发过来的EXCHANGE_RESULT指令
动作G-不做什么,等待服务端下一条指令
下一状态EXCHANGE_RESULT状态

H-把测试结果发送给服务端(EXCHANGE_RESULT状态—>DISPLAY_RESULTS状态) :

进入EXCHANGE_RESULT状态后,服务端无条件调用iperf_exchange_result()函数,向服务端发送的测试报告后等待服务商端发过来的DISPLAY_RESULTS指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 4 to 13
-----------------------------------------------------------------------------------
debug out: func = iperf_exchange_results   ,line = 2134, file = iperf_api.c
debug out: func = send_results             ,line = 2367, file = iperf_api.c
debug out: func = get_results              ,line = 2488, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 13 to 14
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态EXCHANGE_RESULT状态
事件+条件进入EXCHANGE_RESULT状态后,无条件开始以下动作
动作H-把测试结果发送给服务端,等待服务端发过来的下一条指令
下一状态DISPLAY_RESULTS状态

I-打印测试报告,并向服务端发IPERF_DONE指令(DISPLAY_RESULTS状态—>IPERF_DONE状态):

进入DISPLAY_RESULTS状态后,客户端主动发起打印测试报告,并向服务端发IPERF_DONE指令。

......
debug out: func = iperf_exchange_results   ,line = 2134, file = iperf_api.c
debug out: func = send_results             ,line = 2367, file = iperf_api.c
debug out: func = get_results              ,line = 2488, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 13 to 14
-----------------------------------------------------------------------------------
debug out: func = iperf_client_end         ,line =  490, file = iperf_client_api.c
debug out: func = iperf_reporter_callback  ,line = 4075, file = iperf_api.c
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0    320 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0             sender
[  5]   0.00-0.00   sec  4.00 KBytes  36.8 Mbits/sec                  receiver
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
debug out: set the state from 14 to 16
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态DISPLAY_RESULTS状态
事件+条件进入DISPLAY_RESULTS状态后,无条件开始以下动作
动作I-打印测试报告,并向服务端发IPERF_DONE指令
下一状态IPERF_DONE状态

J-本次测试完成,释放所有资源,退出iperf3客户端程序(IPERF_DONE状态—>NA):

进入IPERF_DONE状态后,释放所有资源,退出iperf3客户端程序,本次测试完成。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_client_end         ,line =  490, file = iperf_client_api.c
debug out: func = iperf_reporter_callback  ,line = 4075, file = iperf_api.c
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0    320 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0             sender
[  5]   0.00-0.00   sec  4.00 KBytes  36.8 Mbits/sec                  receiver
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
wangsheng: set the state from 14 to 16
-----------------------------------------------------------------------------------
iperf Done.
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态IPERF_DONE状态
事件+条件进入IPERF_DONE状态后,无条件开始以下动作
动作J-本次测试完成,释放所有资源,退出iperf3客户端程序
下一状态NA

这篇关于八,iperf3源代码分析:状态机及状态转换过程--->运行正向TCP单向测试时的客户端代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/715477

相关文章

Redis连接失败:客户端IP不在白名单中的问题分析与解决方案

《Redis连接失败:客户端IP不在白名单中的问题分析与解决方案》在现代分布式系统中,Redis作为一种高性能的内存数据库,被广泛应用于缓存、消息队列、会话存储等场景,然而,在实际使用过程中,我们可能... 目录一、问题背景二、错误分析1. 错误信息解读2. 根本原因三、解决方案1. 将客户端IP添加到Re

SpringBoot基于MyBatis-Plus实现Lambda Query查询的示例代码

《SpringBoot基于MyBatis-Plus实现LambdaQuery查询的示例代码》MyBatis-Plus是MyBatis的增强工具,简化了数据库操作,并提高了开发效率,它提供了多种查询方... 目录引言基础环境配置依赖配置(Maven)application.yml 配置表结构设计demo_st

JAVA中整型数组、字符串数组、整型数和字符串 的创建与转换的方法

《JAVA中整型数组、字符串数组、整型数和字符串的创建与转换的方法》本文介绍了Java中字符串、字符数组和整型数组的创建方法,以及它们之间的转换方法,还详细讲解了字符串中的一些常用方法,如index... 目录一、字符串、字符数组和整型数组的创建1、字符串的创建方法1.1 通过引用字符数组来创建字符串1.2

SpringCloud集成AlloyDB的示例代码

《SpringCloud集成AlloyDB的示例代码》AlloyDB是GoogleCloud提供的一种高度可扩展、强性能的关系型数据库服务,它兼容PostgreSQL,并提供了更快的查询性能... 目录1.AlloyDBjavascript是什么?AlloyDB 的工作原理2.搭建测试环境3.代码工程1.

Java调用Python代码的几种方法小结

《Java调用Python代码的几种方法小结》Python语言有丰富的系统管理、数据处理、统计类软件包,因此从java应用中调用Python代码的需求很常见、实用,本文介绍几种方法从java调用Pyt... 目录引言Java core使用ProcessBuilder使用Java脚本引擎总结引言python

最新版IDEA配置 Tomcat的详细过程

《最新版IDEA配置Tomcat的详细过程》本文介绍如何在IDEA中配置Tomcat服务器,并创建Web项目,首先检查Tomcat是否安装完成,然后在IDEA中创建Web项目并添加Web结构,接着,... 目录配置tomcat第一步,先给项目添加Web结构查看端口号配置tomcat    先检查自己的to

Java中ArrayList的8种浅拷贝方式示例代码

《Java中ArrayList的8种浅拷贝方式示例代码》:本文主要介绍Java中ArrayList的8种浅拷贝方式的相关资料,讲解了Java中ArrayList的浅拷贝概念,并详细分享了八种实现浅... 目录引言什么是浅拷贝?ArrayList 浅拷贝的重要性方法一:使用构造函数方法二:使用 addAll(

Redis主从复制实现原理分析

《Redis主从复制实现原理分析》Redis主从复制通过Sync和CommandPropagate阶段实现数据同步,2.8版本后引入Psync指令,根据复制偏移量进行全量或部分同步,优化了数据传输效率... 目录Redis主DodMIK从复制实现原理实现原理Psync: 2.8版本后总结Redis主从复制实

JAVA利用顺序表实现“杨辉三角”的思路及代码示例

《JAVA利用顺序表实现“杨辉三角”的思路及代码示例》杨辉三角形是中国古代数学的杰出研究成果之一,是我国北宋数学家贾宪于1050年首先发现并使用的,:本文主要介绍JAVA利用顺序表实现杨辉三角的思... 目录一:“杨辉三角”题目链接二:题解代码:三:题解思路:总结一:“杨辉三角”题目链接题目链接:点击这里

Linux使用nohup命令在后台运行脚本

《Linux使用nohup命令在后台运行脚本》在Linux或类Unix系统中,后台运行脚本是一项非常实用的技能,尤其适用于需要长时间运行的任务或服务,本文我们来看看如何使用nohup命令在后台... 目录nohup 命令简介基本用法输出重定向& 符号的作用后台进程的特点注意事项实际应用场景长时间运行的任务服