2016-09-15 15 views
1

我們的項目幾乎over.now我們要加載testing..We已經使用下面的評論ab -kc 1000 -n 10000 http://www.sample.com/index.php如何在使用ApacheBench的負載測試中傳遞真實數據?

現在,如何通過真實的數據,這樣我可以檢查負載測試測試靜態頁面。

+0

我已經請參閱下面的鏈接,它是用滿了觀衆 1 https://www.garron.me/en/go2linux/how-benchmark-stress- your-apache-nginx-or-iis-server.html 2 http://www.devside.net/wamp-server/load-testing-apache-with-ab-apache-bench 3 https:// www.petefreitag.com/item/689.cfm –

回答

1

在POST方法:

ab -n 1 -c 1 -p text.txt -T "multipart/form-data; boundary=1234567890" www.project.com/post_data.php 

文本文件低於類型格式化的數據。

text.txt 

--1234567890 
Content-Disposition: form-data; name="auth_token" 

MTQ3NDg2ODQxMjExOTAxMQ== 
--1234567890 
Content-Disposition: form-data; name="image"; filename="admmin.jpg" 
Content-Type: image/jpeg 

Base64 (Image Code Put Here) 
--1234567890-- 
  • 內容處置是表單數據
  • 名稱發佈的數據名稱
  • 內容類型:如果您有使用它必須在任何文件,併爲該文件價值爲Base64甲
  • 一個空間是必須的價值和內容描述之間

在獲取方法:

使用下面的方法來發布

**ab -n 1 -c 1 http://sample.com/api/v1.0/users/authentication/forgot_password.php?data="{\"email\":\"[email protected]\",\"type\":\"ut\"}"**

相關問題