NewOne plan from €9.90, extra domains €1, every feature included

All articlesBest Practices

How to Test Your Site Against Layer 7 DDoS (Legally)

A

Akarguard Team

Security Engineering

Sep 13, 20268 min read

The only way to know if your Layer 7 defences hold is to test them, on infrastructure you own, with permission. Here is how to run a safe, useful application-layer load test.

You do not want to discover the limits of your Layer 7 protection during a real attack. Testing beforehand tells you where your application breaks and whether your challenge and rate-limit rules engage in time. But application-layer load testing sits close to the line of what is legal, so the rules matter as much as the method.

Read this first

Only ever test infrastructure you own or have explicit written permission to test. Sending a flood at a system you do not control is a crime in most jurisdictions, including under computer-misuse laws in the EU, UK and US, regardless of intent.

What a Good L7 Test Answers

  • At what request rate does latency on my most expensive endpoint start to climb?
  • Do my rate limits and challenge modes engage before the origin degrades?
  • What happens to real user traffic and to non-browser integrations while the defence is active?
  • Where is the true bottleneck: CPU, database, connection pool, or the proxy itself?

Set Up a Safe Test Environment

Test a staging copy behind the same protection as production, not production itself if you can avoid it. Coordinate with your host and your protection provider so your own test is not mistaken for a real attack, and so you are not billed for surprise bandwidth. Schedule it in a low-traffic window and tell your team it is happening.

Choose the Right Tool

Use a legitimate load-testing tool, not an attack tool. Options like k6, Locust, Vegeta, wrk and JMeter generate controlled HTTP load, let you script realistic user journeys, and report latency percentiles and error rates. They are built for measurement, which is the point: you want numbers, not just breakage.

Run It in Stages

  • Baseline: measure normal latency and error rate with light load.
  • Ramp: increase request rate gradually against an expensive endpoint and watch where the curve bends.
  • Sustain: hold a high but controlled rate to see whether defences engage and stay stable.
  • Recover: stop and confirm the service returns to baseline cleanly.

Read the Results Honestly

A test that never breaks anything was probably too gentle. You are looking for the point where the system degrades, so you know your real ceiling and can raise it before an attacker finds it. Confirm that when the challenge or rate limit kicks in, legitimate scripted users still get through and your integrations still work.

If you run Akarguard, you can watch the test in the panel in real time: request and filtered rates, active mitigations and per-minute history, then pull the PDF report afterwards. For the defences you are testing, see our Layer 7 DDoS mitigation playbook; for the attacks they need to stop, our guide to Layer 7 DDoS attacks.

Frequently asked questions

Is it legal to DDoS test my own website?

Testing infrastructure you own, or have explicit written permission to test, is legal. Sending attack traffic at a system you do not control is illegal in most countries under computer-misuse laws, even if you mean no harm.

What tools can I use to test Layer 7 DDoS resilience?

Use legitimate load-testing tools such as k6, Locust, Vegeta, wrk or JMeter. They generate controlled HTTP load, script realistic user journeys, and report latency and error rates, which is what you need to find your ceiling safely.

How do I test without taking down production?

Test a staging copy behind the same protection where possible, coordinate with your host and protection provider, run in a low-traffic window, and ramp load gradually rather than starting at full force.

A

Akarguard Team

Security Engineering at Akarguard

Ready to protect your infrastructure?

Start free — 7 days, nothing charged. €9.90 a month after that, €1 for each extra domain.

Get Protected Free

Keep your site up
on its worst day.

€9.90 a month, €1 for each extra domain, every feature included, 7 days free. One DNS change to start.