Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

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

  • iceclimber81
  • iceclimber81's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #154811 by iceclimber81
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!
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 10 months ago #154812 by LouisGac
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.
The topic has been locked.
  • iceclimber81
  • iceclimber81's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #154816 by iceclimber81
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!
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 10 months ago #154818 by LouisGac
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
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 10 months ago #154821 by LouisGac
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
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 10 months ago #154823 by LouisGac
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:
Code:
<!-- 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.
The topic has been locked.
  • iceclimber81
  • iceclimber81's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #154837 by iceclimber81
Excellent, thank you so much, this should make the load testing all the more realistic.
The following user(s) said Thank You: LouisGac
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose