bitnami / vms

Bitnami VMs
https://bitnami.com
Other
203 stars 43 forks source link

CPU utilization suddenly becomes high, and I don't know what happened. My site goes to a 503 error #1028

Closed Puneetsingh25 closed 1 year ago

Puneetsingh25 commented 1 year ago

Platform

AWS

bndiagnostic ID know more about bndiagnostic ID

20230707-055653-20169

bndiagnostic output

No response

bndiagnostic was not useful. Could you please tell us why?

It is useful, but one thing I noticed, we need to identify the specific cause of the issue, such as the problematic plugin, a database table issue, or a MySQL query taking a longer time on the site

Describe your issue as much as you can

Hello Team,

I hosted a WordPress site on AWS Lightsail last year, and for the past year, it has been working fine. However, starting from last month, the site has been going down multiple times a day. Each time it shows an 'HTTP Error 503 Service Unavailable.' When we check the instance, the CPU usage is high. After rebooting the instance, it works fine again. I'm not sure what is causing this issue.

My question is - Why is the CPU usage suddenly high on my site? What is the main cause? Is it due to a plugin issue, a MySQL query taking a longer time, or a cron job issue? or an Apache config error?

I have taken the following steps to address the problem:

  1. Fixed the WordPress Filesystem Permissions (https://docs.bitnami.com/aws/apps/wordpress/administration/understand-file-permissions/)
  2. Installed the Wordfence premium plugin to block malicious IP addresses.
  3. We are using 8 GB RAM, 2 vCPUs, and a 160 GB SSD.
  4. We ran the Bitnami Diagnostic Tool, and I have attached the file below: bitnami-wordpress-info-20230707-055653-20169.zip

Could you please assist me in identifying the cause of these issues and provide steps to resolve them?

itsmemidhuz123 commented 1 year ago

Hi friend, could you please try checking the server if any sudden request came to your website. As i can see that you are using wordfence, according to my knowledge the plugin will use higher amount of resources. I recommend to switch to malcare. Please not a advertisement and complete experience i received based on 3 year of wordpress usage. Malcare will help in stopping malware, other security features and its Free to use.

I haven't found your URL about so, could you please confirm if you are using cloudflare. If not, i recommend to use cloudflare, its easy to point the domain and you can go live in an hour. This helps to block the unnecessary request from different IP. Use the tools on cloudflare such as bot, firewall. This helps to reduce the request by adding a bot verification. Keep the security level to medium to cloudflare as we'll. Its free to use as well.

Use a cronjob manage plugin, if you installed a plugin and if delete also the cronjob will be active ans will be working based on its schedule. This plugin helps to delete it.

Also last, delete unnecessary plugin. If you need a suggestion of plugin let me know

Thanks

Puneetsingh25 commented 1 year ago

Hello, sir,

My website address is https://www.encryptionconsulting.com/.

Yes, my website receives numerous requests from malicious IPs targeting the "/wp-login" and "/xmlrpc.php" files. These two files are being called repeatedly every second. I'm unsure about what actions to take.

Currently, I am not using Cloudflare. We installed the Wordfence plugin due to server downtime issues. However, today the website went down again, and we had to restart the instance.

Here are some relevant details:

  1. Plugins, themes, and WordPress are up to date.
  2. I have installed only a few plugins, not too many.

I understand your suggestion to use Cloudflare, but I am wondering why this issue continues to occur repeatedly. Would increasing the RAM help resolve the problem?

Did you have a chance to run the Bitnami file?

Sir, please help me out by providing the solutions.

Thank you.

itsmemidhuz123 commented 1 year ago

Ok, please reach on midhun.speedcuber@gmail.com

Puneetsingh25 commented 1 year ago

Hello sir,

These are my error logs in Apache, can you please let me know if these are causing the issues

  1. www.example.com:443:0 server certificate does NOT include an ID which matches the server name
  2. AH01071: Got error 'PHP message: PHP Fatal error: Out of memory (allocated 33554432) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 907PHP message: PHP Fatal error: Out of memory (allocated 33554432) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/class-wp-fatal-error-handler.php on line 74', referer: https://www.encryptionconsulting.com/education-center/what-is-fips
  3. H01071: Got error 'PHP message: PHP Fatal error: Out of memory (allocated 39845888) (tried to allocate 352256 bytes) in /bitnami/wordpress/wp-content/plugins/wp-rocket/inc/Engine/Optimization/DelayJS/HTML.php on line 265', referer: https://www.encryptionconsulting.com/education-center/encryption-vs-hashing
  4. AH01071: Got error 'PHP message: PHP Fatal error: Out of memory (allocated 27262976) (tried to allocate 32768 bytes) in /opt/bitnami/wordpress/wp-includes/class-wpdb.php on line 2431' [crit] Memory allocation failed, aborting process. 5.[proxy_fcgi:error] [pid 5596:tid 139982295422720] (70007)The timeout specified has expired: [client 79.116.21.123:57340] AH01075: Error dispatching request to : (polling), referer: https://www.google.com/
itsmemidhuz123 commented 1 year ago

Hi, this cause by some of the plugins that allocated more resource. You can reach me there, this cause mostly by the plugins itself and the request received through IP.

Puneetsingh25 commented 1 year ago

Hello sir, I sent email, please check

itsmemidhuz123 commented 1 year ago

Sure, will do that.

On Fri, 7 Jul, 2023, 4:25 pm Puneetsingh25, @.***> wrote:

Hello sir, I sent email, please check

— Reply to this email directly, view it on GitHub https://github.com/bitnami/vms/issues/1028#issuecomment-1625235547, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATOGR2RD6ABXVU2M25YEWJTXO7TLJANCNFSM6AAAAAA2BMQ3XY . You are receiving this because you commented.Message ID: @.***>

carrodher commented 1 year ago

Please note Bitnami official support is only provided via GitHub issues and for free, any other kind of professional service provided by a third-party person or company is not related to Bitnami in any way.

Puneetsingh25 commented 1 year ago

The issue is resolved, Through IP we can access the site, but through the domain, we are not able to access the site, it is redirecting.

gongomgra commented 1 year ago

Hi @Puneetsingh25,

I've just visited your website using the domain name and it worked fine. Did you manage to solve your issue?

Puneetsingh25 commented 1 year ago

Hi The issue still persists. We are currently using 8 GB of RAM, 2 vCPUs, and a 160 GB SSD. The CPU utilization suddenly becomes high, but after rebooting the instance, it works fine again. I'm not sure what is causing this issue. Additionally, I modified the php.ini file to increase the memory_limit to 1024M. Below are the error logs. Could you please check and suggest a solution?

Mon Jul 10 05:45:54.595799 2023] [authz_core:error] [pid 846:tid 139813910988544] [client 44.210.245.139:45196] AH01630: client denied by server configuration: /opt/bitnami/wordpress/.htaccess
[Mon Jul 10 05:45:54.609416 2023] [authz_core:error] [pid 834:tid 139814481299200] [client 44.210.245.139:45222] AH01630: client denied by server configuration: /opt/bitnami/wordpress/.htaccess.BAK
[Mon Jul 10 05:46:00.963884 2023] [authz_core:error] [pid 834:tid 139814296659712] [client 44.210.245.139:45896] AH01630: client denied by server configuration: /opt/bitnami/wordpress/.user.ini
[Mon Jul 10 06:44:47.286502 2023] [autoindex:error] [pid 835:tid 139814464513792] [client 20.253.242.138:56423] AH01276: Cannot serve directory /opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: binance.com
[Mon Jul 10 07:48:02.326708 2023] [mpm_event:notice] [pid 827:tid 139815391861632] AH00493: SIGUSR1 received.  Doing graceful restart
[Mon Jul 10 07:48:02.385702 2023] [ssl:warn] [pid 827:tid 139815391861632] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 10 07:48:02.387405 2023] [mpm_event:notice] [pid 827:tid 139815391861632] AH00489: Apache/2.4.53 (Unix) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Jul 10 07:48:02.387422 2023] [core:notice] [pid 827:tid 139815391861632] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf'
[Mon Jul 10 08:17:03.383429 2023] [autoindex:error] [pid 13690:tid 139814598797056] [client 157.230.32.156:51185] AH01276: Cannot serve directory /opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: binance.com
[Mon Jul 10 09:55:24.942661 2023] [proxy_fcgi:error] [pid 13951:tid 139814254696192] [client 52.4.52.157:45538] AH01071: Got error 'PHP message: PHP Fatal error:  Out of memory (allocated 29360128) (tried to allocate 20480 bytes) in /bitnami/wordpress/wp-content/plugins/woocommerce/src/Internal/Traits/AccessiblePrivateMethods.php on line 158PHP message: PHP Fatal error:  Out of memory (allocated 29360128) (tried to allocate 20480 bytes) in /bitnami/wordpress/wp-content/plugins/webp-converter-for-media/vendor/composer/ClassLoader.php on line 582'
[Mon Jul 10 09:55:43.549362 2023] [proxy_fcgi:error] [pid 12915:tid 139814682724096] [client 196.6.208.24:53355] AH01071: Got error 'PHP message: PHP Fatal error:  Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/functions.php on line 4811PHP message: PHP Fatal error:  Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/class-wp-hook.php on line 301', referer: https://www.encryptionconsulting.com/what-is-the-certificate-chain-of-trust
[Mon Jul 10 09:55:50.621701 2023] [proxy_fcgi:error] [pid 13951:tid 139814430942976] [client 86.6.184.78:53507] AH01071: Got error 'PHP message: PHP Fatal error:  Out of memory (allocated 29360128) (tried to allocate 327680 bytes) in /bitnami/wordpress/wp-content/plugins/wp-rocket/inc/Engine/Optimization/Minify/CSS/Minify.php on line 215', referer: https://www.google.com/
[Mon Jul 10 09:55:50.676625 2023] [proxy_fcgi:error] [pid 13951:tid 139814430942976] [client 86.6.184.78:53507] AH01071: Got error 'PHP message: PHP Fatal error:  Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0', referer: https://www.google.com/
[Mon Jul 10 09:58:34.774690 2023] [proxy_fcgi:error] [pid 13689:tid 139814380586752] [client 52.4.52.157:33354] AH01071: Got error 'PHP message: PHP Fatal error:  Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 907PHP message: PHP Fatal error:  Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /bitnami/wordpress/wp-content/plugins/wordpress-seo/src/models/indexable.php on line 0'
[Mon Jul 10 09:58:50.702992 2023] [proxy_fcgi:error] [pid 12904:tid 139814380586752] [client 122.174.254.245:37181] AH01071: Got error 'PHP message: WordPress database error Commands out of sync; you can't run this command now for query SELECT COUNT(*) FROM wp_bv_fw_requests; made by BVFW->log, BVLogger->log, MCWPDb->rowsCount, MCWPDb->getVarPHP message: WordPress database error Commands out of sync; you can't run this command now for query SHOW FULL COLUMNS FROM `wp_bv_fw_requests` made by BVFW->log, BVLogger->log, MCWPDb->replaceIntoBVTable', referer: https://www.google.com/
gongomgra commented 1 year ago

Hi @Puneetsingh25,

Thanks for the update. According to the logs you shared, there seems to be an issue with one of your plugins and the database. Can you run the bndiagnostic tool again and share with us the generated code?

github-actions[bot] commented 1 year ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 1 year ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.