构建sysbench的镜像
方式1:先docker run一个镜像,手动安装好commit
docker run -it --name mycentos arm64v8/centos:7 /bin/bash
docker commit -a "PX Bai" mycentos mycentos1
docker run -it -d --name=mycentos1 mycentos1 /bin/bash
docker exec -it mycentos1 bashdocker run --rm arm-sysbench
./configure --without-mysql && \
./configure 
方式2:ubuntu 16.04
xenial:这是指定基础镜像的标签或版本。Ubuntu使用代号来标识每个发行版,xenial是Ubuntu 16.04 LTS版本的代号。
FROM ubuntu:xenialRUN apt-get updateRUN apt-get -y install make automake libtool pkg-config libaio-dev git# For MySQL support
RUN apt-get -y install libmysqlclient-dev libssl-dev# For PostgreSQL support
RUN apt-get -y install libpq-devRUN git clone https://github.com/akopytov/sysbench.git sysbenchWORKDIR sysbench
RUN ./autogen.sh
RUN ./configure --with-mysql --with-pgsql
RUN make -j
RUN make installWORKDIR /root
RUN rm -rf sysbenchENTRYPOINT sysbench
方式2:centos 7
vi DockfileFROM arm64v8/centos:7RUN yum update -y && \yum install -y epel-release && \yum install -y git gcc automake libtool pkgconfig openssl-devel postgresql-devel mysql-devel makeRUN git clone https://github.com/akopytov/sysbench.git /tmp/sysbenchWORKDIR /tmp/sysbenchRUN ./autogen.sh && \./configure \make && \make installRUN rm -rf /tmp/sysbench && \yum remove -y git gcc automake libtool pkgconfig openssl-devel postgresql-devel mysql-devel && \yum clean allCMD [ "sysbench", "--version" ]
查看版本
sysbench --version
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)sysbench --help
Usage:sysbench [options]... [testname] [command]Commands implemented by most tests: prepare run cleanup helpGeneral options:--threads=N                     number of threads to use [1]--events=N                      limit for total number of events [0]--time=N                        limit for total execution time in seconds [10]--warmup-time=N                 execute events for this many seconds with statistics disabled before the actual benchmark run with statistics enabled [0]--forced-shutdown=STRING        number of seconds to wait after the --time limit before forcing shutdown, or 'off' to disable [off]--thread-stack-size=SIZE        size of stack per thread [64K]--thread-init-timeout=N         wait time in seconds for worker threads to initialize [30]--rate=N                        average transactions rate. 0 for unlimited rate [0]--report-interval=N             periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]--report-checkpoints=[LIST,...] dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []--debug[=on|off]                print more debugging info [off]--validate[=on|off]             perform validation checks where possible [off]--help[=on|off]                 print help and exit [off]--version[=on|off]              print version and exit [off]--config-file=FILENAME          File containing command line options--luajit-cmd=STRING             perform LuaJIT control command. This option is equivalent to 'luajit -j'. See LuaJIT documentation for more informationPseudo-Random Numbers Generator options:--rand-type=STRING   random numbers distribution {uniform, gaussian, pareto, zipfian} to use by default [uniform]--rand-seed=N        seed for random number generator. When 0, the current time is used as an RNG seed. [0]--rand-pareto-h=N    shape parameter for the Pareto distribution [0.2]--rand-zipfian-exp=N shape parameter (exponent, theta) for the Zipfian distribution [0.8]Log options:--verbosity=N verbosity level {5 - debug, 0 - only critical messages} [3]--percentile=N       percentile to calculate in latency statistics (1-100). Use the special value of 0 to disable percentile calculations [95]--histogram[=on|off] print latency histogram in report [off]General database options:--db-driver=STRING  specifies database driver to use ('help' to get list of available drivers)--db-ps-mode=STRING prepared statements usage mode {auto, disable} [auto]--db-debug[=on|off] print database-specific debug information [off]Compiled-in database drivers:Compiled-in tests:fileio - File I/O testcpu - CPU performance testmemory - Memory functions speed testthreads - Threads subsystem performance testmutex - Mutex performance testSee 'sysbench <testname> help' for a list of options for each test.Postgres压测
sysbench --db-driver=postgres --threads=4 --time=60 --rate=0 --report-interval=1 \--pgsql-host=<host> --pgsql-port=<port> --pgsql-user=<user> \--pgsql-password=<password> --pgsql-db=<database> \--test=oltp --oltp-table-size=100000 --oltp-test-mode=complex \--oltp-read-only=on --oltp-skip-trx=on --max-requests=0 run
您需要替换 、、、 和 分别为您 PostgreSQL 数据库的主机名、端口号、用户名、密码和数据库名。您需要将 替换为您要使用的线程数, 替换为测试的持续时间(以秒为单位), 替换为每秒钟执行的事务数(或设置为 0 来达到最大吞吐量),、、、 和 替换为您的 PostgreSQL 数据库的连接参数。您还可以根据需要指定其他测试选项和参数。
sysbench
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)Reading the script from the standard input:^C
[root@172-16-130-214 ~]# sysbench --help
Usage:sysbench [options]... [testname] [command]Commands implemented by most tests: prepare run cleanup helpGeneral options:--threads=N                     number of threads to use [1]--events=N                      limit for total number of events [0]--time=N                        limit for total execution time in seconds [10]--forced-shutdown=STRING        number of seconds to wait after the --time limit before forcing shutdown, or 'off' to disable [off]--thread-stack-size=SIZE        size of stack per thread [64K]--rate=N                        average transactions rate. 0 for unlimited rate [0]--report-interval=N             periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]--report-checkpoints=[LIST,...] dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []--debug[=on|off]                print more debugging info [off]--validate[=on|off]             perform validation checks where possible [off]--help[=on|off]                 print help and exit [off]--version[=on|off]              print version and exit [off]--config-file=FILENAME          File containing command line options--tx-rate=N                     deprecated alias for --rate [0]--max-requests=N                deprecated alias for --events [0]--max-time=N                    deprecated alias for --time [0]--num-threads=N                 deprecated alias for --threads [1]Pseudo-Random Numbers Generator options:--rand-type=STRING random numbers distribution {uniform,gaussian,special,pareto} [special]--rand-spec-iter=N number of iterations used for numbers generation [12]--rand-spec-pct=N  percentage of values to be treated as 'special' (for special distribution) [1]--rand-spec-res=N  percentage of 'special' values to use (for special distribution) [75]--rand-seed=N      seed for random number generator. When 0, the current time is used as a RNG seed. [0]--rand-pareto-h=N  parameter h for pareto distribution [0.2]Log options:--verbosity=N verbosity level {5 - debug, 0 - only critical messages} [3]--percentile=N       percentile to calculate in latency statistics (1-100). Use the special value of 0 to disable percentile calculations [95]--histogram[=on|off] print latency histogram in report [off]General database options:--db-driver=STRING  specifies database driver to use ('help' to get list of available drivers) [mysql]--db-ps-mode=STRING prepared statements usage mode {auto, disable} [auto]--db-debug[=on|off] print database-specific debug information [off]Compiled-in database drivers:mysql - MySQL driverpgsql - PostgreSQL drivermysql options:--mysql-host=[LIST,...]          MySQL server host [localhost]--mysql-port=[LIST,...]          MySQL server port [3306]--mysql-socket=[LIST,...]        MySQL socket--mysql-user=STRING              MySQL user [sbtest]--mysql-password=STRING          MySQL password []--mysql-db=STRING                MySQL database name [sbtest]--mysql-ssl[=on|off]             use SSL connections, if available in the client library [off]--mysql-ssl-cipher=STRING        use specific cipher for SSL connections []--mysql-compression[=on|off]     use compression, if available in the client library [off]--mysql-debug[=on|off]           trace all client library calls [off]--mysql-ignore-errors=[LIST,...] list of errors to ignore, or "all" [1213,1020,1205]--mysql-dry-run[=on|off]         Dry run, pretend that all MySQL client API calls are successful without executing them [off]pgsql options:--pgsql-host=STRING     PostgreSQL server host [localhost]--pgsql-port=N          PostgreSQL server port [5432]--pgsql-user=STRING     PostgreSQL user [sbtest]--pgsql-password=STRING PostgreSQL password []--pgsql-db=STRING       PostgreSQL database name [sbtest]Compiled-in tests:fileio - File I/O testcpu - CPU performance testmemory - Memory functions speed testthreads - Threads subsystem performance testmutex - Mutex performance testSee 'sysbench <testname> help' for a list of options for each test.
CPU压测
要使用 Sysbench 进行 CPU 测试,您可以按照以下步骤进行操作:
-  在目标系统上安装 Sysbench 工具。具体安装步骤可能因系统而异。对于基于 CentOS 7 的系统,您可以使用以下命令安装 Sysbench: yum install -y sysbench
-  安装完成后,可以使用以下命令运行 CPU 测试: sysbench cpu --threads=<线程数> run请将 <线程数>替换为您想要运行的线程数。该命令将运行一个 CPU 压力测试,并输出结果。例如,要使用 4 个线程运行 CPU 测试,可以执行以下命令: sysbench cpu --threads=4 run
-  Sysbench 将会运行一段时间并显示测试结果,包括每个线程的处理能力以及整体测试结果。 
请注意,Sysbench 还提供其他参数和选项,您可以根据需要进行调整。例如,您可以指定测试时间、线程数、运行次数等。
这是一个基本的示例,您可以根据实际需求进行进一步的定制和调整。
根据您提供的 Sysbench CPU 测试结果,以下是一些关键指标的解释:
-  CPU Speed(CPU 速度):表示每秒钟处理的事件数。在您的测试中,CPU 速度为 8427.01 个事件每秒。 
-  Throughput(吞吐量):表示在测试时间内处理的总事件数。在您的测试中,吞吐量为 505,647 个事件。 
-  Latency(延迟):表示事件的响应时间。其中包括最小值、平均值、最大值和第 95 百分位的值。在您的测试中,延迟的 95% 百分位为 0.48 毫秒。 
-  Threads Fairness(线程公平性):表示不同线程的事件分布情况。其中包括事件数量的平均值和标准差,以及执行时间的平均值和标准差。 
请注意,这些指标仅代表您在特定条件下进行的一次测试结果。要获取更准确和可靠的结果,建议在不同负载、不同配置和多次运行的情况下进行多次测试,并对结果进行综合分析。
相关文章:
构建sysbench的镜像
方式1:先docker run一个镜像,手动安装好commit docker run -it --name mycentos arm64v8/centos:7 /bin/bash docker commit -a "PX Bai" mycentos mycentos1 docker run -it -d --namemycentos1 mycentos1 /bin/bash docker exec -it mycent…...
leetcode解题思路分析(一百四十)1201 - 1208 题
丑数3 给你四个整数:n 、a 、b 、c ,请你设计一个算法来找出第 n 个丑数。丑数是可以被 a 或 b 或 c 整除的 正整数 。 容斥原理二分法 class Solution { public:int nthUglyNumber(int n, int a, int b, int c) {long long ab lcm((long long)a, (lo…...
FPGA设计的指导性原则 (一)
这一部分主要介绍FPGA/CPLD设计的指导性原则,如FPGA设计的基本原则、基本设 计思想、基本操作技巧、常用模块等。FPGA/CPLD设计的基本原则、思想、技巧和常用模 块是一个非常大的问题,在此不可能面面俱到,只能我们公司项目中常用的一些设计原则与 方法提纲携领地加以介绍,希…...
 
【架构】常见技术点--服务治理
导读:收集常见架构技术点,作为项目经理了解这些知识点以及解决具体场景是很有必要的。技术要服务业务,技术跟业务具体结合才能发挥技术的价值。 目录 1. 微服务 2. 服务发现 3. 流量削峰 4. 版本兼容 5. 过载保护 6. 服务熔断 7. 服务…...
 
手撕数据结构—单链表
✅作者:简单^不简单 🔥系列专栏:C语言数据结构 💖如果文章有错误,时刻欢迎大家的指正。当然觉得博主的文章还不错的话,请点赞👍收藏⭐️留言📝 💬格言:希望我…...
 
Benewake(北醒) 快速实现 TF02-i-RS485 与电脑通信操作说明
目录 一、前言二、工具准备1. USB-RS485 转接器2. TF02-i-RS4853. 兆信直流电源4.连接线、绝缘胶带、螺丝刀5. PC:Windows 系统6. 串口助手软件 三、连接方式1. USB-RS485 转接板接口说明2. TF02-i-RS485 引脚定义3. 连接图 四、TF02-i-RS485 与电脑通信操作说明1. …...
 
【分享】科大讯飞星火认知大模型(初体验)
前言: 哈喽,大家好,我是木易巷~ 随着人工智能技术的迅猛发展,自然语言处理(NLP)成为了热门话题。在众多NLP模型中,科大讯飞星火认知大模型成为了一个备受瞩目的新秀,今天我们来了解…...
logstash 采集应用日志切割问题
1.logstash [oswatch@rce1 conf]$ cat test.conf input { file { path=>["/tmp/test/test.log*"] } } output { stdout { codec=>rubydebug{} } } 2.python脚本: [oswatch@rce1 conf]$ cat t1.py #!/usr/bin/python # -*- coding: UTF-…...
 
计算机网络实验:认识Packet Tracer软件
目录 前言实验目的实验内容及要求相关知识点实验指导实验过程总结 前言 计算机网络是当今信息技术的重要组成部分,它涉及到多种硬件和软件的协同工作,以实现数据的传输和交换。为了更好地理解和掌握计算机网络的基本原理和技术,我们需要进行…...
 
【MySQL新手到通关】第六章 时间日期函数
文章目录 1.获取日期时间函数1.1 获取当前日期时间1.2 获取当前日期1.3 获取当前时间 2.日期格式化★★★2.1 日期转指定格式字符串2.2 字符串转日期 3.日期间隔3.1 增加日期间隔 ★★★3.2 减去一个时间间隔★★★3.3 日期相差天数(天)3.4 相差时间&…...
 
深蓝学院C++基础笔记 第 1 章 C++初探
第 1 章 C初探 1.从Hello World 谈起 Hello World: #include <iostream> int mian() { std::cout << "Hello World!" << std::endl; }函数: 一段能被反复调用的代码,可以接收输入,进行处理并(或)产生输出-返回…...
 
【配电网重构】基于混合整数二阶锥配电网重构研究(Matlab代码实现)
💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…...
Kubernetes mysql 实战以及外部存储处理 [一]
在 Kubernetes 中部署 MySQL 数据库需要考虑以下几个方面: 部署方式:可以选择使用 StatefulSet 或者 Deployment 进行部署,如果需要有状态的服务,使用 StatefulSet 更加合适。存储:MySQL 需要一个持久化存储来保存数据。可以使用 Kubernetes 提供的 PersistentVolumeClaim…...
 
使用【Python+Appium】实现自动化测试
一、环境准备 1.脚本语言:Python3.x IDE:安装Pycharm 2.安装Java JDK 、Android SDK 3.adb环境,path添加E:\Software\Android_SDK\platform-tools 4.安装Appium for windows,官网地址 Redirecting 点击下载按钮会到GitHub的…...
 
位图和布隆过滤器
位图和布隆过滤器 位图的概念位图的简单模拟实现位图set位图reset位图test 位图总的代码和实现位图的应用布隆过滤器布隆过滤器的简单实现相关操作讨论布隆过滤器的结构设计布隆过滤器插入布隆过滤器查找 布隆过滤器总代码 布隆过滤器优点和缺陷海量数据面试题哈希切割位图应用…...
 
Eclipse 教程Ⅳ
Eclipse 工作空间(Workspace) eclipse 工作空间包含以下资源: 项目文件文件夹 项目启动时一般可以设置工作空间,你可以将其设置为默认工作空间,下次启动后无需再配置: 工作空间(Workspace)有明显的层次结构。 项目在最顶级&…...
 
Webpack搭建本地服务器
1 开启本地服务器 2 HMR热模块替换 3 devServer配置 4 开发和生成环境 需要本地服务的目的就在每次我们保存项目源文件的时候都可以自动打包新的打包文件, 这里主要讲webpack-dev-server: 先安装: npm install webpack-dev-server -D 需要…...
 
基于Go开发PaaS平台3
Go开发PaaS平台核心功能 代码仓库地址GitHub - yunixiangfeng/gopaas 10-18 中间件前端页面以及核心API开发(中) C:\Users\Administrator\Desktop\gopaas\middlewareapi\handler\middlewareApiHandler.go package handlerimport ("context"…...
 
虎牙直播在微服务改造的实践总结
博主介绍:✌全网粉丝4W,全栈开发工程师,从事多年软件开发,在大厂呆过。持有软件中级、六级等证书。可提供微服务项目搭建与毕业项目实战、定制、远程,博主也曾写过优秀论文,查重率极低,在这方面…...
设置线程池的大小
线程池的理想大小取决于被提交任务的类型以及所部署系统的特性。在代码中通常不会固定线程池的大小,而应该通过某种配置机制来提供,或者根据Runtime. availableProcessors来动态计算。 幸运的是,要设置线程池的大小也并不困难,只需要避免“过大”和“过…...
浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)
✅ 一、ECS 服务配置 Dockerfile 确保监听 80 端口 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]或 EXPOSE 80 CMD ["python3", "-m", "http.server", "80"]任务定义(Task Definition&…...
脑机新手指南(八):OpenBCI_GUI:从环境搭建到数据可视化(下)
一、数据处理与分析实战 (一)实时滤波与参数调整 基础滤波操作 60Hz 工频滤波:勾选界面右侧 “60Hz” 复选框,可有效抑制电网干扰(适用于北美地区,欧洲用户可调整为 50Hz)。 平滑处理&…...
 
工业安全零事故的智能守护者:一体化AI智能安防平台
前言: 通过AI视觉技术,为船厂提供全面的安全监控解决方案,涵盖交通违规检测、起重机轨道安全、非法入侵检测、盗窃防范、安全规范执行监控等多个方面,能够实现对应负责人反馈机制,并最终实现数据的统计报表。提升船厂…...
 
循环冗余码校验CRC码 算法步骤+详细实例计算
通信过程:(白话解释) 我们将原始待发送的消息称为 M M M,依据发送接收消息双方约定的生成多项式 G ( x ) G(x) G(x)(意思就是 G ( x ) G(x) G(x) 是已知的)࿰…...
论文解读:交大港大上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架(一)
宇树机器人多姿态起立控制强化学习框架论文解析 论文解读:交大&港大&上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架(一) 论文解读:交大&港大&上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化…...
 
tree 树组件大数据卡顿问题优化
问题背景 项目中有用到树组件用来做文件目录,但是由于这个树组件的节点越来越多,导致页面在滚动这个树组件的时候浏览器就很容易卡死。这种问题基本上都是因为dom节点太多,导致的浏览器卡顿,这里很明显就需要用到虚拟列表的技术&…...
 
优选算法第十二讲:队列 + 宽搜 优先级队列
优选算法第十二讲:队列 宽搜 && 优先级队列 1.N叉树的层序遍历2.二叉树的锯齿型层序遍历3.二叉树最大宽度4.在每个树行中找最大值5.优先级队列 -- 最后一块石头的重量6.数据流中的第K大元素7.前K个高频单词8.数据流的中位数 1.N叉树的层序遍历 2.二叉树的锯…...
 
回溯算法学习
一、电话号码的字母组合 import java.util.ArrayList; import java.util.List;import javax.management.loading.PrivateClassLoader;public class letterCombinations {private static final String[] KEYPAD {"", //0"", //1"abc", //2"…...
 
招商蛇口 | 执笔CID,启幕低密生活新境
作为中国城市生长的力量,招商蛇口以“美好生活承载者”为使命,深耕全球111座城市,以央企担当匠造时代理想人居。从深圳湾的开拓基因到西安高新CID的战略落子,招商蛇口始终与城市发展同频共振,以建筑诠释对土地与生活的…...
CSS | transition 和 transform的用处和区别
省流总结: transform用于变换/变形,transition是动画控制器 transform 用来对元素进行变形,常见的操作如下,它是立即生效的样式变形属性。 旋转 rotate(角度deg)、平移 translateX(像素px)、缩放 scale(倍数)、倾斜 skewX(角度…...
