Migrated to AWS Lightsail, now site takes over 2 minutes to load a page

Keywords: WordPress - AWS - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: d1ba0c71-f09f-de60-48bd-8b84837e46bd
Description:
My site is taking minutes to load. I’ve disabled almost every possible plugin, worked through the suggestions in the support tool. Here is the output from the log:

$ tail  /opt/bitnami/apache2/logs/error_log
[Tue Jun 08 16:28:05.197334 2021] [core:notice] [pid 30988:tid 139902371444032] AH00094: Command line: '/opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf -D DISABLE_BANNER'
[Tue Jun 08 16:41:44.068536 2021] [mpm_event:notice] [pid 30988:tid 139902371444032] AH00491: caught SIGTERM, shutting down
[Tue Jun 08 16:41:48.138445 2021] [mpm_event:notice] [pid 31387:tid 140527096407360] AH00489: Apache/2.4.46 (Unix) OpenSSL/1.1.1i configured -- resuming normal operations
[Tue Jun 08 16:41:48.138547 2021] [core:notice] [pid 31387:tid 140527096407360] AH00094: Command line: '/opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf -D DISABLE_BANNER'
[Tue Jun 08 16:45:48.309107 2021] [mpm_event:notice] [pid 31387:tid 140527096407360] AH00491: caught SIGTERM, shutting down
[Tue Jun 08 16:45:52.377901 2021] [mpm_event:notice] [pid 31697:tid 140228303377728] AH00489: Apache/2.4.46 (Unix) OpenSSL/1.1.1i configured -- resuming normal operations
[Tue Jun 08 16:45:52.379166 2021] [core:notice] [pid 31697:tid 140228303377728] AH00094: Command line: '/opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf -D DISABLE_BANNER'
[Tue Jun 08 16:48:50.201644 2021] [mpm_event:notice] [pid 31697:tid 140228303377728] AH00491: caught SIGTERM, shutting down
[Tue Jun 08 16:48:54.269882 2021] [mpm_event:notice] [pid 31958:tid 139933067572544] AH00489: Apache/2.4.46 (Unix) OpenSSL/1.1.1i configured -- resuming normal operations
[Tue Jun 08 16:48:54.271102 2021] [core:notice] [pid 31958:tid 139933067572544] AH00094: Command line: '/opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf -D DISABLE_BANNER'

Tidbits:

  • Using Really Simple SSL
  • Updated httpd.conf for correct servername
  • Disabled JetPak performacnce caching
  • Ran the Support Tool: d1ba0c71-f09f-de60-48bd-8b84837e46bd

This error is troubling:
$ apachectl -t
AH00526: Syntax error on line 46 of /opt/bitnami/apache2/conf/bitnami/bitnami.conf:
SSLCertificateFile: file ‘/opt/bitnami/apache2/conf/server.crt’ does not exist or is empty

Verified that the cert is there. Is it a possible permissions issue with the cert?
Any help is appreciated!

Hi @kelliexmachina,

Thanks for using Bitnami. Regarding the syntax error you shared, I see in your bnsupport bundle that the server.crt file is a symlink to another file. Can you check the target file also exists on your server? I couldn’t find it in the information provided by the tool.

server.crt -> /etc/letsencrypt/live/girlexmachina.com/fullchain.pem

Additionally, I see your server is running out of free memory. We recommend you to use a bigger instance in order to have more resources for your website.

-----------------------------------
Display amount of free and used memory in the system
-----------------------------------
Running: free -m
In: /opt/bitnami

Output:

              total        used        free      shared  buff/cache   available
Mem:            478         322           5          49         150          95
Swap:           634         413         220

I also see you disabled Pagespeed in the httpd.conf file. Did you restart Apache after updating the configuration?

sudo /opt/bitnami/ctlscript.sh restart apache

Thanks for the fast reply @gongomgra!

So the cert is displayed when I run:

sudo cat /etc/letsencrypt/live/girlexmachina.com/fullchain.pem

I deployed a plain HTML page with the word ‘TEXT’ on it. Clicking the link to that page yields the same wait time, so I don’t think it’s a memory issue. I do see that the swap is being utilized, but this isn’t a busy site and actually has no traffic. I also ran a test script to navigate the site. Each page has the long wait, yet I have immediate response from the WordPress admin page during the test (including uploading new images).

I restart apache after every config change and verify that the previous errors stopped.

My biggest concern is the error returned when I run apachectl -t.

I’m going to run through the AWS Lightsail doc:

https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-enabling-https-on-wordpress

and see if I can manually resolve the issue. The site was working before I secured it. :frowning:

So after repeating the same thing over and over, expecting a different result, I finally wised up an ran the bitnami cert tool:

sudo /opt/bitnami/bncert-tool

Which made multiple changes. None of which sped up the site. So I cloned my Lightsail deployment to an EC2 instance with enough resources to hold down an eCommerce site. Still slow.

Finally, I realized that I had several pages that had latent code blocks from my previous hosting site’s editor. After removing those blocks (and spending all night recreating the content) the site is snappy!

Thank you for assisting a WordPress Bitnami noob!

Hi @kelliexmachina,

Thanks for the info. I’m glad you fixed your issue! Also thank you for posting your solution here. Can we close this thread as solved?

Regards,
Gonzalo