开发者

How to simulate DDOS/Slashdotting?

So, I'd like to get more experience working with high-tr开发者_JAVA百科affic websites, but unfortunately the Internet is not beating down the doors to my blog.

How can I simulate tens/hundreds of hits per second on my blog and test its performance? I'm hosting my blog with an SSH account on a shared server.


You can send lots of requests to your server, using tools such as :

  • ab
  • siege
  • JMeter


The first one, ab, will only allow you to send lots of a requests to a single URL -- which is great to benchmark a single script / page ; but doesn't reflect the real pattern of a user browsing your website (CSS/JS/images don't get loaded, for example).

The second one, siege, will allow you to send requests to a list of URLs, specified in a text file -- building that list of URLs properly (there is a proxy for that) will get you some not too bad tests.

And the third one, JMeter, will allow you to create more complex scenarios.
That one is more complex, and you'll need a bit of time to use it -- but that's probably what will get you the best results.


HTTP(S) benchmark tools, testing/debugging, & restAPI (RESTful)

Located in alphabetical order (not prefer)

HTTP(S) Benchmark Tools

  • ab – slow and single threaded, written in C
  • apib – most of the features of ApacheBench (ab), also designed as a more modern replacement, written in C
  • baloo – Expressive end-to-end HTTP API testing made easy, written in Go (golang)
  • baton – HTTP load testing, written in Go (golang)
  • bombardier – Fast crossplatform HTTP benchmarking tool, written in Go (golang)
  • curl-loader – performance loading of various application services and traffic generation, written in C
  • fasthttploader – benchmark (kinda ab) with autoadjustment and charts based on fasthttp library, write in Go (golang)
  • fortio – load testing library and command line tool and web UI. Allows to specify a set query-per-second load and record latency histograms and other useful stats, write in Go (golang)
  • gatling – High performance load testing framework based on Scala, Akka and Netty, write in Scala
  • go-wrk – a HTTP benchmarking tool based in spirit on the excellent wrk tool (wg/wrk), write in Go (golang)
  • goad – Goad is an AWS Lambda powered, highly distributed, load testing tool, write in Go (golang)
  • gobench – HTTP/HTTPS load testing and benchmarking tool, write in Go (golang)
  • gohttpbenchab-like benchmark tool run on multi-core cpu, write in Go (golang)
  • hey – HTTP(S) load generator, ApacheBench (ab) replacement, formerly known as rakyll/boom, written in Go (golang)
  • htstress – multithreading high-load bechmarking services (>5K rps), written in C/Linux
  • httperf – difficult configuration, slow and single threaded, written in C
  • inundator – A simple and high-throughput HTTP flood program, written in C/Linux
  • jmeter – Apache JMeter™, pure application designed to load test performance both on static and dynamic resources, written in Java
  • locust – easy-to-use, distributed load testing tool with real-time web UI. Simulates a swarm of concurrent users, the behavior of each of them is defined by your python code. Written in Python
  • mgun – A modern tool for load testing HTTP servers, written in Go (golang)
  • pounce – evented, but results fluctuate, it's sometimes faster than htstress, written in C
  • siege – slow and single threaded, written in C
  • slapper – Simple load testing tool with real-time updated histogram of request timings, written in Go (golang)
  • slow_cooker – A load tester focused on lifecycle issues and long-running tests, service with a predictable load and concurrency level for a long period of time, written in Go (golang)
  • sniper – powerful & high-performance http load tester, written in Go (golang)
  • tsung – Simulate stress users in order to test the scalability and performance of IP based client/server applications HTTP, WebDAV, SOAP, PostgreSQL, MySQL, LDAP and Jabber/XMPP servers, written in Erlang
  • vegeta – HTTP load testing tool and library, written in Go (golang)
  • weighttp – multithreaded, but slower than htstress without keepalive, written in C
  • wrk – multithreaded~~, but doesn't offer concurrent connections and a keepalive switch~~, written in C/Lua
  • wrk2 – constant throughput, correct latency recording variant of wrk, written in C/Lua

    Concurrent connections are enabled with:
      -c, --connections <N>  Connections to keep open
    And keepalive (which is default) can be disabled using:
      -H "Connection: close"
    
  • yandex-tank – Load and performance benchmark tool, written in Python/C|C++|Asm (phantom)

Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)

  • bat – Go implement CLI, cURL-like tool for humans, written in Go (golang)
  • curl – Powerful features command-line tool for transferring data specified with URL syntax, written in C
    • Online curl command line builde
  • curlconverter – convert curl commands to python, javascript, php
  • httpie – client, user-friendly curl replacement with intuitive UI, JSON support, syntax highlighting, wget-like downloads, extensions, written in Python
  • jq – is a lightweight and flexible command-line JSON processor, written in C

SaaS/PaaS

  • BlazeMeter – offers a cross-enterprise test automation framework for the entire technical team (developers, devops, ops and QA) throughout the product development lifecycle. Run continuous or ‘on demand’ testing for APIs, mobile apps and websites. Run from the cloud, on-premise or as a hybrid solution. Use with JMeter & Selenium WebDriver & integrate with your existing CI, CD & APM tools.
  • NewRelic – software analytics tool suite used by developers, ops, and software companies to understand how your applications are performing in development and production
  • NGINX Amplify – Visually identify performance bottlenecks, overloaded servers, or potential DDoS attacks. Improve and optimize NGINX performance with intelligent advice and recommendations. Get alerts when something is wrong with the delivery of your application. Plan capacity and performance for web applications. Keep track of systems running NGINX 1

Links

  • Multi-Mechanize | Performance Test Framework
  • Performance test tools list
  • REST API client - simple, beautiful, and free REST API client (Mac, Windows, and Linux)

SOURCE: https://github.com/denji/awesome-http-benchmark


Apart from the obvious tools like ab, you might want to take a look at something like tsung - an erlang based load test generator. One nice feature is it's ability to perform distributed load tests (that is, splitting the traffic generation over a number of machines).


I use jmeter to the load test my web applications. It might do what you are looking for.

http://jmeter.apache.org/


Apache Bench is easy and straightforward. There are plenty of tutorials.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜