云计算aws系列:benchmarking

本文介绍了如何使用sysbench进行CPU、文件IO和Web服务器性能测试,包括安装sysbench、执行CPU和磁盘IO基准测试,并通过Apache压力测试工具ab进行Web服务器性能评估。此外,还提供了sysbench与ApacheBench(ab)的参数说明和使用示例。
摘要由CSDN通过智能技术生成

1. install sysbench

>>>sudo apt-get update

>>>sudo apt-get install sysbench


2. CPU testing

>>> sysbench --test=cpu--cpu-max-prime=40000 run

>>> sysbench --test=cpu --cpu-max-prime=50000 --num-threads=4 run


3. File IO Performance Benchmarking

a. Prepare a 20 GB file to check the disk IO performance. This can be done using the command below.

>>> sysbench --test=fileio --file-total-size=20G prepare

sysbench 0.4.12: multi-threaded system evaluation benchmark


b. You should prepare a new file for each sysbench IO test that you run. This test file should be bigger than your RAM size (to avoid caching the file in memory during the benchmark). This step might take around 30 minutes, so you should use byobu/screen/tmux to avoid losing any work after disconnecting from the ssh.(see "how to disable ssh timeout" at http://blog.csdn.net/suiqiji206/article/details/50529408)


c. Now, run a benchmark that randomly reads and writes to this file. You should use the command:

>>> sysbench --test=fileio --file-total-size=20G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run



4. web server benchmarking

a. install apache2

>>> sudo apt-get install apache2

>>> sudo apt-get install apache2-utils

Verify that apache is running by visiting the Public DNS Address of your running instance on a web browser. You should see the following "It Works"page or a variant of it

 

b. test web server. eg. send 1000 requests to http://localhost/ with concurrency level of 100.

>>> ab -n 1000 -c 100 http://localhost/


c.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值