Wordpress website keep getting down perioducly and the server hand-out

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Services (Apache, MariaDB, MySQL…)

bndiagnostic ID: f8aa00ce-5157-d38f-2f8f-7c8fc63a0f6a

bndiagnostic output:

? Apache: Found possible issues
? Mariadb: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/bch/apps/moodle/troubleshooting/deny-connections-bots-apache/
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/debug-errors-mariadb/

bndiagnostic failure reason: Other

Description:
We have opened many tickets for this issue with no clear clarifications of what happened exactly inside the bitnami lamp server, we are hosting a WordPress website in bitnami (LAMP (PHP 7) Certified by Bitnami 7.4.28-14) in Amazon cloud, the website keeps getting down and when we try to telnet the apache server using (sudo telnet localhost 80) command it returns error (connection timeout).
also once this happens we are unable to access the server from the terminal or FileZilla or any other apps and it is totally hang-out.

every time we need to restore a snapshot of the server and delete the original server.

I have attached the bitnami-tool ID which should contain all the needed information, can you please advise about this critical issue plz as my website is a woocomerce one and can not keep performing this way.

this is the log file for mariadb in the path ( /opt/bitnami/mariadb/logs/mysqld.log )

2022-03-28 9:38:32 2206 [Warning] Aborted connection 2206 to db: ‘unconnected’ user: ‘root’ host: ‘127.0.0.1’ (Got an error reading communication packets)
2022-03-30 5:23:49 15526 [Warning] Aborted connection 15526 to db: ‘unconnected’ user: ‘unauthenticated’ host: ‘connecting host’ (Out of memory.)
2022-03-30 5:24:56 15527 [Warning] Aborted connection 15527 to db: ‘unconnected’ user: ‘unauthenticated’ host: ‘connecting host’ (Out of memory.)
2022-03-30 5:28:58 15556 [Warning] Aborted connection 15556 to db: ‘database_name’ user: ‘database_username’ host: ‘localhost’ (Unknown error)
2022-03-30 5:33:28 15559 [Warning] Aborted connection 15559 to db: ‘unconnected’ user: ‘unauthenticated’ host: ‘connecting host’ (Out of memory.)
2022-03-30 5:42:31 15561 [Warning] Aborted connection 15561 to db: ‘database_name’ user: ‘database_username’ host: ‘localhost’ (Got an error writing communication packet$
Warning : threadpool thread could not be created :Resource temporarily unavailable,current number of threads in pool 5
2022-03-30 6:12:32 15563 [Warning] Aborted connection 15563 to db: ‘database_name’ user: ‘database_username’ host: ‘localhost’ (Got an error writing communication packet$
2022-03-30 7:38:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-03-30 7:38:49 0 [Note] InnoDB: Number of pools: 1
2022-03-30 7:38:49 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-03-30 7:38:49 0 [Note] InnoDB: Using Linux native AIO
2022-03-30 7:38:49 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2022-03-30 7:38:49 0 [Note] InnoDB: Completed initialization of buffer pool
2022-03-30 7:38:49 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=152995443,152995443
2022-03-30 7:38:50 0 [Note] InnoDB: Starting final batch to recover 1059 pages from redo log.
2022-03-30 7:38:50 0 [Note] InnoDB: 128 rollback segments are active.
2022-03-30 7:38:50 0 [Note] InnoDB: Removed temporary tablespace data file: “./ibtmp1”
2022-03-30 7:38:50 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-03-30 7:38:50 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2022-03-30 7:38:50 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
2022-03-30 7:38:50 0 [Note] InnoDB: 10.6.7 started; log sequence number 222095139; transaction id 41664
2022-03-30 7:38:50 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
2022-03-30 7:38:50 0 [Note] Plugin ‘FEEDBACK’ is disabled.
2022-03-30 7:38:50 0 [Note] InnoDB: Buffer pool(s) load completed at 220330 7:38:50
2022-03-30 7:38:50 0 [Note] Server socket created on IP: ‘127.0.0.1’.
2022-03-30 7:38:50 0 [Warning] ‘proxies_priv’ entry ‘@% root@ip-172-26-2-220’ ignored in --skip-name-resolve mode.
2022-03-30 7:38:50 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
Version: ‘10.6.7-MariaDB’ socket: ‘/opt/bitnami/mariadb/tmp/mysql.sock’ port: 3306 Source distribution

Hi @ghina.altal ,

First of all, you have a huge amount of errors in the Apache’s log related to permissions, please ensure you fix them before trying to solve the performance issues. These permissions errors are probably consuming RAM memory

[Wed Mar 30 05:14:53.191798 2022] [proxy_fcgi:error] [pid 12612:tid 140380580972288] [client 172.26.36.103:14058] AH01071: Got error 'arning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/       includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP     Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/      htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP  message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line  173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/ bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php  on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted  in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173'
[Wed Mar 30 05:14:55.045421 2022] [proxy_fcgi:error] [pid 9988:tid 140380091524864] [client 172.26.36.103:14070] AH01071: Got error 'PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/      htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP  message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line  173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/ bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php  on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted  in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173PHP message: PHP Warning:  chmod(): Operation not permitted in /opt/bitnami/apache/htdocs/wp-admin/includes/class-wp-filesystem-    direct.php on line 173PHP message: PHP Warning:  chmod()

You can check this guide to reset the WordPress permissions but please note you are using a custom path

Second, PHP is reaching the limits and that’s why Apache can’t connect to PHP-FPM from time to time

❯ cat php/logs/php-fpm.log
[30-Mar-2022 05:19:09] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 38 idle, and 53 total children
[30-Mar-2022 05:19:10] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 38 idle, and 55 total children
[30-Mar-2022 05:19:12] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 38 idle, and 57 total children
[30-Mar-2022 05:19:13] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 38 idle, and 59 total children
[30-Mar-2022 05:19:14] WARNING: [pool www] server reached pm.max_children setting (60), consider raising it
[30-Mar-2022 05:28:34] WARNING: [pool www] child 1851 exited with code 1 after 561.718774 seconds from start

You can increase the number of children in the /opt/bitnami/php/etc/memory.conf but it’ll be great if you check the bots/attackers guide or install a security plugin like Wordfence

https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/deny-connections-bots-apache/
https://www.wordfence.com/

Finally, you can also try to increase the memory_limit (/opt/bitnami/php/etc/php.ini) parameter to avoid the PHP processes to run out of memory. Those connection errors with the database may be related to that but you can always ask WordPress to know how to troubleshoot it

https://wordpress.org/support/

Hi @jota ,

I am using these permission commands on my server so why I got these errors:

sudo chown -R bitnami:daemon /opt/bitnami/apache2/htdocs
sudo chmod -R g+w /opt/bitnami/apache2/htdocs
sudo chmod 640 /opt/bitnami/apache2/htdocs/wp-config.php

can you please advise on this.

I told you to review the permissions (your commands seem correct), review the PHP-FPM configuration and contact WordPress if you continue running into the same issue.

I was also hosted my website at WordPress but the website was getting slow day by day. I don’t know why this was happening with me. Maybe, I was uploading pictures that’s why this was happening, I’m not sure yet. After that, with the help of Bitnami, I hosted my website on a new platform which is quite fast.

@jota , I know, but you told me that there are ahuge amount of errors in the Apache’s log related to permissions, so how can I fixed that please?? this is my point… what is the correct permission and what are the commands to do reset them?

@jota also there is a plugin called “woocommerce pdf and invoicing” it was working fine, but once I moved the website to the latest bitnami LAMP version (appache 2.4.53) in AWS the settings for the plugin inside the admin dashbored is not showing

I told you how to do it. You need to follow this other post

Do not know how you migrated the app. You can contact the plugin’s developer to know more about this. In the post I shared above, there is also a link to remove the symlink to wp-content in the installation, that may be the issue of this plugin.

Hi @jota
I have already used the correct command for pernission:

sudo chown -R bitnami:daemon /opt/bitnami/apache2/htdocs
sudo chmod -R g+w /opt/bitnami/apache2/htdocs
sudo chmod 640 /opt/bitnami/apache2/htdocs/wp-config.php

I am right???

Those commands are correct in case you have the application in the htdocs directory (as it seems you have). If you continue running into issues, please review the info I posted above

@jota thank you for the information.

yes my root directory is htdocs as I am using bitnami LAMP server, my question is why I got those permission errors in apache log file if my permission is correct??

can you please clarify that??

Do not know what the app is doing so you will need to investigate and debug it. You can contact the WordPress’ support team or the developers of the plugin you are using (if any) to know what’s wrong with the installation.

https://wordpress.org/support/

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.