Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run apache benchmark on session links . (I want to access some pages which are in session.)

Tags:

php

apache

I want to run apache benchmark the which is listed after userid logged in.

How can i pass this session to ab command ?

For example, x user is logged in though browser and he is redirected to his home profile page. Profile page has so many links, that will be shown only user is logged in. How can i access these links using "ab" command.

ab -n10 -c2 -p post_data.txt https://integration.crossroads.net/index.php (I posted some data using ab, it worked fine for me) .

like image 297
Sahal Avatar asked Jul 01 '11 11:07

Sahal


1 Answers

In order to do that you should create a session using browser, after that, assuming you're using standard techniques (i.e. sessions and session cookies) you'll be able to grab the cookie sent to your app containing the session id, something like

PHPSESSID=isldkdkkd8989s9f8

which can be found using firebug or your browser cookies inspector.

Having that information you can pass it to ab command with -C option and Apache Benchmark will act as a logged user

ab -n10 -c2 -p post_data.txt -C PHPSESSID=isldkdkkd8989s9f8 https://integration.crossroads.net/index.php

P.S. As Jaitsu said you should accept right answers to your questions.

like image 59
Fabio Avatar answered Oct 13 '22 00:10

Fabio