Run apache benchmark on session links . (I want to access some pages which are in session.)
I want to run apache benchmark the which is listed after userid logged in.
How ca开发者_C百科n 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) .
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.
精彩评论