Wordpress dropping DB connection and running slow

Keywords: LAMP/MAMP/WAMP - Linux - Technical issue - Other
bnsupport ID: fc3966ea-4559-f74e-817a-7bec516016bc
Description:
Site running really slow and randomly dropping db connection even though credit ails are correct

Hi @greg5,

I can see many errors in the Apache’s log

[Sun Mar 28 14:19:25.970365 2021] [proxy_fcgi:error] [pid 1556:tid 139903165777664] [client 216.244.66.226:36078] AH01071: Got error 'PHP message: WordPress database error MySQL server has gone away for query SELECT id, user_id, date_recorded FROM wp_bp_activity WHERE co$
ponent = 'members' AND type = 'last_activity' AND user_id IN (1) LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/workscout/page.php'), get_template_part, locate_template, load_template, require('/themes/wor$
scout/template-parts/content-page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, bp_replace_the_content, apply_filters('bp_replace_the_content'), WP_Hook->apply_filters, BP_Members_Theme_Compat->single_dummy_content, bp_buffer_template_part, bp$
get_template_part, bp_locate_template, load_template, require('/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php'), bp_get_template_part, bp_locate_template, load_template, require('/plugins/buddypress/bp-templates/bp-legacy/buddypress/members$
single/cover-image-header.php'), bp_get_user_last_activity, BP_Cor...PHP message: WordPress database error MySQL server has gone away for query SELECT id, user_id, date_recorded FROM wp_bp_activity WHERE component = 'members' AND type = 'last_activity' AND user_id IN (1)
LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/workscout/page.php'), get_template_part, locate_template, load_template, require('/themes/workscout/template-parts/content-page.php'), the_content, apply_filt$
rs('the_content'), WP_Hook->apply_filters, bp_replace_the_content, apply_filters('bp_replace_the_content'), WP_Hook->apply_filters, BP_Members_Theme_Compat->single_dummy_content, bp_buffer_template_part, bp_get_template_part, bp_locate_template, load_template, require('/$
lugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php'), bp_get_template_part, bp_locate_template, load_template, require('/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php'), bp_last_activity, bp_get_last_a$
t...PHP message: WordPress database error MySQL server has gone away for query SELECT DISTINCT a.id  FROM wp_bp_activity a  WHERE
(
        (
                (
                        a.user_id = '1'
                        AND
                        a.hide_sitewide = 0
                )

                OR
                (
                        a.component = 'friends'
                        AND
                        a.secondary_item_id = '1'
                )

        )

)

 AND a.is_spam = 0 AND a.type NOT IN ('last_activity') ORDER BY a.date_recorded DESC, a.id DESC LIMIT 0, 21 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/workscout/page.php'), get_template_part, locate_template, $
oad_template, require('/themes/workscout/template-parts/content-page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, bp_replace_the_content, apply_filters('bp_replace_the_content'), WP_Hook->apply_filters, BP_Members_Theme_Compat->single_dummy_c$
ntent, bp_buffer_template_part, bp_get_template_part, bp_locate_template, load_template, require('/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php'), bp_get_templ...'

You can try deactivate the plugin to see if the problem is fixed.

https://developer.wordpress.org/cli/commands/plugin/deactivate/

You can also take a look at the MySQL’s log file to get more information about the issue with the database. The Bitnami Support tool couldn’t obtain that info, can you run this command?

sudo tail -n 30 /opt/bitnami/mysql/data/mysqld.log

Thanks