🖌️
Linux命令大全
  • Linux 命令大全
  • 命令
    • vgchange
    • ack
    • login
    • help
    • unset
    • pstree
    • emacs
    • route
    • fg
    • uupick
    • uniq
    • exportfs
    • jed
    • cd
    • bc
    • ab
    • gunzip
    • halt
    • readelf
    • fold
    • ss
    • nologin
    • users
    • unzip
    • head
    • xinit
    • dd
    • chkconfig
    • apropos
    • spell
    • rpmverify
    • ssh
    • seinfo
    • tcpreplay
    • dpkg-preconfigure
    • mkinitrd
    • patch
    • lilo
    • xclip
    • rmmod
    • nm
    • lprm
    • look
    • reject
    • ifdown
    • ifcfg
    • gcc
    • yes
    • mysqlimport
    • ed
    • nslookup
    • ispell
    • nisdomainname
    • rsh
    • ifconfig
    • inotifywait
    • whoami
    • rpmbuild
    • e2label
    • wget
    • sendmail
    • crontab
    • setfacl
    • nl
    • rename
    • jwhois
    • sort
    • lsof
    • passwd
    • exit
    • lvresize
    • cmp
    • smbpasswd
    • tree
    • elm
    • tr
    • kill
    • times
    • pgrep
    • axel
    • gdb
    • fc
    • lha
    • pfctl
    • mknod
    • bind
    • bzdiff
    • nice
    • dpkg-statoverride
    • systool
    • gpasswd
    • tar
    • slocate
    • dpkg-deb
    • file
    • zcat
    • ngrep
    • gpm
    • arptables
    • sshd
    • ipcalc
    • sar
    • basename
    • tmux
    • ftpwho
    • uuto
    • false
    • builtin
    • cksum
    • pwconv
    • rexec
    • rev
    • rm
    • source
    • fdisk
    • sync
    • killall
    • lsb_release
    • id
    • tput
    • repquota
    • uncompress
    • cut
    • ldconfig
    • mysql
    • pidof
    • sesearch
    • shift
    • openssl
    • ftp
    • vgconvert
    • nohup
    • dig
    • iostat
    • strings
    • set
    • type
    • expand
    • cancel
    • chsh
    • gzip
    • umask
    • hping3
    • logsave
    • ltrace
    • pathchk
    • nmcli
    • lscpu
    • zipsplit
    • printf
    • rpmquery
    • zip
    • diffstat
    • runlevel
    • sftp-server
    • find
    • less
    • chown
    • col
    • ifup
    • uname
    • named-checkzone
    • mke2fs
    • pssh
    • disown
    • lftpget
    • scp
    • mii-tool
    • pstack
    • lsattr
    • joe
    • ld
    • chgrp
    • dris
    • xhost
    • xauth
    • userdel
    • unarj
    • ssh-agent
    • lpstat
    • cupsenable
    • grub
    • lynx
    • ipcs
    • write
    • logrotate
    • csplit
    • seq
    • rcp
    • touch
    • lpc
    • quotaoff
    • mail
    • mpstat
    • vgreduce
    • hwclock
    • arp
    • rlogin
    • break
    • mysqlshow
    • syslog
    • gzexe
    • semanage
    • ip6tables-save
    • startx
    • pvchange
    • rpm2cpio
    • chattr
    • grep
    • volname
    • who
    • last
    • lnstat
    • read
    • atq
    • lftp
    • setsebool
    • ssh-keygen
    • bzcat
    • iptables-save
    • jobs
    • arch
    • shutdown
    • shopt
    • sh
    • more
    • iconv
    • chcon
    • od
    • nc
    • lsusb
    • squidclient
    • pwd
    • dircolors
    • which
    • fsck
    • expr
    • partprobe
    • wait
    • dpkg-split
    • get_module
    • chmod
    • vgremove
    • rcconf
    • export
    • nano
    • stat
    • blkid
    • pvdisplay
    • dump
    • elinks
    • atop
    • restorecon
    • showmount
    • suspend
    • apk
    • telint
    • supervisord
    • groups
    • ssh-add
    • fgrep
    • setpci
    • dnf
    • pwunconv
    • swapoff
    • resize
    • kexec
    • insmod
    • install
    • cpio
    • hostname
    • kernelversion
    • ex
    • at
    • unlink
    • let
    • dpkg-divert
    • egrep
    • unexpand
    • popd
    • lsmod
    • slabtop
    • dpkg-trigger
    • vi
    • colrm
    • ftptop
    • depmod
    • cdrecord
    • swapon
    • mailq
    • ping
    • mktemp
    • cu
    • as
    • uucico
    • test
    • man
    • losetup
    • strace
    • dhcrelay
    • tload
    • batch
    • split
    • parted
    • chage
    • dos2unix
    • lsblk
    • locate
    • du
    • bzip2recover
    • arj
    • ar
    • bzless
    • tty
    • exec
    • mount
    • ifstat
    • mkswap
    • grpconv
    • edquota
    • lvreduce
    • tempfile
    • init
    • fishshell
    • dstat
    • logger
    • php
    • tail
    • return
    • htdigest
    • arpwatch
    • dnsdomainname
    • iftop
    • ntpdate
    • renice
    • fping
    • quotacheck
    • quota
    • lvdisplay
    • mapfile
    • dirname
    • ntsysv
    • pwck
    • unalias
    • usermod
    • sftp
    • apt-key
    • dhclient
    • ipcrm
    • quotaon
    • vgrename
    • perl
    • sleep
    • w
    • domainname
    • vdfuse
    • ssh-keyscan
    • dpkg-reconfigure
    • info
    • mtools
    • lvremove
    • tftp
    • zfore
    • modprobe
    • vgscan
    • date
    • mysqldump
    • sysctl
    • cat
    • tac
    • bzgrep
    • nmap
    • tailf
    • bmodinfo
    • useradd
    • whatis
    • make
    • atrm
    • true
    • ftpshut
    • pvck
    • top
    • mkbootdisk
    • chfn
    • htop
    • service
    • trap
    • md5sum
    • ftpcount
    • firewall-cmd
    • ip6tables-restore
    • time
    • bzmore
    • sudo
    • tcpdump
    • iptables-restore
    • awk
    • apt-sortpkgs
    • cp
    • xargs
    • mysqladmin
    • vgcreate
    • wc
    • indent
    • screen
    • groupdel
    • comm
    • tee
    • pmap
    • free
    • curl
    • mkisofs
    • mesg
    • history
    • ip6tables
    • getenforce
    • pigz
    • talk
    • protoize
    • iptables
    • setsid
    • clockdiff
    • vgextend
    • mkfs
    • paste
    • mailstat
    • dhcpd
    • cupsdisable
    • logwatch
    • smbclient
    • bzip2
    • vmstat
    • git
    • iperf
    • wall
    • ppp-off
    • squid
    • join
    • getsebool
    • xset
    • htpasswd
    • logout
    • rmdir
    • grpunconv
    • poweroff
    • pvremove
    • iptraf
    • sed
    • mv
    • finger
    • netstat
    • skill
    • xlsclients
    • whereis
    • fuser
    • eject
    • consoletype
    • usernetctl
    • yum
    • ethtool
    • vgdisplay
    • newusers
    • blockdev
    • alias
    • hdparm
    • host
    • nethogs
    • dmesg
    • accept
    • dpkg
    • uptime
    • lvscan
    • lspci
    • chroot
    • updatedb
    • rpm
    • watch
    • logname
    • hexdump
    • zipinfo
    • nfsstat
    • continue
    • ls
    • iotop
    • ip
    • mkdir
    • aptitude
    • dirs
    • lvcreate
    • dmidecode
    • diff3
    • apt-get
    • stty
    • clock
    • pkill
    • ypdomainname
    • restore
    • ulimit
    • findfs
    • pv
    • znew
    • cal
    • ssh-copy-id
    • lpr
    • bzcmp
    • lastlog
    • bye
    • bg
    • unprotoize
    • convertquota
    • pico
    • diff
    • grpck
    • apachectl
    • env
    • fmt
    • ncftp
    • xlsfonts
    • rpmdb
    • reboot
    • lpq
    • clear
    • echo
    • pvs
    • rsync
    • arpd
    • ldd
    • lastb
    • umount
    • systemctl
    • lvextend
    • bunzip2
    • speedtest-cli
    • iptstate
    • lp
    • traceroute
    • rpmsign
    • pvscan
    • enable
    • objdump
    • command
    • arping
    • badblocks
    • gcov
    • hostid
    • local
    • ps
    • xlsatoms
    • dpkg-query
    • groupmod
    • lpadmin
    • sum
    • chpasswd
    • xz
    • groupadd
    • su
    • pr
    • e2fsck
    • unrar
    • telnet
    • ln
    • declare
    • df
    • compress
    • tracepath
    • pvcreate
    • pushd
    • readonly
Powered by GitBook
On this page
  • 补充说明
  • 语法
  • 选项
  • 参数

Was this helpful?

  1. 命令

ab

Apache服务器的性能测试工具

补充说明

ab命令 是一个测试你 Apache http 服务器的工具,你可以通过这个工具,指定一个单位时间内向 apache 发出的请求数量来看看你的 Apache 和机器配合的性能如何。

语法

ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value
] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [
-i  ]  [  -k  ]  [  -n  requests  ] [ -p POST-file ] [ -P proxy-auth-user‐
name:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type  ]
[  -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port]
]  [  -y  <tr>-attributes  ]  [  -z   <td>-attributes   ]   [http://]host‐
name[:port]/path

选项

-A auth-username:password
      #  支持基本的验证证书,用户名和密码之间使用"冒号"                    :
      # 分隔开,ab将以明文方式传送过去.不管服务器是不是需要
      # ,也就是说你的服务器需要支持401认证.

-c concurrency
      # 同时向服务器端发送的请求数目,默认状态下是一次 只执行一个http请求.

-C cookie-name=value
      # Add a Cookie: line to the request. The argument is typically in the
      # form of a name=value pair. This field is repeatable.

-d    #  Do not display  the  "percentage  served  within  XX  [ms]  table".
      # (legacy support).

-e csv-file
      # Write  a  Comma  separated value (CSV) file which contains for each
      # percentage (from 1% to 100%) the time (in milli seconds) it took to
      # serve  that percentage of the requests. This is usually more useful
      # than the 'gnuplot' file; as the results are already 'binned'.

-g gnuplot-file
      # Write all measured values out as a 'gnuplot' or TSV  (Tab  separate
      # values)  file.  This file can easily be imported into packages like
      # Gnuplot, IDL, Mathematica, Igor or even Excell. The labels  are  on
      # the first line of the file.
-h    # 显示使用说明
-H custom-header
      # 向请求包追加附加的标题字串.此参数应该是有效的标题         行(header
      # line)形式,通常使用冒号":"来分隔有效配对 (valid  pair)例如  'Accept-
      # Encoding: zip/zop;8 bit';

-i    # 使用一个 http 头(HEAD) 来替换 GET方法.不可以掺入POST 方法

-k    #  允许http      KeepAlive      ;也就是说执行多个请求在一个      http
      # 会话当中,默认是不允许的也就是no KeepAlive啦;)

-n requests
      # 执行一次测试会话的时候所发出的请求数目,默认是执行一个单一的请求
      # 当然了这样的测试结果也就没什么意义了

-p POST-file
      # 测试程序也就是ab,将向Apache server发送带有HTTP POST 的请求.

-P proxy-auth-username:password
      # 当需要通过代理测试一台 HTTP 服务器的时候而你的代理
      # 又需要用户名密码验证,这时你可以使用这个选项,同样
      # 用户名与密码之间使用冒号":"分隔开,ab将之以明文的方式
      # 发送出去,当然,前提是你的代理是处于407认证状态的

-q    #  When processing more than 150 requests, ab outputs a progress count
      # on  stderr  every  10% or 100 requests or so. The -q flag will sup‐
      # press these messages.

-s    #  When compiled in (ab -h will show you) use the SSL protected  https
      # rather  than  the  http  protocol. This feature is experimental and
      # very rudimentary. You probably do not want to use it.

-S    #  Do not display the median and standard deviation values,  nor  dis‐
      # play  the  warning/error  messages  when the average and median are
      # more than one or two times the standard deviation  apart.  And  de‐
      # fault to the min/avg/max values. (legacy support).

-t timelimit
      #  设置测试的时间的长短,使用这个选项ab将自动设置
      # 测试请求会话数目为50000,然后以你设置的时间为
      # 固定周期.默认状态下是没有时限的,也就是直到完成
      # 你所设置的请求数目为止.

-T content-type
      # 内容类型标头,使用在POST数据的时候.

-v verbosity
      # 设置冗余级别,4级打印出每个请求标头的详细信息,
      # 3级打印出回应代码(例如,404,200),2级打印出警告 信息和指示消息

-V    # 显示版本号并且退出
-w    # 打印输出结果到HTML表中. 默认的表是两列n行白底黑框

-x <table>-attributes
      # 使用字串来描述表的属性,该属性字串应该插入到<table 这里 >

-X proxy[:port]
      # Use a proxy server for the requests.

-y <tr>-attributes
      # 用于生成html表格每行的属性名 (<tr>)

-z <td>-attributes
      # 用于生成html表格每列的属性名 (<td>)

参数

主机:被测试主机。

PreviousbcNextgunzip

Last updated 5 years ago

Was this helpful?