Stress and Performance Testing - studiofu/brain GitHub Wiki
Resources
ApacheBench
install
sudo apt-get install apache2-utils
test 50000 request and 1000 concurrent
ab -n 50000 -c 1000 http://192.168.1.88:9001/hello
https://blog.miniasp.com/post/2008/06/30/Using-ApacheBench-ab-to-to-Web-stress-test
wrk - a HTTP benchmarking tool
application server testing using wrk
https://www.jianshu.com/p/f7cb40a8ce22
concurrent 5000, last for 10 minutes and timeout set at 30 second
./wrk -t 8 -c 5000 -d 10m -T 30s "http://yourhostip:3000/api/test"
Apache JMeter
Web Application Performance Testing Tools
- use new template - recording the step
- setup the cert in firefox and also set the proxy to use JMeter proxy
- start the recording and JMeter will be able to log down the request
CRSF Handling
- User Defined Variables
- add crsfToken
- add the hostname
- Cookie Manager
- add the XSRF-TOKEN and set a dummy value
- Regular Expression Extractor
- setup to extract the cookie value for the XSRF-TOKEN
- name: Regular Expression Extractor
- created variable: csrfToken
- Field to Check: Response Header
- setup to extract the cookie value for the XSRF-TOKEN
Regular Expression:
Set-Cookie: XSRF-TOKEN=(.+?); Path=/; Secure
Template: $1$
BeanShell PreProcessorCSRFToken
name: BeanShell PreProcessorCSRFToken
import org.apache.jmeter.protocol.http.control.Header;
sampler.getHeaderManager().removeHeaderNamed("X-XSRF-TOKEN");
newValue=vars.get("csrfToken");
sampler.getHeaderManager().add(new Header("X-XSRF-TOKEN",newValue));
Need to download and add plugin manager
- add the jp@gc plugin
for more stress test result