Score:0

CPU 100% PHP-FPM Processes Wordpress

es flag

EDIT:

I have determined that I have a configuration problem and my ignorance is the problem. I have php-fpm processes that are eating up all of the ram and cpu of my server. I decided to max out a vps instance to verify this. It's not an attack or lack of resources. It is pure ignorance of php-fpm and how it operates. I am looking to learn here. I just want my miserable experience to benefit another person lol.

It's a wordpress site there are php-fpm processes that are getting stuck running and are eating up 100% of the CPU and memory. I use W3 cache and a plugin that uses .htaccess rewrite rules to hide/mask the wordpress directories. Here is what I see:

curl http://127.0.0.1/fpm-status?full

Result: (one of many)

pid:                  23050
state:                Running
start time:           27/Dec/2022:08:23:00 +0000
start since:          7703
requests:             73
request duration:     14958380
request method:       GET
request URI:          /index.php?wph-throw-404
content length:       0
user:                 -
script:               /opt/bitnami/wordpress/index.php
last request cpu:     0.00
last request memory:  0

I checked for the possible ddos stuff using:

netstat -ntu|awk '{print $5}'|cut -d: -f1 -s|sort|uniq -c|sort -nk1 -r

Results:

 57 127.0.0.1
 48 [server ip]
  1 52.95.24.108
  1 40.88.35.229
  1 101.227.24.18

Nothing crazy

tail -n 10000 /opt/bitnami/apache2/logs/access_log | awk '{print $1}'| sort| uniq -c| sort -nr| head -n 10

Output:

7957 [server ip]
1361 [my ip]
368 5.161.83.61     
65 127.0.0.1     
28 [web app]     
17 66.249.69.248     
16 65.108.154.199     
15 5.45.207.151    <-Russia 
10 183.136.225.32  <-China
7 66.249.66.82

What I don't get is why these processes don't expire or get killed. I'm not really savvy when it comes to php-fpm so I'm hoping someone here might be able to help me figure this out. It has to be a PHP-FPM config setting or something. I've almost pulled all my hair out. Help is greatly appreciated :)

waltmagic avatar
es flag
I read something on another forum that made sense. Maybe there is an infinite loop situation going on where a 404 redirect gets sent to a file with a 404 redirect and it gets all crazy. I am going to check my .htaccess file and look at the rewrites to see if this might be happening to me. If it fixes the issue I will post it as an answer.
waltmagic avatar
es flag
It's not a 404 loop situation. I have implemented fail2ban and it works great but this is not my issue either. I am struggling here really bad. My server is generating 404 redirects for pages and files/folders that are handled by a plugin that hides wordpress and it is killing my server. There are so many posts related to this issue but many seem to abandon their post instead of sharing their solution. If it's the last thing I do I am going to figure this out and post the solution. I don't want anyone to have to go through this stress.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.