How to Tell If Your Server Is Under a DDoS Attack

How to Tell If You Are Under a DDoS Attack: Server Symptoms, Diagnostic Commands and First Response (2026)

How to Tell If You Are Under a DDoS Attack: Server Symptoms, Diagnostic Commands and First Response (2026)

Your website will not load, SSH commands respond slowly and customers write that they cannot reach the server. The first suspicion is often a DDoS attack. Yet the same symptoms can come from a broken script, a full disk, a genuine traffic surge caused by a campaign, or a wrong firewall rule. This guide answers how to tell if you are under a DDoS attack in concrete terms: which symptoms to look for, which commands to run on a Linux server, how to rule out false alarms, and what to do in the first half hour if the attack is real.

This article is general technical information. Every attack is different; in a critical incident it is safest to work together with your hosting provider's network team.

What Exactly Is a DDoS Attack?

A distributed denial of service attack uses artificial traffic from many sources to leave a server, an application or a network link unable to respond. The goal is not to steal data but to make the service unreachable. Attacks fall into three main groups:

TypeWhat it doesTypical symptom
VolumetricFills the bandwidth (UDP floods, reflection attacks)The server is alive but nothing can be reached from outside; port saturation
Protocol (connection table)Exhausts the connection setup mechanism (SYN flood)Many half-open connections, new connections timing out
Application layerSends heavy requests to the web application (HTTP flood)CPU and database maxed out while network traffic stays moderate

This distinction matters because the diagnosis and the fix depend on the type. You cannot fix a volumetric attack on the server; an application layer attack, on the other hand, can be softened largely on the server and in your web server settings.

8 Typical Symptoms of a DDoS Attack

  1. Sudden, unexplained slowness: Pages take minutes instead of seconds, or never open.
  2. A surge in connections: Concurrent connections that are normally a few hundred jump to thousands or tens of thousands.
  3. Requests piling onto one path: In the access log the same address (for example search, login or an API endpoint) is called hundreds of times per second.
  4. Unusual source distribution: Traffic that normally comes from your home country starts arriving from places where you expect no visitors.
  5. Similar client identities: Thousands of requests carry the same or nearly identical User-Agent; most never open a session or accept cookies.
  6. Network interface saturation: The inbound traffic graph hits the port speed and sits as a flat line.
  7. High packet count, little real data: Packets per second are very high while the real workload processed is low.
  8. Several services failing in the same time window: Web, SSH and email slow down together, which suggests the problem is on the line rather than in the application.

A single symptom is not proof. Seeing two or three together raises the suspicion considerably.

Build your next project on a solid server

Explore VDS plans in Istanbul with KVM virtualization and a 1 Gbps port.

Explore VDS rental plans

Rule Out False Alarms First

Many suspected attacks turn out to be something else. Before you react, run these five checks:

  • Campaign or announcement: Did the marketing team launch an email or an ad? Was your link shared on social media?
  • Disk and memory: When the disk is almost full the database cannot write and the site falls over. When memory runs out the operating system kills processes.
  • Backup job or search engine bot: A scheduled backup or an aggressive crawler can fill the CPU.
  • Recent change: Did you change a plugin, script or configuration yesterday?
  • Your own firewall: A new rule or security plugin may be blocking legitimate traffic.

For a broader approach to finding out why a server slowed down, see the 10-minute server performance diagnosis guide.

Step-by-Step Diagnosis: Which Commands on Linux?

1. Check resource usage

uptime
top -o %CPU
free -h
df -h

If the load average is far above the number of cores and web server or database processes are eating the CPU, an application layer problem is likely. If resources are calm but nobody can connect, the problem is on the network line.

2. Count connections and group them by source

ss -s
ss -tn state established | awk '{print $4}' | cut -d: -f1 | sort | uniq -c | sort -nr | head -20

The first command gives a summary of total connections. The second counts established connections per source IP. Hundreds of connections from one address are suspicious; thousands of different addresses can point to a distributed attack. The column number in this command can vary with the version and output format, so check the output by eye once.

3. Check half-open connections

ss -n state syn-recv | wc -l
ss -n state time-wait | wc -l

A large number of connections in the SYN-RECV state is the classic fingerprint of a SYN flood. On a normal server this number is usually very low.

4. Look at the real traffic on the network interface

cat /proc/net/dev
sudo apt install -y iftop nload
sudo iftop -i eth0 -nNP

Your interface may not be called eth0; confirm with ip -br link. If inbound traffic is close to the port speed while server resources are comfortable, the attack is starting on the line before it ever reaches the server. In that case the only thing you can do is inform your provider.

5. Take a short packet capture

sudo tcpdump -i eth0 -nn -c 2000 -w /root/incident.pcap
sudo tcpdump -nn -r /root/incident.pcap | awk '{print $3}' | cut -d. -f1-4 | sort | uniq -c | sort -nr | head

The first command records a short capture of 2,000 packets; keeping the capture limited ensures you do not fill the disk. Seeing which port and which protocol (TCP SYN, UDP, ICMP) the attack traffic targets is the most valuable information you can give your provider.

6. Analyse the web access log

tail -n 20000 /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -20
tail -n 20000 /var/log/nginx/access.log | awk '{print $7}' | sort | uniq -c | sort -nr | head -20

The first lists the IPs making the most requests, the second the most requested paths. If you use Apache the log path may be /var/log/apache2/access.log or different depending on the distribution. Thousands of requests piling onto one path are the clearest evidence of an application layer attack.

Reading the Results by Attack Type

ObservationLikely situationSuggested first step
Inbound traffic at port speed, server idleVolumetric attackTell your provider immediately; nothing to fix on the server
Very high SYN-RECV countSYN floodCheck SYN cookies, set a connection limit in the firewall, notify the provider
Web server and database at the CPU ceiling, traffic moderateHTTP flood or slow request attackRequest limiting, caching, a rule for the targeted path
High traffic, varied pages, real sessionsProbably a legitimate visitor surgeAdd caching and resources; do not block on an attack assumption
Many requests from a single IPA simple bot or malicious crawlerBlock that IP and keep the log

What to Do in the First Half Hour

  1. Stay calm and keep records: Save the start time, the symptoms and the command output in a text file.
  2. Do not shut down: Powering the server off helps the attacker and erases the evidence.
  3. Identify the type: Use the commands above to separate volumetric, protocol and application layer attacks.
  4. Stop unnecessary services: Temporarily close services that do not need to be public (database port, admin interfaces, test sites) or open them to your own IP only.
  5. Notify your provider: Pass on the time window, the protocol and port you identified, and the capture file. For volumetric attacks the real fix lives in the provider's network layer.
  6. Mitigate at the application layer: Request limiting, caching and blocking known bad sources.
  7. Check for unauthorised access: Attacks are sometimes used as a distraction, so review login logs and file changes.

Application Layer Mitigation Examples

The examples below slow down small and medium HTTP attacks; they have no effect against a volumetric attack.

# Nginx: per-IP request limit (http block)
limit_req_zone $binary_remote_addr zone=general:10m rate=10r/s;
limit_conn_zone $binary_remote_addr zone=perip:10m;

# server or location block
limit_req zone=general burst=20 nodelay;
limit_conn perip 30;
# Linux: see the SYN cookies state
sysctl net.ipv4.tcp_syncookies

# Temporarily block a single IP
sudo ufw deny from 203.0.113.50

The address here is a documentation example. Tune the limits to your own real traffic; a limit that is too tight blocks legitimate visitors as well. For firewall and access settings, the Linux server security guide is a useful starting point.

Need more headroom than a VDS?

Look at dedicated servers in Istanbul with browser-based remote console access.

Explore dedicated servers

Why You Cannot Fix Volumetric Attacks on the Server

If a server's port is 1 Gbps, an attack that sends more data than that port can carry fills the line. At that point the packets cannot reach the server even if its processor is completely idle, because the congestion happens before the server. That is why setting up a firewall, writing an iptables rule or rebooting the server does nothing against volumetric attacks. Filtering this kind of traffic has to happen at the network level, before the traffic reaches the server. Our general guide to protecting against DDoS attacks and our article on DDoS protection for game servers cover this angle in more depth.

8 Habits to Prepare for the Next Attack

  • Know your normal traffic: You can only spot an attack if you know what normal looks like. Watch connection counts and the traffic graph regularly.
  • Set up monitoring and alerts: Define threshold alerts for concurrent connections, CPU and network saturation.
  • Use caching: Cache static content and frequently read pages; the effect of HTTP attacks drops.
  • Limit management access: Open SSH, RDP and admin panels only to known IPs.
  • Hide the origin: If you put your site behind an intermediate layer, make sure the server's real IP does not leak elsewhere (DNS records, email headers).
  • Keep a backup ready: If something breaks as a side effect during an attack, you need a way back.
  • Write an incident plan: Put on paper who calls whom and which records are collected.
  • Learn the protection options in advance: Researching options after the attack has started is hard. Ask your provider beforehand what its protection covers and how it is activated.

Interpret Latency and Packet Loss Correctly

Sometimes the problem is not an attack but latency or packet loss somewhere along the route. Reading ping and MTR results correctly tells you whether the problem is on your server or in the middle of the path. For details, read the ping test and MTR guide.

Common Mistakes

  • Rebooting the server without diagnosis and losing the evidence.
  • Mistaking a legitimate traffic surge for an attack and blocking whole countries or IP ranges.
  • Trying to fix a volumetric attack with the firewall on the server.
  • Telling your provider that the server is slow without giving protocol, port and time information.
  • Deleting the logs after the attack ends, which loses the pattern for the next incident.
  • Leaving management ports reachable from everywhere.

Summary

The way to recognise a DDoS attack is to turn the symptoms into numbers: connection count, source distribution, packet type, CPU load and network saturation. If your resources are comfortable but the line is full, a volumetric attack is likely; if the CPU is full while the network is moderate, an application layer attack is likely. In every case keep records, do not shut down, give your provider accurate information and check for signs of unauthorised access.

Related Guides

Frequently Asked Questions

How do I tell a DDoS attack from a legitimate traffic spike?

Real visitors spread across different pages, browser identities and sensible session behaviour. In an attack you usually see requests hammering the same path, with similar headers, no sessions and a very large number of source addresses.

Does a DDoS attack damage the server or steal data?

The goal of a DDoS attack is to make a service unavailable, not to steal data. Attacks are sometimes used as a distraction, though, so it is good practice to also check login records and unexpected changes while one is under way.

Can I protect the server against DDoS myself?

Request limiting and firewall rules at the application layer soften small attacks. Volumetric attacks that fill your bandwidth must be filtered at the network level before they reach the server, which cannot be solved on the server alone.

Is shutting the server down the right move during an attack?

Usually not. It serves the attacker's goal and erases the evidence you need for diagnosis. First work out the traffic type, stop unnecessary services and contact your provider.

Which logs should I keep?

Keep access and error logs, firewall counters, a short packet capture and the time window of the incident. They are needed both for the details you pass to your provider and for later analysis.

What should I check first when my server slows down?

Start with resource usage (CPU, memory, disk, connection count), then move on to the direction and type of network traffic. Misconfiguration, a broken script and backup jobs are also common causes of slowness.

Server packages covered in this article

+902243340242