---
title: 运行与验证
description: "显示命令帮助。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengwebs/testguide/tstg/kunpenghttpress_06_0007.html
sourcePath: /source/zh/kunpengwebs/testguide/tstg/kunpenghttpress_06_0007.html
indexId: b8ccc5728ea8da40ab63717cc60ef78bb1c3f8811d454f7253d8d8891281079866
---
# 运行与验证

#### HTTPress命令说明

显示命令帮助。

```
httpress  -h
```


HTTPress命令选项说明如表1所示。


**表1 HTTPress命令参数说明**

| 参数 | 说明 | 默认值 |
| --- | --- | --- |
| \-n | 请求数。 | 1 |
| \-t | 线程数。 | 1 |
| \-c | 并发连接数。 | 1 |
| \-k | keep alive | no |
| \-q | 无进度指示。 | no |
| \-z | GNUTLS加密优先级。 | NORMAL |
| \-h | 显示帮助。 | \- |


#### 进行默认值验证

以下命令以访问淘宝网址为例，用户使用过程中可以将网址替换成任意网址。

```
httpress -n 1 http://taobao.com
httpress -n 1 https://taobao.com
```


```
httpress -c 1 http://taobao.com
httpress -c 1 https://taobao.com
```


```
httpress -t 1 http://taobao.com
httpress -t 1 https://taobao.com
```


```
httpress -z NORMAL http://taobao.com
httpress -z NORMAL https://taobao.com
```


```
httpress  http://taobao.com
httpress  https://taobao.com
```


#### 进行非默认值验证

非默认值是指请求数、线程数等可以自定义，并不局限于本文档以下给出的值。

```
httpress -n 10  http://taobao.com
httpress -n 10  https://taobao.com
```


```
httpress -n 2 -c 2  http://taobao.com
httpress -n 2 -c 2  https://taobao.com
```


```
httpress -n 2 -c 2 -t 2  http://taobao.com
httpress -n 2 -c 2 -t 2  https://taobao.com
```


```
httpress -k  http://taobao.com
httpress -k  https://taobao.com
```


```
httpress  -q  http://taobao.com
httpress  -q  https://taobao.com
```


```
httpress -z ABNORMAL  http://taobao.com
httpress -z ABNORMAL  https://taobao.com
```


```
httpress -n 2 -c 2 -t 2 -k -q -z ABNORMAL  http://taobao.com
httpress -n 2 -c 2 -t 2 -k -q -z ABNORMAL  https://taobao.com
```


#### 运行

- HTTP短连接
  1 httpress -n 3000000 -c 300 -t 30 http://IP:PORT1/index.html

- HTTP长连接
  1 httpress -n 10000000 -c 300 -t 30 -k http://IP:PORT1/index.html

- HTTPS短连接
  1 httpress -n 100000 -c 300 -t 30 https://IP:PORT2/index.html

- HTTPS长连接
  1 httpress -n 10000000 -c 300 -t 30 -k https://IP:PORT2/index.html

  上述命令中IP地址表示Nginx服务器的IP地址，PORT1表示Nginx服务器的HTTP端口，PORT2表示Nginx服务器的HTTPS端口。
