---
title: "压力测试"
author: "just2learn"
date: "2015-01-06T19:36:27Z"
tags: []
categories: ["非技术"]
slug: "untitled"
draft: false
lastmod: "2015-01-06T19:52:58Z"
id: 2173275
url: "https://just2learn.iteye.com/blog/2173275"
---

**下载并安装webbench**

wget [http://blog.zyan.cc/soft/linux/webbench/webbench-1.5.tar.gz](http://blog.zyan.cc/soft/linux/webbench/webbench-1.5.tar.gz)  
tar zxvf webbench-1.5.tar.gz  
cd webbench-1.5  
make && make install

 

**运行webbench**

webbench -c 200 -t  60  [http://localhost:9000/sis](http://127.0.0.1/test.jpg)

参数：-c  指定并发数   -t 指定时间,单位秒

 

 

**统计客户端连接数**

通过查看状态为 ESTABLISHED 的，统计12000端口的连接数量

netstat -anp | grep 12000 | grep ESTABLISHED | wc -l