没有不值得去解决的问题,也没有不值得去学习的技术!

WordPress CPU Alerts Again: From EdgeOne Anomalous Traffic to Adaptive Rate Limiting and JavaScript Challenges

Figure 6: Enabling moderate adaptive rate control and traffic anti-leech specifically for the www domain, both using JavaScript Challenge as the action

作者:

在

This morning, the Alibaba Cloud ECS hosting WordPress triggered another CPU anomaly.

This server has only 2 vCPUs, and CPU usage is normally not high. This time, however, CPU usage quickly climbed to nearly 100% and stayed there for a considerable period rather than being a brief spike lasting a few tens of seconds. The system load average also rose rapidly in tandem, reaching around 13–16 at one point.

Because I had encountered similar high-load situations before, my first thought this time was still:

Was there another surge of abnormal traffic hitting the site?

After checking EdgeOne, I quickly identified a very obvious period of abnormal traffic.


1. CPU approaches 100% while system load spikes simultaneously

From the ECS monitoring, I could see that starting around 09:19, CPU usage rapidly climbed to nearly 100% and remained there until about 09:55.

At the same time, the system load average also rose quickly.

For a server with only 2 vCPUs, a load in the teens is clearly well beyond the normal range.

Figure 1: ECS CPU usage approaches 100% while the system load average spikes significantly at the same time
Figure 1: ECS CPU usage approaches 100% while the system load average spikes significantly at the same time

Although memory usage fluctuated somewhat, it was not exhausted in sync. Therefore, the first thing I needed to confirm was still:

  • Why PHP / WordPress suddenly had such heavy computational pressure;
  • Whether this was normal traffic growth or some kind of abnormal access;
  • Whether EdgeOne had already blocked or cached some of these requests.

So I started checking EdgeOne’s metric analysis.


2. EdgeOne shows a distinct request peak within minutes

I first set the EdgeOne time range to:

Plaintext
2026-09-01 09:10 ~ 10:00

It is clearly visible that traffic volume was fairly normal before 09:16, started rising rapidly around 09:16, peaked around 09:20, and then dropped quickly.

Across this entire time range, the total number of L7 requests reached:

Plaintext
26,200 times

Moreover, the traffic curve corresponds closely in time to when the server CPU began to rise.

Figure 2: EdgeOne shows a sudden rapid increase in L7 requests after 09:16
Figure 2: EdgeOne shows a sudden rapid increase in L7 requests after 09:16

This is enough to show:

There is likely a clear correlation between this CPU alert and the sudden surge in traffic.

However, 09:10–10:00 is still a relatively large time window, so I continued narrowing the scope down to the period where traffic was most concentrated:

Plaintext
09:16 ~ 09:23

3. About 23,500 requests within 7 minutes

After narrowing the time range, we can see:

Plaintext
09:16 ~ 09:23

In just 7 minutes, EdgeOne recorded approximately:

Plaintext
23,500 L7 requests

The cache status breakdown was roughly:

Plaintext
miss     15,700 times
hit      6632 times
other    1229 times
dynamic  3 times
Figure 3: Among the 23,500 requests from 09:16 to 09:23, the EdgeOne Cache Miss ratio is relatively high
Figure 3: Among the 23,500 requests from 09:16 to 09:23, the EdgeOne Cache Miss ratio is relatively high

At first glance at the large number of miss, it is easy to directly assume:

Over ten thousand requests went straight into PHP.

But in reality, it cannot be calculated that simply.

My site architecture is roughly:

Plaintext
Visitor
  ↓
EdgeOne
  ↓
Nginx
  ↓
W3 Total Cache Disk Enhanced
  ↓
PHP-FPM / WordPress

Therefore, in EdgeOne:

Plaintext
miss

accurately means:

The EdgeOne node did not hit the CDN cache directly and needed to continue requesting from the origin server.

However, after a request reaches the origin server, it might still hit the W3 Total Cache page cache, which does not mean that every EdgeOne miss ultimately executed a full WordPress PHP request.

So what this chart proves is:

A large number of requests needed to return to the origin.

But based solely on the number of EdgeOne miss, I cannot directly calculate how many requests actually executed PHP.

This is one of the reasons I continued analyzing the origin server.


4. Abnormal requests are not concentrated among a few IPs

If this were traditional high-frequency access from a single IP, the simplest approach would usually be:

Plaintext
A certain IP exceeds N times per minute
→ Rate limit or block

But after further checking EdgeOne’s client IP distribution, I found that this was not the case this time.

Among the top 5 client IPs from 09:16 to 09:23, the highest single IP had only:

Plaintext
24 times

The other top IPs also had only a dozen or so requests each.

Figure 4: Client IPs are highly dispersed during the abnormal period, and the request count for a single top IP is not high
Figure 4: Client IPs are highly dispersed during the abnormal period, and the request count for a single top IP is not high

This means that while the total request volume is large, the traffic sources are highly dispersed.

In other words, if I only set a very simple:

Plaintext
Single IP request rate limit

the effect might not be ideal.

Because the request volume from a single IP might never reach the threshold, but hundreds or thousands of different IPs combined can still create significant pressure on the origin server.

This is also what makes this traffic surge tricky.


5. Request URLs are also highly dispersed

Looking further at the URL path distribution, a similar pattern emerges.

Among the top URLs, there are both:

Plaintext
/wp-content/plugins/...

resource paths like this, as well as:

Plaintext
/category/...
/tag/...
/feed

and other WordPress pages.

There was no single URL being continuously targeted by thousands or tens of thousands of requests.

Figure 5: Request URLs are also quite dispersed, with no concentration on any single fixed page
Figure 5: Request URLs are also quite dispersed, with no concentration on any single fixed page

Therefore, the characteristics of this traffic surge are closer to:

Plaintext
Many different IPs
+
Many different URLs
+
Concentrated in a short period

rather than:

Plaintext
A few IPs
+
A few fixed URLs
+
Continuous high-speed requests

This means that relying solely on IP or a single URL to create a rigid rate-limiting rule can easily lead to one of two outcomes:

Either the threshold is set too loosely and fails to block this dispersed traffic;

or it is set too strictly and risks collateral damage to normal readers and search engine crawlers.


6. Abnormal search requests also appear in origin server logs

While continuing to check the origin server logs later, I also found some rather strange WordPress search requests, such as:

Plaintext
?s=北化研究院+宋丹
?s='PL-I350-1G4
?s=EFEMERIDES+SEPTIEMBRE+PDF

These keywords have no obvious connection to each other, nor do they relate much to the main technical content of my blog.

A single search request alone, of course, does not prove much.

But combined with the earlier characteristics:

  • Over twenty thousand requests generated suddenly within a few minutes;
  • Highly dispersed source IPs;
  • Highly dispersed request URLs;
  • Very random search keywords.

I am more inclined to believe that a significant portion of this consists of automated visits, crawlers, or search spam traffic.

However, I did not simply define it as a clear-cut “attack.”

Because based solely on this data, it is still insufficient to precisely determine the true source and intent of all requests.

What is more important to me is:

Whether these requests should ultimately be classified as crawlers, scanners, or other automated traffic, they have actually caused a 2-vCPU server to near full capacity, so some protection needs to be added at the EdgeOne layer.


7. Using a standalone domain-level protection policy for www

My main site currently uses:

Plaintext
www.shuijingwanwq.com

This time, instead of directly raising the protection policy for the entire EdgeOne site, I had www.shuijingwanwq.com use an independent domain protection policy.

The reason is fairly simple.

The business nature of different subdomains is not exactly the same.

If the main site encounters abnormal traffic and I apply stricter policies to all domains, it might unnecessarily affect other services.

So the focus of this adjustment is:

Plaintext
www.shuijingwanwq.com

8. Adaptive rate control adjusted to “Moderate”

EdgeOne provides adaptive rate control.

Compared to manually setting a fixed:

Plaintext
Maximum N times per minute per IP

I prefer to let EdgeOne first determine abnormal access rates based on the recent access baseline.

I ultimately selected:

Plaintext
Rule level: Adaptive - Moderate

For the action, I used:

Plaintext
JavaScript Challenge

instead of blocking directly.

This was done primarily to reduce collateral damage.

Readers using modern browsers to access the site can generally pass a JavaScript Challenge normally.

Some simple automated scripts and crawlers, however, might face increased access costs or be unable to continue making requests entirely.


9. Enabling traffic anti-leech simultaneously

In addition to adaptive rate control, I also enabled:

Plaintext
Traffic anti-leech (only applicable to the Chinese mainland region)

For the action, I also selected:

Plaintext
JavaScript Challenge

Ultimately, the two main rules currently enabled for www.shuijingwanwq.com are:

Plaintext
Adaptive rate control
Rule level: Adaptive - Moderate
Action: JavaScript Challenge

Traffic anti-leech
Applicable to: Chinese mainland region
Action: JavaScript Challenge
Figure 6: Enabling moderate adaptive rate control and traffic anti-leech specifically for the www domain, both using JavaScript Challenge as the action
Figure 6: Enabling moderate adaptive rate control and traffic anti-leech specifically for the www domain, both using JavaScript Challenge as the action

I did not continue making the rules more aggressive for now.

After all, this is a public blog.

Visits from Google, Bing, Baidu, and other normal crawlers are inherently necessary for the site.

If I treated all automated traffic as malicious just because of a single anomaly, it would likely do more harm than good.


10. The Personal edition has limited capabilities, so I can only optimize within existing permissions

There is also a practical limitation to note here.

I am currently using the EdgeOne Personal edition, so not all security protection capabilities in the dashboard are available.

During this troubleshooting process, there were actually some configuration options better suited for fine-grained control over abnormal traffic, but due to the permission limits of the current edition, I could not configure them directly.

So this adjustment was not:

Selecting the most comprehensive protection plan EdgeOne can offer.

More accurately, it was:

Within the existing capabilities and permissions of the Personal edition, choosing the combination best suited to current traffic characteristics while minimizing collateral damage to normal visitors.

What can actually be used and is relatively appropriate for the current situation is mainly:

Plaintext
www uses an independent domain protection policy
+
Adaptive rate control: Moderate
+
JavaScript Challenge
+
Traffic anti-leech for the Chinese mainland region

This is also why I did not continue designing a bunch of complex rules around fixed IP thresholds.

On one hand, this abnormal traffic itself exhibited clear dispersion characteristics:

Plaintext
Dispersed IPs
+
Dispersed URLs
+
Low request volume per single IP

On the other hand, there are boundaries to the security capabilities available in the Personal edition.

Therefore, the more practical approach at this stage is to fully utilize the capabilities provided by the current edition, raise the cost for clearly abnormal automated access, and try to ensure that normal reader access remains unaffected.

If similar traffic continues to appear in the future, and the protection capabilities provided by the Personal edition are clearly insufficient, I will then consider whether it is necessary to upgrade the edition or add finer-grained access control at other layers.


11. Why not just block by User-Agent or IP?

After this troubleshooting, I am even less inclined to rely on simple fixed rules.

For example, determining whether traffic is abnormal based on the browser User-Agent:

Plaintext
Chrome
Edge

is not very meaningful.

Automated programs can easily forge a normal browser User-Agent.

Similarly, relying solely on an IP blocklist is also difficult.

Because this time, the request count for top IPs was only twenty-something, while the total request volume was over twenty thousand.

In other words:

Plaintext
A single IP looks normal

does not mean:

Plaintext
The overall traffic is normal

For this kind of distributed, low-frequency automated access from single IPs, adaptive detection is more suitable for the current situation than simply writing a fixed threshold.


12. EdgeOne protection only solves the first layer of the problem

After adjusting EdgeOne, the CPU eventually returned to normal levels.

But the troubleshooting did not end there.

Because what EdgeOne solves is:

Plaintext
The traffic entry layer

That is, minimizing the continued impact of unnecessary abnormal requests on the origin server.

But why was the server so easily dragged to nearly 100% CPU when these requests arrived? This still required further analysis:

Plaintext
Is the origin page cache working normally?
What is PHP-FPM executing?
Are there other anomalies in WordPress?
Is the W3 Total Cache cache preheating working normally?

After continuing to investigate inside the server, I actually discovered another issue that had been persisting for about half a month:

The combined Sitemap used by W3 Total Cache for page cache preheating had not been successfully updated since August 14.

Digging further, I found:

Plaintext
Yoast post-sitemap.xml
        ↓
HTTP 500
        ↓
PHP-FPM memory_limit 256M
        ↓
Allowed memory size exhausted

This is no longer an EdgeOne-level issue.

So I plan to cover this part separately in the next post.


13. Thoughts following this adjustment

My biggest takeaway this time is that when facing a sudden server overload, you cannot immediately attribute it to a single phenomenon.

Initially seeing:

Plaintext
CPU ≈ 100%

makes it easy to directly assume:

Server performance is insufficient.

Seeing EdgeOne report:

Plaintext
miss 15,700

makes it easy to directly assume:

Over ten thousand requests all executed PHP.

Seeing a large number of random requests makes it easy to directly assume:

A specific IP must be attacking.

But after breaking it down further, I found that the situation actually divided into several different layers:

Plaintext
Abnormal automated traffic
        ↓
EdgeOne massive origin returns
        ↓
Origin page cache
        ↓
PHP-FPM
        ↓
WordPress

Each layer needs to be verified independently.

Therefore, the strategy I am adopting now is not simply turning EdgeOne protection “up to the maximum.”

On one hand, I need to control collateral damage; on the other, the Personal edition itself has functional and permission limits.

At this stage, I can only work within the scope of available capabilities to create a combination better suited to current traffic characteristics:

Plaintext
www uses an independent protection policy
+
Adaptive rate control: Moderate
+
JavaScript Challenge
+
Traffic anti-leech for the Chinese mainland

First, mitigate the impact of clearly abnormal traffic on the server, and then continue addressing the underlying issues on the origin server itself.

As for what else was discovered inside the server, I will leave that to be organized in the next post.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系