AWS - WordPress little available RAM and other problems

Keywords: WordPress - AWS - Technical issue - Other

bnsupport ID: 9a40ffac-663b-0a77-2d46-69de765cf19f

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/

bndiagnostic failure reason: I do not know how to perform the changes explained in the documentation

Description:
Hi everyone.

I was running my woocommerce store in AWS lightsail (1 GB RAM, 40 GB SSD and 1 vCPU). When I performed some tasks like modify products, try to access to woocommerce and jetpack stats or just when I logged in the WordPress Admin, the site started to use a lot of CPU and after a minute or two the site showed a 504 error, so I had to stop and restart de instance. It happens a lot. Like 1 time or two per day.

When I ran the diagnostic tool it showed some Apache errors and that the instance has little available RAM. I tried to solve this by setting the Memory Limit in the WP-CONFIG and PHP.INI files to 768MB, but the diagnostic tool showed the same issues.

Today, I decided to upgrade my AWS plan (4 GB RAM, 80 GB SSD and 2 vCPU) and set the Memory Limit to 3 GB and created a 4 GB SWAP file following this guide: https://docs.bitnami.com/installer/faq/linux-faq/administration/increase-memory-linux/; but the diagnostic tool keeps showing the same issues. When I run the command free -m it shows 3947 as total Mem and 3327 as used Mem. Is it normal that the instance consume almost all the new RAM? when I had 1 GB RAM it consumed less. I really don’t get this.

I don’t how to correct these issues, can you please help with a guide or tutorial video please?

I will really appreciate your help.

Regards,

Diego

Hi @dasaenzt,

You increased the RAM memory but more PHP-FPM processes were launched and they are consuming a lot of memory

-----------------------------------
Check memory usage for all current processes
-----------------------------------
Running: ps -e -orss=,args= | sort -b -k1,1n | awk '{print $1,$2}'
In: /opt/bitnami

Output:
...
153668 php-fpm:
154360 php-fpm:
156224 php-fpm:
156688 php-fpm:
157972 php-fpm:
158116 php-fpm:
158324 php-fpm:
158712 php-fpm:
158908 php-fpm:
159448 php-fpm:
159684 php-fpm:
162092 php-fpm:
162372 php-fpm:
162524 php-fpm:
162576 php-fpm:
163164 php-fpm:
163212 php-fpm:
163360 php-fpm:
163452 php-fpm:
163804 php-fpm:
163896 php-fpm:
164280 php-fpm:
166148 php-fpm:
167280 php-fpm:
170660 php-fpm:
170728 php-fpm:
171184 php-fpm:
171196 php-fpm:
171288 php-fpm:
171376 php-fpm:
172192 php-fpm:
172420 php-fpm:
174248 php-fpm:
175492 php-fpm:
176880 php-fpm:
182248 php-fpm:
183032 php-fpm:
185328 php-fpm:
187196 php-fpm:
190012 php-fpm:
194348 php-fpm:
194696 php-fpm:
...

You can reduce the number of processes by checking this guide

https://docs.bitnami.com/aws/apps/wordpress-pro/configuration/configure-phpfpm-processes/

1 Like

Hi jota.

I followed the instructions you provided me and the problem with RAM has been solved. Thank you very much.

I ran the Diagnostic Tool and what it shows are the following issues with Apache:

[Mon Jan 10 08:48:44.252332 2022] [core:error] [pid 1537:tid 140031217751808]
[client ip_address:53114] AH00126: Invalid URI in request ‘bin/sh’ ‘POST
/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh HTTP/1.1’
[Mon Jan 10 15:12:03.439817 2022] [proxy_fcgi:error] [pid 1538:tid
140031318464256] (70008)Partial results are valid but processing is incomplete:
[client ip_address:9257] AH01075: Error dispatching request to : (reading
input brigade)
[Mon Jan 10 18:44:56.884123 2022] [core:error] [pid 1537:tid 140031159002880]
[client ip_address:33348] AH00126: Invalid URI in request ‘bin/sh’ ‘POST
/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh HTTP/1.1’

The code is: fb4f3149-0bd2-df13-74ba-2b60625d7a21

Do you have any idea on how to solve this?

Regards,

Diego.

Hi @dasaenzt,

These are requests to check if your Apache server is vulnerable to this security issue

https://blogs.juniper.net/en-us/threat-research/apache-http-server-cve-2021-42013-and-cve-2021-41773-exploited

Please ensure you have the latest available version of Apache to ensure you do not have problems with that.