Testing server load: Which URL or parameters to pass to testing sites?

More
5 months 6 days ago #154811 by iceclimber81
iceclimber81 created the topic: Testing server load: Which URL or parameters to pass to testing sites?
Hi there,

I'm trying to test whether my shared hosting server can handle up to 100 respondents accessing the survey at the same time (realistic scenario since students in a classroom will be asked to access the survey during the last 15 minutes).

I have tried loader.io as a load testing site. However, when the test service accesses the survey URL (for example www.mydomain.com/survey/index.php/599194 ) this does not seem to prompt LimeSurvey to open a session with all its load implications, whether I have activated a welcome page or not. Only when the 'next' button is clicked does this seem to happen.

loader.io does allow to specify GET or POST parameters, or a payload file URL.

Which URL or which parameters do I need to give the testing site (loader.io or similar) so the test becomes a realistic scenario?

Thank you for your help!

Please Log in to join the conversation.

More
5 months 6 days ago #154812 by LouisGac
LouisGac replied the topic: Testing server load: Which URL or parameters to pass to testing sites?
Just use your the tab network of Chrome developer tools ("inspect") to see what is passed when clicking the "next" button.

If you don't know how to use the network tab, those threads can be useful:
www.exegetic.biz/blog/2016/09/viewing-post-data/
stackoverflow.com/questions/9163251/chrome-source-of-post-data
superuser.com/questions/395919/where-is-...eloper-tools-network

You'll need to get the csrf token from the HTML.

Please Log in to join the conversation.

More
5 months 6 days ago #154816 by iceclimber81
iceclimber81 replied the topic: Testing server load: Which URL or parameters to pass to testing sites?
Thank you, I had tried this already but thought I needed to trigger the form to submit. However, the following will do the trick:

www.mydomain.com/survey/index.php/599194 ?movenext=movenext

Thanks!

Please Log in to join the conversation.

More
5 months 6 days ago #154818 by LouisGac
LouisGac replied the topic: Testing server load: Which URL or parameters to pass to testing sites?
Well you should have seen "movenext" inside the POST data from the Chrome Developer Tools.

If you want/need to understand the rendering process of frontend, I suggest you to rather read the develop version of surveyRuntimes and controllers. I cleaned it a lot and now it's much more "human readable":
github.com/LimeSurvey/LimeSurvey/blob/de...untimeHelper.php#L94

Please Log in to join the conversation.

More
5 months 6 days ago #154821 by LouisGac
LouisGac replied the topic: Testing server load: Which URL or parameters to pass to testing sites?
Because you'll probably need more POST data if you want to test several pages, and because other people could be interested, here how to process in detail:

1. Go to your survey

2. Open Chrome extension tool (right click, "inspect")

3. Click on the "Network" tab

4. Click on the "Next" button of the survey

5. You'll see all the resources that are reach by the network

6. The one that interests you is "index.php": click on it


7. Once you clicked on it, the left part change and show you the headers sent to the server for index.php:


8. Scroll down to find the section called "Form Data" (the post request)


So for us it's:
YII_CSRF_TOKEN:6cc47e9fdd3f4e1865246bcc00d01a865554007c
fieldnames:
sid:82556
lastgroupname:_WELCOME_SCREEN_
LEMpostKey:2104474400
thisstep:0
move:movenext

9. Click on the tab "View source" to get a version you can use in your script:


so for us:
YII_CSRF_TOKEN=6cc47e9fdd3f4e1865246bcc00d01a865554007c&fieldnames=&sid=82556&lastgroupname=_WELCOME_SCREEN_&LEMpostKey=2104474400&thisstep=0&move=movenext
Attachments:
The following user(s) said Thank You: Ben_V

Please Log in to join the conversation.

More
5 months 6 days ago #154823 by LouisGac
LouisGac replied the topic: Testing server load: Which URL or parameters to pass to testing sites?
about CSRF token: www.yiiframework.com/wiki/274/how-to-val...-token-with-session/

You can find it at the top of the form (just after the <form> tag), as an hidden input:
<!-- Start of the main Form-->
<form id="limesurvey" name="limesurvey" autocomplete="off" class="survey-form-container" enctype="multipart/form-data" action="/LimeSurveyNext/index.php/82556" method="post">
<input type="hidden" value="6cc47e9fdd3f4e1865246bcc00d01a865554007c" name="YII_CSRF_TOKEN" />

It's different at each page load, so your script must grab it from the HTML code.

Please Log in to join the conversation.

More
5 months 6 days ago #154837 by iceclimber81
iceclimber81 replied the topic: Testing server load: Which URL or parameters to pass to testing sites?
Excellent, thank you so much, this should make the load testing all the more realistic.
The following user(s) said Thank You: LouisGac

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now