Selvamani P
Selvamani P

Reputation: 7313

How to pass the real data in load testing using ApacheBench?

Our project is almost over.now we are going to load testing..We have tested static page using below comment ab -kc 1000 -n 10000 http://www.sample.com/index.php

Now, how to pass real data so that i can check load testing.

Upvotes: 1

Views: 83

Answers (1)

Selvamani P
Selvamani P

Reputation: 7313

In Post Method :

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

Text File have below type of formated data.

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--
  • Content-Disposition is form-data
  • name is posted data name
  • Content-Type : if you have use any file it's must and give the file values as Base64 formate
  • one space is must between value and contents description

In Get Method :

Use Below method to post

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

Upvotes: 1

Related Questions