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

【基于鲲鹏及openEuler20.03TLS下MySQL8.0.17性能调优】

【基于鲲鹏及openEuler20.03TLS下MySQL8.0.17性能调优】

    • 一、环境说明
    • 二、实验过程
    • 三、实验小结

一、环境说明

  • 华为云ECS 规格:8vCPU 32G arm架构
  • 操作系统:openEuler 20.03.TLS
  • MySQL版本:8.0.17

二、实验过程

  1. 创建用户及用户组:

    groupadd mysql
    useradd -g mysql mysql
    passwd mysql
    

    创建数据目录:

    mkdir -p /data/mysql
    cd /data/mysql
    mkdir data tmp run log relaylogchown -R mysql:mysql /data
    ll /
    
  2. 安装依赖
    修改yum源:

    sed -i "s/gpgcheck=1/gpgcheck=0/g" /etc/yum.repos.d/openEuler.repo
    yum -y install bison ncurses ncurses-devel libaio-devel openssl openssl-devel gmp gmp-devel mpfr mpfr-devel libmpc libmpc-devel wget tar gcc gcc-c++ git rpcgen cmake libtirpc-devel openldap-devel openldap net-tools java --skip-broken --allowerasing
    yum install java -y --nobest
    

    或者

    yum -y install  bison ncurses ncurses-devel libaio-devel openssl openssl-devel gmp gmp-devel mpfr mpfr-devel libmpc libmpc-devel wget tar gcc gcc-c++ git rpcgen cmake libtirpc libtirpc-devel openldap-devel openldap net-tools doxygen java --skip-broken --allowerasing --nobest
    

    以下是openEuler操作系统需要做的:
    vim /etc/yum.repos.d/openEuler.repo,修改的地方如下所示:

    [update]
    name=update
    baseurl=https://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS/update/$basearch/
    enabled=1
    gpgcheck=0
    gpgkey=https://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
    

    yum源生效:

    yum clean all 
    yum makecacheyum list libtirpc
    yum update -y libtirpc
    yum list libtirpc-devel
    yum install -y libtirpc-devel.aarch64
    
  3. 升级cmake

    • 下载
      cd /home
      wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz --no-check-certificate
      
    • 解压
      tar -zxvf cmake-3.5.2.tar.gz
      cd cmake-3.5.2
      ./bootstrap
      
    • 查看cpu核心数
      cat /proc/cpuinfo | grep processor | wc -l
      
    • 编译及安装:-j 后面的16为cpu核心数的整数倍,这里是2倍
      make -j 16
      make install
      

    3.5 确认CMake的版本是否为3.5.2。

    hash -r
    /usr/local/bin/cmake --version
    
  4. 确认GCC的版本是否为7.3.0 默认是7.3.0 (openEuler操作系统 默认就是7.3.0不需要升级)这里贴出的是centos7.6版本需要手动升级gcc,如下所示:

    cd /home
    wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.gz --no-check-certificate
    tar -xvf gcc-7.3.0.tar.gz
    cd /home/gcc-7.3.0
    ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-bootstrap
    make -j 16
    make -j 16 install
    gcc -v
    
  5. 安装编译MySQL

    cd /home
    wget https://downloads.mysql.com/archives/get/p/23/file/mysql-boost-8.0.17.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-8.0.17.tar.gz
    cd /home/mysql-8.0.17
    mkdir build
    cd build
    cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data -DWITH_BOOST=/home/mysql-8.0.17/boost/boost_1_69_0
    

    cmake成功后,进行编译安装:

    make -j 16
    make -j 16 install
    

    之后,查看MySQL版本信息:

    ls /usr/local/mysql/
    /usr/local/mysql/bin/mysql --version
    
  6. 运行MySQL

    配置可参考:鲲鹏社区官网

    https://www.hikunpeng.com/document/detail/zh/kunpengdbs/ecosystemEnable/MySQL/kunpengmysql8017_03_0013.html
    

    具体步骤如下:

    • 编辑my.cnf文件

      rm -f /etc/my.cnf
      echo -e "[mysqld_safe]\nlog-error=/data/mysql/log/mysql.log\npid-file=/data/mysql/run/mysqld.pid\n[mysqldump]\nquick\n[mysql]\nno-auto-rehash\n[client]\ndefault-character-set=utf8\n[mysqld]\nbasedir=/usr/local/mysql\nsocket=/data/mysql/run/mysql.sock\ntmpdir=/data/mysql/tmp\ndatadir=/data/mysql/data\ndefault_authentication_plugin=mysql_native_password\nport=3306\nuser=mysql\n" > /etc/my.cnf
      

      查看/etc/my.cnf,执行cat /etc/my.cnf命令,内容如下:

      [mysqld_safe]
      log-error=/data/mysql/log/mysql.log
      pid-file=/data/mysql/run/mysqld.pid
      [mysqldump]
      quick
      [mysql]
      no-auto-rehash
      [client]
      default-character-set=utf8
      [mysqld]
      basedir=/usr/local/mysql
      socket=/data/mysql/run/mysql.sock
      tmpdir=/data/mysql/tmp
      datadir=/data/mysql/data
      default_authentication_plugin=mysql_native_password
      port=3306
      user=mysql

    • 修改用户组和权限

      chown mysql:mysql /etc/my.cnf
      ll /etc/my.cnf
      
    • MySQL加入service服务:

      chmod 777 /usr/local/mysql/support-files/mysql.server
      cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
      chkconfig mysql on
      
    • 修改“/etc/init.d/mysql”的用户组和用户权限为mysql:mysql:

      chown -R mysql:mysql /etc/init.d/mysql
      ll /etc/init.d/mysql.
      
    • 安装完成后,将MySQL二进制文件的路径添加到环境变量中:

      echo export PATH=$PATH:/usr/local/mysql/bin >> /etc/profile
      
    • 使环境变量配置生效:

      source /etc/profile
      
    • 查看环境变量:

      env
      
    • 修改数据目前权限:

      chmod 755 /data/mysql/data/
      
    • 初始化数据库:

      mysqld --defaults-file=/etc/my.cnf --initialize
      

      会看到如下信息,记住数据库初始密码,下面操作需要:

      [mysql@ecs-sjm-mysql ~]$ mysqld --defaults-file=/etc/my.cnf --initialize
      2023-08-19T06:02:19.505175Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.17) initializing of server in progress as process 39906
      2023-08-19T06:02:21.093406Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Pf<I7a4SOjd<
      2023-08-19T06:02:22.164717Z 0 [System] [MY-013170] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.17) initializing of server has completed

    • 初始化完成后,查看数据目录下数据文件“/data/mysql/data”的用户组和用户权限为mysql:mysql(因为前面/etc/my.cnf文件中配置的操作系统用户是user=mysql):

      ll /data/mysql/data
      
    • 启动数据库进程:

      service mysql start
      

      或者:

      mysqld --defaults-file=/etc/my.cnf &
      

      或者:

      /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
      
    • 查看数据进程:

      ps -ef | grep mysql
      
    • 查看数据库端口号:

      netstat -anpt
      netstat -anpt | grep mysql
      netstat -anpt | grep 3306
      
    • 登录数据库:

      mysql -uroot -p -S /data/mysql/run/mysql.sock
      
    • 登录数据库以后,修改通过root用户登录数据库的密码:

      alter user 'root'@'localhost' identified by "123456";
      

      创建全域root用户(允许root从其他服务器访问):

      create user 'root'@'%' identified by '123456';
      

      进行授权:

      grant all privileges on *.* to 'root'@'%';
      flush privileges;
      

      退出数据库:exit

      用修改后的密码重新登录数据库:

      mysql -uroot -p -S /data/mysql/run/mysql.sock
      
  7. 安装BenchMarkSQL

    • 下载安装包

      cd /home
      wget https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/database/patch/benchmarksql5.0-for-mysql.zip
      
    • 修改权限

      cd /home/benchmarksql5.0-for-mysql/run
      chmod +x *.sh
      
    • 新建:vim props.mysql,添加如下内容:

      db=mysql
      driver=com.mysql.cj.jdbc.Driver
      conn=jdbc:mysql://127.0.0.1:3306/tpcc?useSSL=false
      user=root
      password=123456
      warehouses=50
      loadWorkers=10
      terminals=50
      runTxnsPerTerminal=0
      runMins=10
      limitTxnsPerMin=1000000000
      terminalWarehouseFixed=true
      newOrderWeight=45
      paymentWeight=43
      orderStatusWeight=4
      deliveryWeight=4
      stockLevelWeight=4
      
  8. TPC-C测试数据导入

    • 执行导入命令: ./home/benchmarksql5.0-for-mysql/run/runDatabaseBuild.sh props.mysql,会看到如下信息打印出来:
      [root@ecs-sjm-mysql run]# ./runDatabaseBuild.sh props.mysql
      # ------------------------------------------------------------
      # Loading SQL file ./sql.mysql/tableCreates.sql
      # ------------------------------------------------------------
      create table bmsql_config (
      cfg_name    varchar(30) primary key,
      cfg_value   varchar(50)
      );
      create table bmsql_warehouse (
      w_id        integer   not null,
      w_ytd       decimal(12,2),
      w_tax       decimal(4,4),
      w_name      varchar(10),
      w_street_1  varchar(20),
      w_street_2  varchar(20),
      w_city      varchar(20),
      w_state     char(2),
      w_zip       char(9),
      constraint pk_warehouse primary key (w_id)
      );
      create table bmsql_district (
      d_w_id       integer       not null,
      d_id         integer       not null,
      d_ytd        decimal(12,2),
      d_tax        decimal(4,4),
      d_next_o_id  integer,
      d_name       varchar(10),
      d_street_1   varchar(20),
      d_street_2   varchar(20),
      d_city       varchar(20),
      d_state      char(2),
      d_zip        char(9),
      constraint pk_district primary key (d_w_id, d_id)
      );
      create table bmsql_customer (
      c_w_id         integer        not null,
      c_d_id         integer        not null,
      c_id           integer        not null,
      c_discount     decimal(4,4),
      c_credit       char(2),
      c_last         varchar(16),
      c_first        varchar(16),
      c_credit_lim   decimal(12,2),
      c_balance      decimal(12,2),
      c_ytd_payment  decimal(12,2),
      c_payment_cnt  integer,
      c_delivery_cnt integer,
      c_street_1     varchar(20),
      c_street_2     varchar(20),
      c_city         varchar(20),
      c_state        char(2),
      c_zip          char(9),
      c_phone        char(16),
      c_since        timestamp,
      c_middle       char(2),
      c_data         varchar(500),
      constraint pk_customer primary key (c_w_id, c_d_id, c_id),
      key bmsql_customer_idx1 (c_w_id, c_d_id, c_last, c_first)
      );
      -- create sequence bmsql_hist_id_seq;
      create table bmsql_history (
      hist_id  integer not null auto_increment  primary key,
      h_c_id   integer,
      h_c_d_id integer,
      h_c_w_id integer,
      h_d_id   integer,
      h_w_id   integer,
      h_date   timestamp,
      h_amount decimal(6,2),
      h_data   varchar(24)
      );
      create table bmsql_new_order (
      no_w_id  integer   not null,
      no_d_id  integer   not null,
      no_o_id  integer   not null,
      constraint pk_new_order primary key (no_w_id, no_d_id, no_o_id)
      );
      create table bmsql_oorder (
      o_w_id       integer      not null,
      o_d_id       integer      not null,
      o_id         integer      not null,
      o_c_id       integer,
      o_carrier_id integer,
      o_ol_cnt     integer,
      o_all_local  integer,
      o_entry_d    timestamp,
      constraint pk_oorder primary key (o_w_id, o_d_id, o_id),
      constraint bmsql_oorder_idx1 unique key (o_w_id, o_d_id, o_carrier_id, o_id)
      );
      create table bmsql_order_line (
      ol_w_id         integer   not null,
      ol_d_id         integer   not null,
      ol_o_id         integer   not null,
      ol_number       integer   not null,
      ol_i_id         integer   not null,
      ol_delivery_d   timestamp,
      ol_amount       decimal(6,2),
      ol_supply_w_id  integer,
      ol_quantity     integer,
      ol_dist_info    char(24),
      constraint pk_order_line primary key (ol_w_id, ol_d_id, ol_o_id, ol_number)
      );
      create table bmsql_item (
      i_id     integer      not null,
      i_name   varchar(24),
      i_price  decimal(5,2),
      i_data   varchar(50),
      i_im_id  integer,
      constraint pk_item primary key (i_id)
      );
      create table bmsql_stock (
      s_w_id       integer       not null,
      s_i_id       integer       not null,
      s_quantity   integer,
      s_ytd        integer,
      s_order_cnt  integer,
      s_remote_cnt integer,
      s_data       varchar(50),
      s_dist_01    char(24),
      s_dist_02    char(24),
      s_dist_03    char(24),
      s_dist_04    char(24),
      s_dist_05    char(24),
      s_dist_06    char(24),
      s_dist_07    char(24),
      s_dist_08    char(24),
      s_dist_09    char(24),
      s_dist_10    char(24),
      constraint pk_stock primary key (s_w_id, s_i_id)
      );
      Starting BenchmarkSQL LoadDatadriver=com.mysql.cj.jdbc.Driver
      conn=jdbc:mysql://127.0.0.1:3306/tpcc?useSSL=false
      user=root
      password=***********
      warehouses=50
      loadWorkers=10
      fileLocation (not defined)
      csvNullValue (not defined - using default 'NULL')
      Worker 000: Loading ITEM
      Worker 001: Loading Warehouse      1
      Worker 002: Loading Warehouse      2
      Worker 003: Loading Warehouse      4
      Worker 004: Loading Warehouse      3
      Worker 005: Loading Warehouse      5
      Worker 006: Loading Warehouse      6
      Worker 007: Loading Warehouse      7
      Worker 008: Loading Warehouse      8
      Worker 009: Loading Warehouse      9
      Worker 000: Loading ITEM done
      Worker 000: Loading Warehouse     10
      Worker 001: Loading Warehouse      1 done
      Worker 001: Loading Warehouse     11
      Worker 002: Loading Warehouse      2 done
      Worker 003: Loading Warehouse      4 done
      Worker 002: Loading Warehouse     12
      Worker 003: Loading Warehouse     13
      Worker 007: Loading Warehouse      7 done
      Worker 009: Loading Warehouse      9 done
      Worker 008: Loading Warehouse      8 done
      Worker 006: Loading Warehouse      6 done
      Worker 008: Loading Warehouse     16
      Worker 006: Loading Warehouse     17
      Worker 004: Loading Warehouse      3 done
      Worker 004: Loading Warehouse     18
      Worker 009: Loading Warehouse     15
      Worker 007: Loading Warehouse     14
      Worker 005: Loading Warehouse      5 done
      # ------------------------------------------------------------
      # Loading SQL file ./sql.mysql/foreignKeys.sql
      # ------------------------------------------------------------
      alter table bmsql_district add constraint d_warehouse_fkey
      foreign key (d_w_id)
      references bmsql_warehouse (w_id);
      alter table bmsql_customer add constraint c_district_fkey
      foreign key (c_w_id, c_d_id)
      references bmsql_district (d_w_id, d_id);
      alter table bmsql_history add constraint h_customer_fkey
      foreign key (h_c_w_id, h_c_d_id, h_c_id)
      references bmsql_customer (c_w_id, c_d_id, c_id);
      alter table bmsql_history add constraint h_district_fkey
      foreign key (h_w_id, h_d_id)
      references bmsql_district (d_w_id, d_id);
      alter table bmsql_new_order add constraint no_order_fkey
      foreign key (no_w_id, no_d_id, no_o_id)
      references bmsql_oorder (o_w_id, o_d_id, o_id);
      alter table bmsql_oorder add constraint o_customer_fkey
      foreign key (o_w_id, o_d_id, o_c_id)
      references bmsql_customer (c_w_id, c_d_id, c_id);
      alter table bmsql_order_line add constraint ol_order_fkey
      foreign key (ol_w_id, ol_d_id, ol_o_id)
      references bmsql_oorder (o_w_id, o_d_id, o_id);
      alter table bmsql_order_line add constraint ol_stock_fkey
      foreign key (ol_supply_w_id, ol_i_id)
      references bmsql_stock (s_w_id, s_i_id);
      alter table bmsql_stock add constraint s_warehouse_fkey
      foreign key (s_w_id)
      references bmsql_warehouse (w_id);
      alter table bmsql_stock add constraint s_item_fkey
      foreign key (s_i_id)
      references bmsql_item (i_id);
      # ------------------------------------------------------------
      # Loading SQL file ./sql.mysql/buildFinish.sql
      # ------------------------------------------------------------
      -- Extra commands to run after the tables are created, loaded,
      -- indexes built and extra's created.
      analyze table bmsql_warehouse;
      analyze table bmsql_district;
      analyze table bmsql_customer;
      analyze table bmsql_history;
      analyze table bmsql_oorder;
      analyze table bmsql_new_order;
      analyze table bmsql_order_line;
      analyze table bmsql_stock;
      analyze table bmsql_item;
      analyze table bmsql_config;
      [root@ecs-sjm-mysql run]#
      
    
    
  9. benchmark tpcc性能测试

    • 调参前的性能测试,运行如下命令:

      ./home/benchmarksql5.0-for-mysql/run/runBenchmark.sh props.mysql
      

      运行大概5分钟左右,登录MySQL数据库查看innodb引擎状态,在MySQL的CLI界面下执行如下命令:

      mysql> show engine innodb status\G
      

      运行6分钟后的结果如下:可以看到,当前buffer pool已经没有剩余空间

      BUFFER POOL AND MEMORY
      ----------------------
      Total large memory allocated 137363456
      Dictionary memory allocated 466598
      Buffer pool size   8192
      Free buffers       0
      Database pages     8042
      Old database pages 2988
      Modified db pages  4082
      Pending reads      0
      Pending writes: LRU 118, flush list 0, single page 29
      Pages made young 69965, not young 10678113
      0.00 youngs/s, 0.00 non-youngs/s
      Pages read 4338871, created 15661, written 1514041
      0.00 reads/s, 0.00 creates/s, 0.00 writes/s
      Buffer pool hit rate 894 / 1000, young-making rate 1 / 1000 not 265 / 1000
      Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
      LRU len: 8042, unzip_LRU len: 0
      I/O sum[632113]:cur[1284], unzip sum[0]:cur[0]
      --------------
      ROW OPERATIONS
      --------------
      0 queries inside InnoDB, 0 queries in queue
      32 read views open inside InnoDB
      Process ID=25966, Main thread ID=281472649129984 , state=sleeping
      Number of rows inserted 615270, updated 1175202, deleted 42995, read 45467001
      1368.32 inserts/s, 2560.72 updates/s, 92.95 deletes/s, 98681.16 reads/s
      ----------------------------
      END OF INNODB MONITOR OUTPUT
      ============================1 row in set (0.00 sec)
      

      最终运行结束后的结果如下所示

      09:11:24,784 [main] INFO jTPCC : Term-00, ±------------------------------------------------------------+
      09:11:24,784 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
      09:11:24,784 [main] INFO jTPCC : Term-00, ±------------------------------------------------------------+
      09:11:24,784 [main] INFO jTPCC : Term-00, © 2003, Raul Barbosa
      09:11:24,784 [main] INFO jTPCC : Term-00, © 2004-2016, Denis Lussier
      09:11:24,786 [main] INFO jTPCC : Term-00, © 2016, Jan Wieck
      09:11:24,786 [main] INFO jTPCC : Term-00, ±------------------------------------------------------------+
      09:11:24,786 [main] INFO jTPCC : Term-00,
      09:11:24,786 [main] INFO jTPCC : Term-00, db=mysql
      09:11:24,786 [main] INFO jTPCC : Term-00, driver=com.mysql.cj.jdbc.Driver
      09:11:24,787 [main] INFO jTPCC : Term-00, conn=jdbc:mysql://127.0.0.1:3306/tpcc?useSSL=false
      09:11:24,787 [main] INFO jTPCC : Term-00, user=root
      09:11:24,787 [main] INFO jTPCC : Term-00,
      09:11:24,787 [main] INFO jTPCC : Term-00, warehouses=50
      09:11:24,787 [main] INFO jTPCC : Term-00, terminals=50
      09:11:24,788 [main] INFO jTPCC : Term-00, runMins=10
      09:11:24,789 [main] INFO jTPCC : Term-00, limitTxnsPerMin=1000000000
      09:11:24,789 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
      09:11:24,789 [main] INFO jTPCC : Term-00,
      09:11:24,789 [main] INFO jTPCC : Term-00, newOrderWeight=45
      09:11:24,789 [main] INFO jTPCC : Term-00, paymentWeight=43
      09:11:24,789 [main] INFO jTPCC : Term-00, orderStatusWeight=4
      09:11:24,789 [main] INFO jTPCC : Term-00, deliveryWeight=4
      09:11:24,789 [main] INFO jTPCC : Term-00, stockLevelWeight=4
      09:11:24,789 [main] INFO jTPCC : Term-00,
      09:11:24,789 [main] INFO jTPCC : Term-00, resultDirectory=null
      09:11:24,790 [main] INFO jTPCC : Term-00, osCollectorScript=null
      09:11:24,790 [main]Term-00, Running Average tpmTOTAL: 13912.07 Current tpmTOTAL: 918048 Memory Usage: 77MB / 383MB
      09:21:25,478 [Thread-34] INFO jTPCC : Term-00,
      09:21:25,478 [Thread-34] INFO jTPCC : Term-00,
      09:21:25,478 [Thread-34] INFO jTPCC : Term-00, Measured tpmC (NewOrders) = 6273.2
      09:21:25,478 [Thread-34] INFO jTPCC : Term-00, Measured tpmTOTAL = 13911.31
      09:21:25,478 [Thread-34] INFO jTPCC : Term-00, Session Start = 2023-08-19 09:11:25
      09:21:25,478 [Thread-34] INFO jTPCC : Term-00, Session End = 2023-08-19 09:21:25
      09:21:25,478 [Thread-34] INFO jTPCC : Term-00, Transaction Count = 139172

  • 查看调优前的参数默认值
    innodb_buffer_pool_size:默认值为128M(134217728字节)

    mysql> show variables like 'innodb_buffer_pool%';
    +-------------------------------------+----------------+
    | Variable_name                       | Value          |
    +-------------------------------------+----------------+
    | innodb_buffer_pool_chunk_size       | 134217728      |
    | innodb_buffer_pool_dump_at_shutdown | ON             |
    | innodb_buffer_pool_dump_now         | OFF            |
    | innodb_buffer_pool_dump_pct         | 25             |
    | innodb_buffer_pool_filename         | ib_buffer_pool |
    | innodb_buffer_pool_in_core_file     | ON             |
    | innodb_buffer_pool_instances        | 1              |
    | innodb_buffer_pool_load_abort       | OFF            |
    | innodb_buffer_pool_load_at_startup  | ON             |
    | innodb_buffer_pool_load_now         | OFF            |
    | innodb_buffer_pool_size             | 134217728      |
    +-------------------------------------+----------------+
    11 rows in set (0.00 sec)mysql> show variables like '%innodb_io_capacity%';
    +------------------------+-------+
    | Variable_name          | Value |
    +------------------------+-------+
    | innodb_io_capacity     | 200   |
    | innodb_io_capacity_max | 2000  |
    +------------------------+-------+
    2 rows in set (0.00 sec)
    

    说明:

    Innodb_buffer_pool_pages_data:InnoDB缓冲池中包含数据的页数。 该数字包括脏页面和干净页面。 使用压缩表时,报告的Innodb_buffer_pool_pages_data值可能大于Innodb_buffer_pool_pages_total。
    Innodb_buffer_pool_pages_dirty:显示在内存中修改但尚未写入数据文件的InnoDB缓冲池数据页的数量(脏页刷新)。
    Innodb_buffer_pool_pages_flushed:表示从InnoDB缓冲池中刷新脏页的请求数。
    Innodb_buffer_pool_pages_free:显示InnoDB缓冲池中的空闲页面
    Innodb_buffer_pool_pages_misc:InnoDB缓冲池中的页面数量很多,因为它们已被分配用于管理开销,例如行锁或自适应哈希索引。此值也可以计算为Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free - Innodb_buffer_pool_pages_data。
    Innodb_buffer_pool_pages_total:InnoDB缓冲池的总大小,以page为单位。
    innodb_buffer_pool_reads:表示InnoDB缓冲池无法满足的请求数。需要从磁盘中读取。
    innodb_buffer_pool_read_requests:它表示从内存中逻辑读取的请求数。
    innodb_buffer_pool_wait_free:通常,对InnoDB缓冲池的写入发生在后台。 当InnoDB需要读取或创建页面并且没有可用的干净页面时, InnoDB首先刷新一些脏页并等待该操作完成。 此计数器计算这些等待的实例。 如果已正确设置innodb_buffer_pool_size,则此值应该很小。如果大于0,则表示InnoDb缓冲池太小。
    innodb_buffer_pool_write_request:表示对缓冲池执行的写入次数。
    参考资料:https://www.cnblogs.com/innocenter/p/14948857.html#MySQL InnoDB Buffer Pool 里包含什么?

  • 调优后参数配置,加入如下参数到/etc/my.cnf

    echo innodb_buffer_pool_size=24G >> /etc/my.cnf
    echo innodb_io_capacity=3000 >> /etc/my.cnf
    echo innodb_io_capacity_max=6000 >> /etc/my.cnf
    

    参数说明:

    1.innodb_buffer_pool_size:它的是一个内存区域,用来缓存InnoDB存储引擎的表中的数据和索引数据。以便提高对InnoDB存储引擎表中数据的查询访问速度。默认值为128M,此处调优为增大innodb_buffer_pool_size至24G,建议配置为服务器可用内存的70-80%。缓冲池大小必须始终等于或者是innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances的倍数。如果将缓冲池大小更改为不等于或等于innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances的倍数的值,则缓冲池大小将自动调整为等于或者是innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances的倍数的值。

    2.innodb_io_capacity:设置InnoDB后台任务每秒执行的I/O操作数的上限,影响刷新脏页和写入缓冲池的速率。默认值为200。
    3.innodb_io_capacity_max:如果刷新操作过于落后,InnoDB可以超过innodb_io_capacity的限制进行刷新,但是不能超过本参数的值。默认值为2000。
    说明:上面两项参数优化取决于数据盘的性能,在磁盘性能允许的情况下,适当增大配置值可以提高读写性能。
    参考资料:https://blog.csdn.net/javaanddonet/article/details/109517031

  • 重启MySQL数据库:

    service mysql restart
    
  • 查看调优之后的参数值:

    mysql> show variables like '%innodb_io_capacity%';
    +------------------------+-------+
    | Variable_name          | Value |
    +------------------------+-------+
    | innodb_io_capacity     | 3000  |
    | innodb_io_capacity_max | 6000  |
    +------------------------+-------+
    2 rows in set (0.01 sec)mysql> show variables like '%innodb_buffer_pool%';
    +-------------------------------------+----------------+
    | Variable_name                       | Value          |
    +-------------------------------------+----------------+
    | innodb_buffer_pool_chunk_size       | 134217728      |
    | innodb_buffer_pool_dump_at_shutdown | ON             |
    | innodb_buffer_pool_dump_now         | OFF            |
    | innodb_buffer_pool_dump_pct         | 25             |
    | innodb_buffer_pool_filename         | ib_buffer_pool |
    | innodb_buffer_pool_in_core_file     | ON             |
    | innodb_buffer_pool_instances        | 8              |
    | innodb_buffer_pool_load_abort       | OFF            |
    | innodb_buffer_pool_load_at_startup  | ON             |
    | innodb_buffer_pool_load_now         | OFF            |
    | innodb_buffer_pool_size             | 25769803776    |
    +-------------------------------------+----------------+
    11 rows in set (0.00 sec)mysql> show global status like '%innodb_buffer_pool%';
    +---------------------------------------+--------------------------------------------------+
    | Variable_name                         | Value                                            |
    +---------------------------------------+--------------------------------------------------+
    | Innodb_buffer_pool_dump_status        | Dumping of buffer pool not started               |
    | Innodb_buffer_pool_load_status        | Buffer pool(s) load completed at 230819 10:04:14 |
    | Innodb_buffer_pool_resize_status      |                                                  |
    | Innodb_buffer_pool_pages_data         | 2922                                             |
    | Innodb_buffer_pool_bytes_data         | 47874048                                         |
    | Innodb_buffer_pool_pages_dirty        | 0                                                |
    | Innodb_buffer_pool_bytes_dirty        | 0                                                |
    | Innodb_buffer_pool_pages_flushed      | 146                                              |
    | Innodb_buffer_pool_pages_free         | 1569938                                          |
    | Innodb_buffer_pool_pages_misc         | 4                                                |
    | Innodb_buffer_pool_pages_total        | 1572864                                          |
    | Innodb_buffer_pool_read_ahead_rnd     | 0                                                |
    | Innodb_buffer_pool_read_ahead         | 0                                                |
    | Innodb_buffer_pool_read_ahead_evicted | 0                                                |
    | Innodb_buffer_pool_read_requests      | 16454                                            |
    | Innodb_buffer_pool_reads              | 2780                                             |
    | Innodb_buffer_pool_wait_free          | 0                                                |
    | Innodb_buffer_pool_write_requests     | 1633                                             |
    +---------------------------------------+--------------------------------------------------+
    18 rows in set (0.00 sec)
    
  • 调参后的性能测试,运行结束并查看结果,如下:

    08:52:53,413 [main] INFO jTPCC : Term-00, ±------------------------------------------------------------+
    08:52:53,413 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
    08:52:53,413 [main] INFO jTPCC : Term-00, ±------------------------------------------------------------+
    08:52:53,413 [main] INFO jTPCC : Term-00, © 2003, Raul Barbosa
    08:52:53,413 [main] INFO jTPCC : Term-00, © 2004-2016, Denis Lussier
    08:52:53,415 [main] INFO jTPCC : Term-00, © 2016, Jan Wieck
    08:52:53,416 [main] INFO jTPCC : Term-00, ±------------------------------------------------------------+
    08:52:53,416 [main] INFO jTPCC : Term-00,
    08:52:53,416 [main] INFO jTPCC : Term-00, db=mysql
    08:52:53,416 [main] INFO jTPCC : Term-00, driver=com.mysql.cj.jdbc.Driver
    08:52:53,416 [main] INFO jTPCC : Term-00, conn=jdbc:mysql://127.0.0.1:3306/tpcc?useSSL=false
    08:52:53,416 [main] INFO jTPCC : Term-00, user=root
    08:52:53,416 [main] INFO jTPCC : Term-00,
    08:52:53,416 [main] INFO jTPCC : Term-00, warehouses=50
    08:52:53,416 [main] INFO jTPCC : Term-00, terminals=50
    08:52:53,418 [main] INFO jTPCC : Term-00, runMins=10
    08:52:53,418 [main] INFO jTPCC : Term-00, limitTxnsPerMin=1000000000
    08:52:53,418 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
    08:52:53,418 [main] INFO jTPCC : Term-00,
    08:52:53,418 [main] INFO jTPCC : Term-00, newOrderWeight=45
    08:52:53,418 [main] INFO jTPCC : Term-00, paymentWeight=43
    08:52:53,418 [main] INFO jTPCC : Term-00, orderStatusWeight=4
    08:52:53,419 [main] INFO jTPCC : Term-00, deliveryWeight=4
    08:52:53,419 [main] INFO jTPCC : Term-00, stockLevelWeight=4
    08:52:53,419 [main] INFO jTPCC : Term-00,
    08:52:53,419 [main] INFO jTPCC : Term-00, resultDirectory=null
    08:52:53,419 [main] INFO jTPCC : Term-00, osCollectorScript=null
    08:52:53,419 [main]Term-00, Running Average tpmTOTAL: 42882.26 Current tpmTOTAL: 2834772 Memory Usage: 118MB / 414MB
    09:02:54,134 [Thread-5] INFO jTPCC : Term-00,
    09:02:54,134 [Thread-5] INFO jTPCC : Term-00,
    09:02:54,135 [Thread-5] INFO jTPCC : Term-00, Measured tpmC (NewOrders) = 19302.38
    09:02:54,135 [Thread-5] INFO jTPCC : Term-00, Measured tpmTOTAL = 42882.23
    09:02:54,135 [Thread-5] INFO jTPCC : Term-00, Session Start = 2023-08-19 08:52:53
    09:02:54,135 [Thread-5] INFO jTPCC : Term-00, Session End = 2023-08-19 09:02:54
    09:02:54,135 [Thread-5] INFO jTPCC : Term-00, Transaction Count = 429015

    结论:经过与调优前的运行结果对比,可以看到tpmC值有了较大幅度增长,验证了MySQL的性能得到提升(67.5%)。至此,实验完成。

三、实验小结

本次实验是基于鲲鹏服务器对MySQL性能进行调优的实验,该实验的难点在于源码编译和安装MySQL,因一些依赖和环境问题,容易出现问题,故记录于此,以便后续可随时查阅。如本篇博文对您有所帮助,请动动您发财的手指给博主点赞,感谢您的阅读!!!!也欢迎您的建议和意见!!!

相关文章:

【基于鲲鹏及openEuler20.03TLS下MySQL8.0.17性能调优】

【基于鲲鹏及openEuler20.03TLS下MySQL8.0.17性能调优】 一、环境说明二、实验过程三、实验小结 一、环境说明 华为云ECS 规格&#xff1a;8vCPU 32G arm架构操作系统&#xff1a;openEuler 20.03.TLSMySQL版本&#xff1a;8.0.17 二、实验过程 创建用户及用户组&#xff1a;…...

GRPC 学习记录

GRPC 安装 安装 grpcio、grpcio-tools、protobuf、 pip install grpcio -i https://pypi.tuna.tsinghua.edu.cn/simple pip install grpcio-tools -i https://pypi.tuna.tsinghua.edu.cn/simple pip install protobuf -i https://pypi.tuna.tsinghua.edu.cn/simple常用类型 p…...

C++语言的QT写软件界面,结合python深度学习模型的综合应用处理方案

C与python问题合集&#xff1a; 后面内容涉及到api的创建问题 如果我用C语言的QT写软件界面&#xff0c;然后用python语言去写和人工智能相关的东西。就比如说一些模型&#xff0c;那么现在我想将用python写的模型放在QT写的软件当中调用&#xff0c;那么请问是否会导致C语言…...

Linux环境下python连接Oracle教程

下载Oracle client需要的 安装包 rpm包下载地址&#xff1a;Oracle官方下载地址 选择系统版本 选择Oracle版本 下载3个rpm安装包 oracle-instantclient12.2-basic-12.2.0.1.0-1.i386.rpm oracle-instantclient12.2-devel-12.2.0.1.0-1.i386.rpm oracle-instantclient12.2-sq…...

第 7 章 排序算法(1)

7.1排序算法的介绍 排序也称排序算法(Sort Algorithm)&#xff0c;排序是将一组数据&#xff0c;依指定的顺序进行排列的过程。 7.2排序的分类&#xff1a; 内部排序: 指将需要处理的所有数据都加载到**内部存储器(内存)**中进行排序。外部排序法&#xff1a; 数据量过大&am…...

wsl,字体乱码问题

配置wsl&#xff0c;字体乱码问题 一、前言 用zsh配置好wsl&#xff0c;每次打开还是会出现乱码&#xff0c;只有再新打开一个终端才会显示字体 如下图&#xff1a;第一次打开&#xff0c;出现乱码 如图&#xff1a;按加号&#xff0c;再开一个新终端才会显示字体。 二、解…...

【NetCore】10-路由定义

文章目录 路由与终结点&#xff1a;如何规划好Web Api1. 路由1.1 路由映射1.2 路由注册方式1.3 路由约束总结: Web Api定义 路由与终结点&#xff1a;如何规划好Web Api 1. 路由 1.1 路由映射 路由系统核心作用是指URL和应用程序Controller的对应关系的一种映射 这种映射的作…...

软考:中级软件设计师:数据库模式、ER模型

软考&#xff1a;中级软件设计师:数据库模式、ER模型 提示&#xff1a;系列被面试官问的问题&#xff0c;我自己当时不会&#xff0c;所以下来自己复盘一下&#xff0c;认真学习和总结&#xff0c;以应对未来更多的可能性 关于互联网大厂的笔试面试&#xff0c;都是需要细心准…...

海量数据迁移,亚马逊云科技云数据库服务为大库治理提供新思路

1.背景 目前&#xff0c;文档型数据库由于灵活的schema和接近关系型数据库的访问特点&#xff0c;被广泛应用&#xff0c;尤其是游戏、互联网金融等行业的客户使用MongoDB构建了大量应用程序&#xff0c;比如游戏客户用来处理玩家的属性信息&#xff1b;又如股票APP用来存储与时…...

DevOps系列文章之 GitlabCICD自动化部署SpringBoot项目

一、概述 本文主要记录如何通过Gitlab CI/CD自动部署SpringBoot项目jar包。 二、前期准备 准备三台 CentOS7服务器&#xff0c;分别部署以下服务&#xff1a; 序号系统IP服务1CentOS7192.168.56.10Gitlab2CentOS7192.168.56.11Runner &#xff08;安装Docker&#xff09;3Cen…...

汽车租赁管理系统/汽车租赁网站的设计与实现

摘 要 租赁汽车走进社区&#xff0c;走进生活&#xff0c;成为当今生活中不可缺少的一部分。随着汽车租赁业的发展&#xff0c;加强管理和规范管理司促进汽车租赁业健康发展的重要推动力。汽车租赁业为道路运输车辆一种新的融资服务形式、广大人民群众一种新的出行消费方式和…...

语句覆盖、条件覆盖、判定覆盖、条件-判定覆盖、路径覆盖

白盒测试是结构测试&#xff0c;主要对代码的逻辑进行验证。 逻辑覆盖率&#xff1a;语句覆盖<条件覆盖<判定覆盖<条件-判定覆盖<组合覆盖<路径覆盖 例子 一、语句覆盖 最基础的覆盖&#xff0c;只要每一个执行处理框内的语句都能执行就可&#xff0c;不用关注…...

二进制逻辑运算符

运算的优先级&#xff1a;非>与>或 1.逻辑与&#xff1a;“ ∧ \wedge ∧“&#xff0c;“ ⋅ \cdot ⋅“&#xff0c;and 在逻辑问题中与是所有的都是真结果才是真&#xff0c;比如&#xff1a; 1010101011 1010101011 1010101011和 1010110010 1010110010 1010110010…...

Bug日记-webstorm运行yarn 命令报错

在windows中输入yarn -v正确输出&#xff0c;在webstrom终端中运行yarn命令输出错误 问题&#xff1a;可能是由于 WebStorm 配置问题导致的。 解决方案&#xff1a; 检查 WebStorm 的终端配置&#xff1a;在 WebStorm 中&#xff0c;点击菜单栏的 “File”&#xff08;文件&am…...

C++11并发与多线程笔记(9) async、future、packaged_task、promise

C11并发与多线程笔记&#xff08;9&#xff09; async、future、packaged_task、promise 1、std::async、std::future创建后台任务并返回值2、std::packaged_task&#xff1a;打包任务&#xff0c;把任务包装起来3、std::promise3、小结 1、std::async、std::future创建后台任务…...

Mr. Cappuccino的第63杯咖啡——Spring之AnnotationConfigApplicationContext源码分析

Spring之AnnotationConfigApplicationContext源码分析 源码分析 源码分析 以上一篇文章《Spring之Bean的生命周期》的代码进行源码分析 AnnotationConfigApplicationContext applicationContext new AnnotationConfigApplicationContext(SpringConfig02.class); LifeCycleBe…...

opencv直方图与模板匹配

import cv2 #opencv读取的格式是BGR import numpy as np import matplotlib.pyplot as plt#Matplotlib是RGB %matplotlib inline def cv_show(img,name):cv2.imshow(name,img)cv2.waitKey()cv2.destroyAllWindows() 直方图 cv2.calcHist(images,channels,mask,histSize,ran…...

Apache Doris 入门教程31:计算节点

需求场景​ 目前Doris是一个典型Share-Nothing的架构, 通过绑定数据和计算资源在同一个节点获得非常好的性能表现. 但随着Doris计算引擎性能持续提高, 越来越多的用户也开始选择使用Doris直接查询数据湖数据. 这类场景是一种Share-Disk场景, 数据往往存储在远端的HDFS/S3上, 计…...

Nacos和GateWay路由转发NotFoundException: 503 SERVICE_UNAVAILABLE “Unable to find

问题再现&#xff1a; 2023-08-15 16:51:16,151 DEBUG [reactor-http-nio-2][CompositeLog.java:147] - [dc73b32c-1] Encoding [{timestampTue Aug 15 16:51:16 CST 2023, path/content/course/list, status503, errorService Unavai (truncated)...] 2023-08-15 16:51:16,17…...

2021年9月全国计算机等级考试真题(二级C语言)

2021年9月全国计算机等级考试真题&#xff08;二级C语言&#xff09; 第1题 下列叙述中正确的是&#xff08; &#xff09;。 A. 算法的复杂度是指算法所处理的数据量 B. 算法的复杂度是指算法程序中指令的数量 C. 算法的复杂度是指算法控制结构的复杂程度 D. 算法的复杂度包…...

串口通讯

USART是全双工同步通讯 在同步通信中&#xff0c;数据信号所传输的内容绝大多数属于有效数据&#xff0c;而异步通信中包含了各种帧的标识符&#xff0c;所以同步通讯的效率更高。但是同步通信对时钟要求苛刻&#xff0c;允许的误差小。而异步通信则允许双方的误差较大 比特率…...

自动拉取 GitHub 仓库更新的脚本

更好的阅读体验 \huge{\color{red}{更好的阅读体验}} 更好的阅读体验 由于将 HAUE-CS-WIKI 部署到了我自己的服务器上作为国内镜像站&#xff0c;每次在源站更新后都需要手动拉取镜像站的更新实在是太麻烦了&#xff0c;因此产生了编写该脚本的需求&#xff08; 读者可根据该…...

如何获得Android 14复活节彩蛋

每个新的安卓版本都有隐藏复活节彩蛋的悠久传统&#xff0c;可以追溯到以前&#xff0c;每个版本都以某种甜食命名。安卓14也不例外&#xff0c;但这一次的主题都是围绕太空构建的——还有一个复活节彩蛋。 安卓14复活节彩蛋实际上是一款很酷的小迷你游戏&#xff0c;你可以乘…...

国产32位单片机XL32F001,带1 路 12bit ADC,I2C、SPI、USART 等外设

XL32F001 系列单片机采用高性能的 32 位 ARM Cortex-M0内核&#xff0c;宽电压工作范围的 MCU。嵌入 24KbytesFlash 和 3Kbytes SRAM 存储器&#xff0c;最高工作频率 24MHz。包含多种不同封装类型多款产品。芯片集成 I2C、SPI、USART 等通讯外设&#xff0c;1 路 12bit ADC&am…...

typescript基础之null和undefined

TypeScript是一种基于JavaScript的编程语言&#xff0c;它支持静态类型检查和面向对象的特性。TypeScript中的null和undefined是两种基本类型&#xff0c;它们分别表示空值或未定义的值。在本文中&#xff0c;我将介绍TypeScript中null和undefined的含义、区别、检查方法和使用…...

php_mb_strlen指定扩展

1 中文在utf-字符集下占3个字节,所以计算出来长度为9。 2 可以引入php多字节字符的扩展&#xff0c;默认是没有的&#xff0c;需要自己配置这个函数 3 找到php.ini文件&#xff0c;去掉;extension mbstring的注释&#xff0c;接着重启apache服务 可以看到准确输出的中文的长度…...

利用OpenCV光流算法实现视频特征点跟踪

光流简介 光流&#xff08;optical flow&#xff09;是运动物体在观察成像平面上的像素运动的瞬时速度。光流法是利用图像序列中像素在时间域上的变化以及相邻帧之间的相关性来找到上一帧跟当前帧之间存在的对应关系&#xff0c;从而计算出相邻帧之间物体的运动信息的一种方法。…...

探索无限创造力的星辰大道,画出想象的浩瀚宇宙!-turtle

介绍 视频教程地址在此&#xff1a;https://www.bilibili.com/video/BV1Pm4y1H7Tb/ 大家好&#xff0c;欢迎来到本视频&#xff01;今天&#xff0c;我们将一同探索Python编程世界中的一个有趣而创意的库——Turtle库。无需专业绘画技能&#xff0c;你就可以轻松地用代码绘制…...

企业数字化转型大数据湖一体化平台项目建设方案PPT

导读&#xff1a;原文《企业数字化转型大数据湖一体化平台项目建设方案PPT》&#xff08;获取来源见文尾&#xff09;&#xff0c;本文精选其中精华及架构部分&#xff0c;逻辑清晰、内容完整&#xff0c;为快速形成售前方案提供参考。 喜欢文章&#xff0c;您可以点赞评论转发…...

【3Ds Max】车削命令的简单使用(以制作花瓶为例)

简介 在3ds Max中&#xff0c;"车削"&#xff08;Lathe&#xff09;是一种建模命令&#xff0c;用于创建围绕轴线旋转的几何形状。通过车削命令&#xff0c;您可以将一个闭合的平面或曲线几何形状旋转&#xff0c;从而生成一个立体对象。这种方法常用于创建圆柱体、…...

Python 3 使用HBase 总结

HBase 简介和安装 请参考文章&#xff1a;HBase 一文读懂 Python3 HBase API HBase 前期准备 1 安装happybase库操作hbase 安装该库 pip install happybase2 确保 Hadoop 和 Zookeeper 可用并开启 确保Hadoop 正常运行 确保Zookeeper 正常运行3 开启HBase thrift服务 使用命…...

Maven方式构建SpringBoot项目

目录 1、创建maven项目 2、添加springboot相关依赖 3、配置启动端口 4、修改APP文件 5、配置controller 6、启动应用 1、创建maven项目 项目如下&#xff1a; 2、添加springboot相关依赖 <parent><groupId>org.springframework.boot</groupId><arti…...

不花一分钱,利用免费电脑软件将视频MV变成歌曲音频MP3

教程 1.点击下载电脑软件下载地址&#xff0c;点击下载&#xff0c;安装。&#xff08;没有利益关系&#xff0c;没有打广告&#xff0c;只是单纯教学&#xff09; 2.安装完成后&#xff0c;点击格式工厂 3.然后如图所示依次&#xff0c;点击【音频】->【-MP3】 3.然后点击…...

运营知识之用户运营(一)触达用户的几种方式

运营知识之用户运营&#xff08;一&#xff09;触达用户的几种方式 APP推送短信&#xff08;DeepLink/Deferred DeepLink&#xff09;&#xff1a;短信拉起app电子邮件 EDM电话/外呼&#xff08;人工、AI&#xff09;电话外呼加短信&#xff08;操作步骤短链&#xff09;微信生…...

cocos creator pageView 循环展示 广告牌功能

在使用 creator pageView 滑动到最大或者最小为止的时候 滑动不了没法流畅的运行到最开始或者最后那个界面 循环展示 1.策划大人有需要就是要循环流畅的展示 解决方案: 做预制件的时候 最第一个界面之前 做一个最后的界面放到最前边去 比如 1,2,3,4,5,6,7,8 修改成 8,1…...

PyTorch Lightning:通过分布式训练扩展深度学习工作流

一、介绍 欢迎来到我们关于 PyTorch Lightning 系列的第二篇文章&#xff01;在上一篇文章中&#xff0c;我们向您介绍了 PyTorch Lightning&#xff0c;并探讨了它在简化深度学习模型开发方面的主要功能和优势。我们了解了 PyTorch Lightning 如何为组织和构建 PyTorch 代码提…...

无涯教程-Perl - splice函数

描述 此函数从LENGTH元素的OFFSET元素中删除ARRAY元素,如果指定,则用LIST替换删除的元素。如果省略LENGTH,则从OFFSET开始删除所有内容。 语法 以下是此函数的简单语法- splice ARRAY, OFFSET, LENGTH, LISTsplice ARRAY, OFFSET, LENGTHsplice ARRAY, OFFSET返回值 该函数…...

归并排序:从二路到多路

前言 我们所熟知的快速排序和归并排序都是非常优秀的排序算法。 但是快速排序和归并排序的一个区别就是&#xff1a;快速排序是一种内部排序&#xff0c;而归并排序是一种外部排序。 简单理解归并排序&#xff1a;递归地拆分&#xff0c;回溯过程中&#xff0c;将排序结果进…...

【Vue】运行项目报错 This dependency was not found

背景 运行Vue 项目报错&#xff0c;提示This dependency was not found&#xff1b;然后我根据提示 执行 npm install --save vue/types/umd ,执行后发现错误&#xff0c;我一开始一直以为是我本地装不上这个依赖。后来找了资料后&#xff0c;看到应该是自己的代码里面随意的i…...

Shell编程之正则表达式

文本处理器&#xff1a;三剑客&#xff1a;grep查找sed awk shell正则表达式由一类特殊字符以及文本字符所编写的一种模式&#xff0c;处理文本当中的内容&#xff0c;其中的一些字符不表示字符的字面含义表示一种控制或者通配的功能 通配符&#xff1a;匹配文件名和目录名&a…...

QGraphicsView 实例3地图浏览器

主要介绍Graphics View框架&#xff0c;实现地图的浏览、放大、缩小&#xff0c;以及显示各个位置的视图、场景和地图坐标 效果图: mapwidget.h #ifndef MAPWIDGET_H #define MAPWIDGET_H #include <QLabel> #include <QMouseEvent> #include <QGraphicsView&…...

Windows基础安全知识

目录 常用DOS命令 ipconfig ping dir cd net user 常用DOS命令 内置账户访问控制 Windows访问控制 安全标识符 访问控制项 用户账户控制 UAC令牌 其他安全配置 本地安全策略 用户密码策略复杂性要求 强制密码历史&#xff1a; 禁止密码重复使用 密码最短使用期限…...

自定义注解和自定义注解处理器来扫描所有带有某个特定注解的Controller层

在Spring Boot中&#xff0c;您可以使用自定义注解和自定义注解处理器来扫描所有带有某个特定注解的Controller层。 以下是一个简单的示例&#xff0c;演示如何实现这个功能&#xff1a; 首先&#xff0c;创建自定义注解 CustomAnnotation &#xff0c;用于标记需要被扫描的C…...

浏览器渲染原理 - 输入url 回车后发生了什么

目录 渲染时间点渲染流水线1&#xff0c;解析&#xff08;parse&#xff09;HTML1.1&#xff0c;DOM树1.2&#xff0c;CSSOM树1.3&#xff0c;解析时遇到 css 是怎么做的1.4&#xff0c;解析时遇到 js 是怎么做的 2&#xff0c;样式计算 Recalculate style3&#xff0c;布局 la…...

大文本的全文检索方案附件索引

一、简介 Elasticsearch附件索引是需要插件支持的功能&#xff0c;它允许将文件内容附加到Elasticsearch文档中&#xff0c;并对这些附件内容进行全文检索。本文将带你了解索引附件的原理和使用方法&#xff0c;并通过一个实际示例来说明如何在Elasticsearch中索引和检索文件附…...

35_windows环境debug Nginx 源码-CLion配置CMake和启动

文章目录 生成 CMakeLists.txt 组态档35_windows环境debug Nginx 源码-CLion配置CMake和启动生成 CMakeLists.txt 组态档 修改auto目录configure文件,在 . auto/make 上边增加 . auto/cmake, 大概在 106 行。在 auto 目录下创建cmake 文件其内容如下: #!/usr/bin/env bash NG…...

收集的一些比较好的git网址

1、民间故事 https://github.com/folkstory/lingqiu/blob/master/%E4%BC%A0%E8%AF%B4%E9%83%A8%E5%88%86/%E4%BA%BA%E7%89%A9%E4%BC%A0%E8%AF%B4/%E2%80%9C%E6%B5%B7%E5%BA%95%E6%8D%9E%E6%9C%88%E2%80%9D%E7%9A%84%E6%AD%A6%E4%B8%BE.md 2、童话故事 https://gutenberg.org/c…...

容斥原理 博弈论(多种Nim游戏解法)

目录 容斥原理容斥原理的简介能被整除的数&#xff08;典型例题&#xff09;实现思路代码实现扩展&#xff1a;用DPS实现 博弈论博弈论中的相关性质博弈论的相关结论先手必败必胜的证明Nim游戏&#xff08;典型例题&#xff09;代码实现 台阶-Nim游戏&#xff08;典型例题&…...

【C++】函数指针

2023年8月18日&#xff0c;周五上午 今天在B站看Qt教学视频的时候遇到了 目录 语法和typedef或using结合我的总结 语法 返回类型 (*指针变量名)(参数列表)以下是一些示例来说明如何声明不同类型的函数指针&#xff1a; 声明一个不接受任何参数且返回void的函数指针&#xf…...

VBA技术资料MF45:VBA_在Excel中自定义行高

【分享成果&#xff0c;随喜正能量】可以不光芒万丈&#xff0c;但不要停止发光。有的人陷入困境&#xff0c;不是被人所困&#xff0c;而是自己束缚自己&#xff0c;这时"解铃还须系铃人"&#xff0c;如果自己无法放下&#xff0c;如何能脱困&#xff1f; 。 我给V…...