Java-http-response-test is a project mainly written in Java, based on the MIT license.
Servlet (v3) that responds on all requests with the same HTTP status code. The response status code is changeable via JMX.
A simple servlet that can be used to play around with load balancer probes, proxy configurations, server pools etc. Launch a few instances, configure your load balancer / proxy / whatever and start hammering while changing the response on the instances.
Launch a couple of jetty's in the root of this project:
mvn -Djetty.port=9997 jetty:run
mvn -Djetty.port=9998 jetty:run
mvn -Djetty.port=9999 jetty:run
Confgure nginx along the lines of:
upstream jetty {
server 127.0.0.1:9997;
server 127.0.0.1:9998;
server 127.0.0.1:9999;
}
server {
listen 8080;
server_name 127.0.0.1;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
location / {
proxy_pass http://jetty;
proxy_redirect off;
proxy_buffering off;
proxy_set_header host $http_host;
proxy_set_header x-real-ip $remote_addr;
}
}
Start doing requests against nginx:
while [ 1 ]; do curl http://127.0.0.1:8080/; done
nginx.conf
, reload the configuration mid-flight (nginx -s reload
) and play with the response codesproxy_next_upstream
field