sysbench 介绍

article/2025/9/27 13:37:12

sysbench介绍

参考博客:

sysbench - 老僧观天下 - 博客园

sysbench 压测 详解_俗人linux_51CTO博客

sysbench工具使用 - ZhenXing_Yu - 博客园 |QQ:327488733@qq.com

sysbench使用指南 - AhaoMu - 博客园

MySql性能测试工具-sysbench_oahz4699092zhao的专栏-CSDN博客_sysbench

sysbench是一个非常经典的综合性能测试工具,它支持CPU,IO,内存,尤其是数据库的性能测试。

1、sysbench安装

安装:

sysbench-1.0:

wget https://github.com/akopytov/sysbench/archive/1.0.zip -O "sysbench-1.0.zip" 

下载之后的名字是1.0.zip。

报错处理:如果报错,无法建立 SSL 连接。把https 换成http就好了,如果没报错,请忽略这一段。

# 解压
unzip sysbench-1.0.zip
# 进入文件
cd sysbench-1.0

 1.安装依赖库

yum install automake libtool -y

2.开始安装sysbench

[root@iz2ze2w3v37sit3vf71kuez sysbench-1.0]# ./autogen.sh
[root@iz2ze2w3v37sit3vf71kuez sysbench-1.0]# ./configure

注意:

执行./configure,我这里报错了。

报错信息:

configure: error: mysql_config executable not found
********************************************************************************
ERROR: cannot find MySQL libraries. If you want to compile with MySQL support,please install the package containing MySQL client libraries and headers.On Debian-based systems the package name is libmysqlclient-dev.On RedHat-based systems, it is mysql-devel.If you have those libraries installed in non-standard locations,you must either specify file locations explicitly using--with-mysql-includes and --with-mysql-libs options, or make sure path tomysql_config is listed in your PATH environment variable. If you want todisable MySQL support, use --without-mysql option.

#ERROR: cannot find MySQL libraries. If you want to compile with MySQL support

没找到mysql库 需要用参数指定下 --with-mysql-includes和--with-mysql-libs

这里需要指定你mysql安装的路径

shell> ./configure --with-mysql-includes=/alidata/server/mysql5.7/include/ --with-mysql-libs=/alidata/server/mysql5.7/lib/

我刚刚试了上面的方法,依然在报错

[root@iz2ze2w3v37sit3vf71kuez sysbench-1.0]# ./configure --with-mysql-includes=/var/lib/mysql/mysql --with-mysql-libs=/var/lib/mysql/mysql/

报错信息:

checking for library containing mysql_real_connect... no
configure: error: cannot find MySQL client libraries in /var/lib/mysql/mysql/

这里依然没找到mysql的这个文件,可能是我记错了mysql的路径了。

放弃依赖mysql

因为我使用sysbench单纯的做linux压测,不压mysql。所以我们此时安装,放弃依赖mysql

[root@iz2ze2w3v37sit3vf71kuez sysbench-1.0]# ./configure --without-mysql

然后执行make和make install

[root@iz2ze2w3v37sit3vf71kuez sysbench-1.0]# make
[root@iz2ze2w3v37sit3vf71kuez sysbench-1.0]# make install
[root@iz2ze2w3v37sit3vf71kuez sysbench-1.0]# sysbench --version
sysbench 1.0.20

这样就安装成功了。

2、sysbench介绍:

sysbench是一个开源的、模块化的、跨平台的多线程性能测试工具,可以用来进行CPU、内存、磁盘I/O、线程、数据库的性能测试。

目前支持的数据库有MySQL、Oracle和PostgreSQL。

当前功能允许测试的系统参数有:

CPU运算性能

file         I/O performance (磁盘IO性能)

scheduler         performance (调度程序性能)

memory         allocation and transfer speed (内存分配及传输速度)

POSIX         threads implementation performance (POSIX线程性能)

database         server performance (OLTP benchmark) (数据库服务器性能,OLTP基准测试)

3、使用说明

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],创建测试线程的数目。默认为1.--events=N                      limit for total number of events [0],请求的最大数目,0代表不限制。--time=N                        limit for total execution time in seconds [10],最大执行时间,单位是s。默认是10s--forced-shutdown=STRING        number of seconds to wait after the --time limit before forcing shutdown, or 'off' to disable [off],超过max-time强制中断。默认是off。--thread-stack-size=SIZE        size of stack per thread [64K],每个线程的堆栈大小。默认是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],是否显示更多的调试信息。默认是off。--validate[=on|off]             perform validation checks where possible [off],#在可能情况下执行验证检查。默认是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],日志级别,默认为3,5=debug,0=只包含重要信息--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 test,#内存threads - Threads subsystem performance test,#线程mutex - Mutex performance test#互斥性能测试See 'sysbench <testname> help' for a list of options for each test.

-- 查看总体帮助文档

#sysbench --help

-- 查测试cpu的帮助文档 


#sysbench --test=cpu help
--cpu-max-prime=N  最大质数发生器数量。默认是10000

-- 查看IO测试的帮助文档

[root@iz2ze2w3v37sit3vf71kuez ~]# sysbench --test=fileio help
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.17 (using system LuaJIT 2.0.4)fileio options:--file-num=N                  number of files to create [128],创建测试文件的数量。默认是128--file-block-size=N           block size to use in all IO operations [16384],测试时文件块的大小。默认是16384(16K)--file-total-size=SIZE        total size of files to create [2G],测试文件的总大小。默认是2G--file-test-mode=STRING       文件测试模式{seqwr(顺序写), seqrewr(顺序读写), seqrd(顺序读), rndrd(随机读), rndwr(随机写), rndrw(随机读写)}                       --file-io-mode=STRING         文件操作模式{sync(同步),async(异步),fastmmap(快速map映射),slowmmap(慢map映射)}。默认是sync--file-async-backlog=N        number of asynchronous operatons to queue per thread [128]--file-extra-flags=[LIST,...] 使用额外的标志来打开文件{sync,dsync,direct} 。默认为空--file-fsync-freq=N           执行fsync()的频率。(0 – 不使用fsync())。默认是100--file-fsync-all[=on|off]     每执行完一次写操作就执行一次fsync。默认是off--file-fsync-end[=on|off]     在测试结束时才执行fsync。默认是on--file-fsync-mode=STRING      使用哪种方法进行同步{fsync, fdatasync}。默认是fsync--file-merged-requests=N      如果可以,合并最多的IO请求数(0 – 表示不合并)。默认是0--file-rw-ratio=N             测试时的读写比例,默认时为1.5,即可3:2。

-- 查看测试内存的帮助文档

#sysbench --test=memory help

[root@iz2ze2w3v37sit3vf71kuez ~]# sysbench --test=memory help
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.17 (using system LuaJIT 2.0.4)memory options:--memory-block-size=SIZE  测试时内存块大小。默认是1K--memory-total-size=SIZE    传输数据的总大小。默认是100G--memory-scope=STRING    内存访问范围{global,local}。默认是global--memory-hugetlb=[on|off]  从HugeTLB池内存分配。默认是off--memory-oper=STRING     内存操作类型。{read, write, none} 默认是write--memory-access-mode=STRING存储器存取方式{seq,rnd} 默认是seq

-- 查看测试线程的帮助文档

#sysbench threads help

[root@iz2ze2w3v37sit3vf71kuez ~]# sysbench threads help
sysbench 1.0.17 (using system LuaJIT 2.0.4)threads options:--thread-yields=N number of yields to do per request [1000],每个请求产生多少个线程。默认是1000--thread-locks=N  number of locks per thread [8],每个线程的锁的数量。默认是8

-- 查看mutex的帮助文档

#sysbench mutex help

[root@iz2ze2w3v37sit3vf71kuez ~]# sysbench mutex help
sysbench 1.0.17 (using system LuaJIT 2.0.4)mutex options:--mutex-num=N   total size of mutex array [4096],数组互斥的总大小。默认是4096--mutex-locks=N number of mutex locks to do per thread [50000],每个线程互斥锁的数量。默认是50000--mutex-loops=N number of empty loops to do outside mutex lock [10000],内部互斥锁的空循环数量。默认是10000

sysbench的基本命令格式为:

sysbench –test=< test-name> [options]… < command>

sysbench [general-options]... --test=<test-name> [test-options]... command

General options: #通用选项

--num-threads=N         number of threads to use [1] #创建测试线程的数目。默认为1.

--max-requests=N         limit for total number of requests [10000] #请求的最大数目。默认为10000,0代表不限制。

--max-time=N         limit for total execution time in seconds [0] #最大执行时间,单位是s。默认是0,不限制。

--forced-shutdown=STRING         amount of time to wait after --max-time before forcing shutdown [off] #超过max-time强制中断。默认是off。

--thread-stack-size=SIZE         size of stack per thread [32K] #每个线程的堆栈大小。默认是32K。

--init-rng=[on|off]                 initialize random number generator [off] #在测试开始时是否初始化随机数发生器。默认是off。

--test=STRING         test to run #指定测试类型。

fileio

cpu

memory

threads

mutex

--debug=[on|off]         print more debugging info [off] #是否显示更多的调试信息。默认是off。 --validate=[on|off]         perform validation checks where possible [off] #在可能情况下执行验证检查。默认是off。

--help=[on|off]         print help and exit #帮助信息。 --version=[on|off] print version and exit #版本信息。

--report-interval         --指定每多少秒在屏幕上输出一次结果

--日志选项

--verbosity=N         --日志级别,默认为3,5=debug,0=只包含重要信息

Compiled-in tests: #测试项目

fileio - File I/O test #IO

cpu - CPU performance test #CPU

memory - Memory functions speed test #内存

threads - Threads subsystem performance test #线程

mutex - Mutex performance test #互斥性能测试

oltp - OLTP test # 数据库,事务处理

Commands:

测试的步骤

prepare:测试前准备工作(生成测试需要的数据);

run:进行性能测试

cleanup:测试后删掉测试数据

help version

See 'sysbench --test=<name> help' for a list of options for each test. #查看每个测试项目的更多选项列表

二、压测实战

2.1 cpu性能测试

常用参数

  • –cpu-max-prime: 素数生成数量的上限
  • –threads: 线程数
  • –time: 运行时长,单位秒
  • –events: event上限次数

结果分析

[root@iz2ze2w3v37sit3vf71kuez ~]# sysbench cpu --cpu-max-prime=20000 --threads=2 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)Running the test with following options:
Number of threads: 2//线程数为2
Initializing random number generator from current timePrime numbers limit: 20000//2万个素数Initializing worker threads...Threads started!CPU speed:events per second:   303.63General statistics:total time:                          10.0040s //花费10stotal number of events:              3038 //10秒内所有线程一共完成了3038次eventLatency (ms):min:                                    2.78 //最小耗时2.78msavg:                                    6.57 //平均耗时6.57msmax:                                   43.05 //最大耗时43.05ms95th percentile:                       26.20 //95%在26.20ms完成sum:                                19968.27Threads fairness:events (avg/stddev):           1519.0000/2.00execution time (avg/stddev):   9.9841/0.00

2.2 磁盘IO性能测试

#准备数据

sysbench --test=fileio --file-total-size=2G prepare

#运行测试

WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: --max-time is deprecated, use --time instead
sysbench 1.0.18 (using bundled LuaJIT 2.1.0-beta2)Running the test with following options:
Number of threads: 1
Initializing random number generator from current timeExtra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...Threads started!File operations:reads/s:                      612.68 writes/s:                     408.44 fsyncs/s:                     1307.77Throughput:read, MiB/s:                  9.57 //读吞吐written, MiB/s:               6.38 //写吞吐General statistics:total time:                          30.0436stotal number of events:              69851Latency (ms):min:                                    0.00avg:                                    0.43max:                                  213.9595th percentile:                        1.76sum:                                29921.46Threads fairness:events (avg/stddev):           69851.0000/0.00execution time (avg/stddev):   29.9215/0.00

#清理数据

sysbench --test=fileio --file-total-size=2G cleanup

我们再来一次,压测IO。然后使用top命令查看服务器状态。

我们再复习一下top展示含义

0.7 us

用户进程消耗的cpu,一般小于70%/80%是正常的

1.0 sy

系统内核进程消耗的cpu(操作系统的底层资源是在内核完成的,比如读写磁盘。超过10%就很高了,可能是IO、中断、上下文切换导致的

0.0 ni

改变过优先级的进程占用CPU的百分比

98.3 id

空闲cpu百分比

0.0 wa

等待IO的进程所消耗的占CPU的百分比,直观说就是 如果这个值很高 就代表 cpu利用率不高 但是io很繁忙,需要去查一下io

0.0 hi

硬件中断所消耗的CPU占比(硬中断 Hardware IRQ)

0.0 si

软件中断所消耗的CPU占比(软中断 Software Interrupts)

通过分析得知

负载处于正常值

cpu行,us 正常,sy 8.1有一点点大 wa 为90.2%,这个值非常大。

wa的值非常高,等待IO的进程所消耗的占CPU的百分比,直观说就是 如果这个值很高 就代表 cpu利用率不高 但是io很繁忙,需要去查一下io。

所以,这里断定是io导致wa的值非常高。

下一步我们去查看,哪个进程,在大量的io

iostat -x
avg-cpu:  %user   %nice %system %iowait  %steal   %idle1.27    0.00    8.40   90.33    0.00    0.00Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
vda               0.00   140.46 1073.03 2497.46 57397.46 10141.48    37.83     1.71    0.48    0.73    0.37   0.27  96.51

字段释意:

avgqu-sz:平均i/o队列长度,建议不超过1
svctm:磁盘本身(磁盘读写)的耗时<4ms。平均每次设备的IO操作的服务时间(毫秒),即delta(use)/delta(rio+wio)
await:操作系统每次IO的平均耗时,等待磁盘读写时间+svctm之和,单位是毫秒。一般情况下await大于svctm,他们的差值越小,则说明队列越短。反之,差值越大,队列越长,说明系统出了问题。
%util:磁盘繁忙程度。i/O请求占cpu的百分比,比率越大,说明越饱和。当%util达到1时,说明设备带宽已经被占满。    rrqm/s:每秒进行merge的读操作次数。即 rmerge/s
wrqm/s:每秒进行merge的写操作次数。即 wmerge/s
r/s:每秒完成的读 I/O 设备次数。即 rio/s
w/s:每秒完成的写 I/O 设备次数。即 wio/s
rkB/s:每秒读K字节数。是 rsect/s 的一半,因为每扇区大小为512字节。
wkB/s:每秒写K字节数。是 wsect/s 的一半。
avgrq-sz: 平均每次设备I/O操作的数据大小 (扇区)。

%iowait: CPU等待输入输出完成时间的百分比。

%util: 磁盘繁忙程度。i/O请求占cpu的百分比,比率越大,说明越饱和。当%util达到1时,说明设备带宽已经被占满。

%iowait 90.33

%util 96.51

根据这两个值,断定磁盘在大量io。

到底是在读呢,还是在写呢,根据rkB/s与wkB/s判断。

通过rkB/s与wkB/s可以判断出,如果io很高的话,到底是读导致的还是写导致的。如果是读导致的,应该是内存不足。如果写占比大,说明某个应用程序在写。此时可以查看哪个程序在写东西,(写文件或者写日志)

rkB/s    :57397.46

wkB/s :10141.48

我们对比一下平时磁盘的,io情况。

 相比,我们此时读和写都很大。

确认了IO负载过高后,可以使用iotop工具具体查看IO负载主要是落在哪个进程上了。

使用 pidstat -d 来查看进程的io情况

pidstat -d 2     2秒更新一次

[root@iz2ze2w3v37sit3vf71kuez ~]# pidstat -d 2
Linux 3.10.0-514.26.2.el7.x86_64 (iz2ze2w3v37sit3vf71kuez) 	2021年12月09日 	_x86_64_	(1 CPU)16时02分12秒   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
16时02分14秒     0       258      0.00     22.34      0.00  jbd2/vda1-8
16时02分14秒     0      4261   5398.98      0.00      0.00  java
16时02分14秒     0     31978  70495.43  10387.82      0.00  sysbench16时02分14秒   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
16时02分16秒    99      4376   2111.34      0.00      0.00  nginx
16时02分16秒     0     31978  73797.94  10886.60      0.00  sysbench

发现,sysbench 在大量读写。

字段释意:

字段说明
PID:进程id
kB_rd/s:每秒从磁盘读取的KB
kB_wr/s:每秒写入磁盘KB
kB_ccwr/s:任务取消的写入磁盘的KB。当任务截断脏的pagecache的时候会发生。
COMMAND:task的命令名
iodelay:  IO的延迟时间IO延迟是指控制器将IO指令发出后,到IO完成的过程中所消耗的时间。
pidstat -d 查看哪个进程的IO有问题,主要查看iodelay(io的延迟时间),一般小于1(单位ms)。
如果持续大于10,说明磁盘有瓶颈

例子1

1)生成测试文件,prepare阶段,生成需要的测试文件,完成后会在当前目录下生成很多小文件。

--num-threads 开启的线程 --file-total-size 总的文件大小

sysbench --test=fileio --file-num=10 --file-total-size=5G prepare 表示生成10个5G的文件

2)测试,run阶段

sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrw --max-time=180 --max-requests=100000000 --num-threads=16 --init-rng=on --file-num=10 --file-extra-flags=direct --file-fsync-freq=0 --file-block-size=16384 run

3)清除测试数据

sysbench --test=fileio --file-num=10 --file-total-size=5G cleanup

例子2 IO随机读测试样例

--创建10G的文件,分成4个,测试16K块大小,使用direct方式读,测试600秒(10分钟),启用64个线程,每3秒输出一次结果

prepare

#sysbench --test=fileio --file-num=4 --file-block-size=16384 --file-total-size=10G --file-test-mode=rndrd --file-extra-flags=direct --max-requests=0 --max-time=600 --num-threads=64 --report-interval=3 prepare       

run

#sysbench --test=fileio --file-num=4 --file-block-size=16384 --file-total-size=10G --file-test-mode=rndrd --file-extra-flags=direct --max-requests=0 --max-time=600 --num-threads=64 --report-interval=3 run

cleanup

#sysbench --test=fileio --file-num=4 --file-block-size=16384 --file-total-size=10G --file-test-mode=rndrd --file-extra-flags=direct --max-requests=0 --max-time=600 --num-threads=64 --report-interval=3 cleanup

例子3

prepare阶段,生成需要的测试文件,完成后会在当前目录下生成很多小文件。

sysbench --test=fileio --num-threads=16 --file-total-size=2G --file-test-mode=rndrw prepare

run阶段

sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw run

清理测试时生成的文件

sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw cleanup

b、cpu测试

参数详解:

–cpu-max-prime=N 用来选项指定最大的素数,具体参数可以根据CPU的性能来设置,默认为10000

sysbench --test=cpu --cpu-max-prime=20000 run

c、内存分配及传输速度(测试了内存的连续读写性能)

参数详解:

–memory-block-size=SIZE 测试内存块的大小,默认为1K

–memory-total-size=SIZE 数据传输的总大小,默认为100G

–memory-scope=STRING 内存访问的范围,包括全局和本地范围,默认为global

–memory-hugetlb=[on|off] 是否从HugeTLB池分配内存的开关,默认为off

–memory-oper=STRING 内存操作的类型,包括read, write, none,默认为write

–memory-access-mode=STRING 内存访问模式,包括seq,rnd两种模式,默认为seq

例子1

sysbench --test=memory --memory-block-size=8K --memory-total-size=1G --num-threads=16 run

d、线程测试

sysbench --test=threads --num-threads=500 --thread-yields=100 --thread-locks=4 run

sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 run

sysbench --threads=10 --max-time =300 --threads run


http://chatgpt.dhexx.cn/article/vQZu2Ctq.shtml

相关文章

Linux性能优化(二)——sysbench压力测试工具

一、sysbench简介 1、sysbench简介 sysBench是一个模块化的、跨平台、多线程基准测试工具&#xff0c;主要用于评估测试各种不同系统参数下的数据库负载情况。sysbench提供如下测试&#xff1a; &#xff08;1&#xff09;CPU性能 &#xff08;2&#xff09;磁盘IO性能 &…

CScope for programmer

http://bbs.sjtu.edu.cn/bbs0an,path,%2Fgroups%2FGROUP_3%2FGNULinux%2FSoftware%2FD95E89182%2FD5277E56B.html8、Cscope 的使用这下更厉害了, 用Cscope自己的话说 - "你可以把它当做是超过频的ctags", 其功能和强大程度可见一斑吧, 关于它的介绍我就不详细说了, …

CSP安全策略

介绍 内容安全策略 (CSP) 是一个附加的安全层&#xff0c;用于帮助检测和缓解某些类型的攻击&#xff0c;包括跨站脚本 (XSS) 和数据注入等攻击。 这些攻击可用于实现从数据窃取到网站破坏或作为恶意软件分发版本等用途。 启动方式 1. 浏览器客户端启动 <meta http-equi…

seccompptcl(pwn出题)

详细细节看这篇 https://www.anquanke.com/post/id/208364#h2-2 沙箱可以禁用一些系统调用&#xff0c;还是比较常见的感觉。 seccomp 下面这段代码用seccomp沙箱来禁用 安装相应库 sudo apt-get install libseccomp-dev具体参数啥的就不多讲了。。。看大佬的博客就行。 …

CSplitterWnd

MFC支持两种类型的拆分窗口&#xff1a;静态的和动态的。 静态拆分窗口的行列数在拆分窗口被创建时就设置好了&#xff0c;用户不能更改。但是用户可以缩放各行各列。一个静态拆分窗口最多可以包含16行16列。 要找一个使用了静态拆分窗口的应用程序&#xff0c;只要看一下windo…

【UNIX网络编程】|【07】SCTP协议探究

文章目录 1、概述2、接口模型2.1 一到一形式2.2 一到多形式 3、sctp_bindx函数4、sctp_connectx函数5、sctp_getpaddrs函数6、sctp_freepaddrs函数7、sctp_getladdrs函数8、sctp_freelpaddrs9、sctp_sendmsg10、sctp_recvmsg11、sctp_opt_info12、sctp_peeloff函数13、shudown1…

C++网络编程-tcpip协议

目录 1 tcp/ip协议族 1.1 体系结构以及主要协议 1.2 封装 1.3 分用 1.4 测试网络 1.5 arp协议工作原理 1.6 dns工作原理 1.7 socket和tcp/ip协议族的关系 2 ip协议详解 2.1 ip服务特点 2.2 ipv4头部结构 2.3 ip分片 2.4 ip路由 3 tcp协议详解 3.1 tcp服务的特点…

CSP绕过

01 比赛中常见的绕过CSP csp例子&#xff1a; <meta http-equiv"Content-Security-Policy" content"script-src self; object-src none; style-src cdn.example.org third-party.org; child-src https:">目前在比赛中常见的绕过 CSP 一般是: scri…

CS的使用

1&#xff09;首先创建服务端 命令&#xff1a;teamserver 192.168.71.130(主机IP) 123456&#xff08;随便设&#xff09; teamserver 192.168.71.130 123456 >/dev/null 2>&1 & (命令隐藏后台&#xff0c;jobs查看后台&#xff0c;客户端同理&#xff0c;在st…

C/C++Unix网络编程-IPC简介

IPC是进程间通信的简称。 进程、线程与信息共享 Unix进程间的信息共享的方式&#xff1a; (1) 左边的两个进程共享存留于文件系统中某个文件上的某些信息。为访问这些信息、每个进程都得穿越内核(例如read、write、lseek等)。当一个文件有待更新时&#xff0c;某种形式的同步…

CTP For Python

GitHub地址&#xff1a;https://github.com/shizhuolin/PyCTP 这是程序化期货交易上期ctp接口版本.将其包装为python版本. 支持python3 编译需求:vs2010/gcc 编译方法 python setup.py build PyCTP 编译方法 开发环境&#xff1a;windows 10 64bit, python 3.4.3 32bit, Visu…

CSP-S 2021

[CSP-S 2021] 括号序列 题目描述 小 w 在赛场上遇到了这样一个题&#xff1a;一个长度为 n n n 且符合规范的括号序列&#xff0c;其有些位置已经确定了&#xff0c;有些位置尚未确定&#xff0c;求这样的括号序列一共有多少个。 身经百战的小 w 当然一眼就秒了这题&#x…

CyberSploit:1

一、环境搭建 靶机下载地址&#xff1a;https://www.vulnhub.com/entry/cybersploit-1,506/ 二、漏洞复现 探测靶机ip地址&#xff0c;得到靶机IP地址 nmap扫描服务以及端口&#xff0c;发现80和22端口 访问80端口&#xff0c;看到一个页面&#xff0c;查看源码未发现东西 …

[网络安全]dSploit-Android系统下的网络分析和渗透套件的使用

一、准备工作 一台已经获得root权限的安卓手机&#xff0c;并且安卓系统版本在 2.3 以上 busyBox 安装软件 下载地址 BusyBox 是一个集成了一百多个最常用linux命令和工具的软件。&#xff3b;百度百科&#xff3d; 安装这个软件主要是为dsploit软件的运行提供 linux 中…

记一次无线渗透

用到的工具 一台root的安卓手机&#xff08;我这台手机刷了miui9&#xff09; Csploit 安卓渗透神器 下载地址&#xff1a;https://github.com/cSploit/android/releases Kali meterpreter 当然你有Kali的Nethunter设备更好 开始测试 利用万能钥匙找一波wifi&#xff0c;运气好…

为网络安全红队方向提供的资源,工具大合集(渗透测试)

这是一份必备的资源大合集&#xff0c;收录了最优秀的网络安全红队方向&#xff08;渗透测试&#xff09;的资源和工具。 &#xff08;文末领取读者福利&#xff09; 无论您是初学者还是专业人士&#xff0c;都能从中获得所需的技能和知识。 在这个信息化时代&#xff0c;网络…

如何在网站中插入视频

&#xfeff;&#xfeff; 很多新手站长在往自己网站里&#xff0c;添加土豆优酷等视频网站里的视频时&#xff0c;会遇到一些麻烦,珊珊在这里向大家介绍一种简单方法. 1.首先要找到要插入的视频&#xff0c;如下图点击分享给朋友右侧的小按钮. 2.点击按钮后弹出一个窗口点击复…

Word中轻松插入本地视频

场景 在Word文档中插入视频 实现 新建或打开Word文档 找到上面插入菜单栏&#xff0c;点击并选择对象 点击后选择PPT 点击确定 此时会打开PPT&#xff0c;然后再选择上面的插入 选择插入下的视频选项&#xff0c;然后选择PC上的视频 选择视频后点击插入 可以调整视频大小 …

如何在html里插入视频

第一步&#xff1a;首先下载video.js&#xff0c;百度一下就能找到。 这个是下载后的目录。 第二步&#xff1a;先把要用到的js\css\swf都加载到html页面上。 如&#xff1a; 第三步&#xff1a;加入下面的代码&#xff1a; <video id"my_video_1" class"…

制作往图片里插入视频,视频添加到图片上播放

在视频中还有个小视频同时播放&#xff0c;这种画中画的效果以前都学习过&#xff0c;那在图片上插入视频播放&#xff0c;可以用媒体梦工厂中的画中画功能来制作吗&#xff1f;这个肯定是可以的了。下面就来看看怎么的操作的吧。 先来看看图片加视频制作出来的画中画效果 制作…