Score:0

Poor server performance on Linux Ubuntu 20.04 with PHP-FPM, MySQL, and Redis Server installed

in flag

My client’s server has recently started having performance issues. The single website hosted on the server loads very slowly. It is built with WordPress using a custom theme. There are a minimum amount of plugins installed, and none were added in the last few weeks when the performance issues began.

The server has 2 CPUs and 2GB of memory. The server stack is LAMP with Ubuntu 20.04 and PHP FPM. All of the installed software is kept up to date.

Both of the CPUs constantly use more than 80% while running the WordPress site.

The free -m command returns the following: Total 1983, Used 1734, Free 64, Shared 132, Buff/Cache 184, and Available 12.

Rebooting the server temporarily resolves these issues.

Redis Server is installed for object caching. No other caching or optimization plugins are currently installed on the server or in WordPress.

I ran sudo tail -n 10 /var/log/apache2/domain.com_error.log and have included the output below.

[Mon Feb 20 09:59:27.377362 2023] [proxy_fcgi:error] [pid 310468] [client 104.224.117.81:33410] AH01071: Got error 'PHP message: Predis\\Response\\ServerException: LOADING Redis is loading the dataset in memory in /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php:352\nStack trace:\n#0 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(320): Predis\\Client->onErrorResponse()\n#1 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(299): Predis\\Client->executeCommand()\n#2 /var/www/example.com/wp-content/object-cache.php(562): Predis\\Client->__call()\n#3 /var/www/example.com/wp-content/object-cache.php(257): WP_Object_Cache->__construct()\n#4 /var/www/example.com/wp-includes/load.php(730): wp_cache_init()\n#5 /var/www/example.com/wp-settings.php(131): wp_start_object_cache()\n#6 /var/www/example.com/wp-config.php(109): require_once('...')\n#7 /var/www/example.com/wp-load.php(50): require_once('...')\n#8 /var/www/example.com/wp-blog-header.php(13): require_once(...', referer: https://www.example.com/listing/the-tree-corral/
[Mon Feb 20 09:59:28.858978 2023] [proxy_fcgi:error] [pid 310553] [client 157.55.39.219:22656] AH01071: Got error 'PHP message: Predis\\Connection\\ConnectionException: Connection refused [tcp://127.0.0.1:6379] in /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php:132\nStack trace:\n#0 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(109): Predis\\Connection\\AbstractConnection->onConnectionError()\n#1 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(154): Predis\\Connection\\StreamConnection->createStreamSocket()\n#2 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(80): Predis\\Connection\\StreamConnection->tcpStreamInitializer()\n#3 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php(81): Predis\\Connection\\StreamConnection->createResource()\n#4 /var/www/example.com/wp-content...'
[Mon Feb 20 09:59:28.859372 2023] [proxy_fcgi:error] [pid 310553] [client 157.55.39.219:22656] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $image in /var/www/example.com/wp-content/themes/themename/functions.php on line 548'
[Mon Feb 20 09:59:32.089611 2023] [proxy_fcgi:error] [pid 310501] [client 157.55.39.219:24128] AH01071: Got error 'PHP message: Predis\\Response\\ServerException: LOADING Redis is loading the dataset in memory in /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php:352\nStack trace:\n#0 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(320): Predis\\Client->onErrorResponse()\n#1 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(299): Predis\\Client->executeCommand()\n#2 /var/www/example.com/wp-content/object-cache.php(562): Predis\\Client->__call()\n#3 /var/www/example.com/wp-content/object-cache.php(257): WP_Object_Cache->__construct()\n#4 /var/www/example.com/wp-includes/load.php(730): wp_cache_init()\n#5 /var/www/example.com/wp-settings.php(131): wp_start_object_cache()\n#6 /var/www/example.com/wp-config.php(109): require_once('...')\n#7 /var/www/example.com/wp-load.php(50): require_once('...')\n#8 /var/www/example.com/wp-blog-header.php(13): require_once(...'
[Mon Feb 20 09:59:32.089919 2023] [proxy_fcgi:error] [pid 310501] [client 157.55.39.219:24128] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $image in /var/www/example.com/wp-content/themes/themename/functions.php on line 548'
[Mon Feb 20 09:59:32.285842 2023] [proxy_fcgi:error] [pid 310279] [client 185.191.171.4:8256] AH01071: Got error 'PHP message: Predis\\Response\\ServerException: LOADING Redis is loading the dataset in memory in /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php:352\nStack trace:\n#0 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(320): Predis\\Client->onErrorResponse()\n#1 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(299): Predis\\Client->executeCommand()\n#2 /var/www/example.com/wp-content/object-cache.php(562): Predis\\Client->__call()\n#3 /var/www/example.com/wp-content/object-cache.php(257): WP_Object_Cache->__construct()\n#4 /var/www/example.com/wp-includes/load.php(730): wp_cache_init()\n#5 /var/www/example.com/wp-settings.php(131): wp_start_object_cache()\n#6 /var/www/example.com/wp-config.php(109): require_once('...')\n#7 /var/www/example.com/wp-load.php(50): require_once('...')\n#8 /var/www/example.com/wp-blog-header.php(13): require_once(...'
[Mon Feb 20 09:59:32.286079 2023] [proxy_fcgi:error] [pid 310279] [client 185.191.171.4:8256] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $image in /var/www/example.com/wp-content/themes/themename/functions.php on line 548'
[Mon Feb 20 09:59:32.561144 2023] [proxy_fcgi:error] [pid 309940] [client 185.191.171.19:16376] AH01071: Got error 'PHP message: Predis\\Response\\ServerException: LOADING Redis is loading the dataset in memory in /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php:352\nStack trace:\n#0 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(320): Predis\\Client->onErrorResponse()\n#1 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(299): Predis\\Client->executeCommand()\n#2 /var/www/example.com/wp-content/object-cache.php(562): Predis\\Client->__call()\n#3 /var/www/example.com/wp-content/object-cache.php(257): WP_Object_Cache->__construct()\n#4 /var/www/example.com/wp-includes/load.php(730): wp_cache_init()\n#5 /var/www/example.com/wp-settings.php(131): wp_start_object_cache()\n#6 /var/www/example.com/wp-config.php(109): require_once('...')\n#7 /var/www/example.com/wp-load.php(50): require_once('...')\n#8 /var/www/example.com/wp-blog-header.php(13): require_once(...'
[Mon Feb 20 09:59:33.157553 2023] [proxy_fcgi:error] [pid 310553] [client 157.55.39.219:22656] AH01071: Got error 'PHP message: Predis\\Response\\ServerException: LOADING Redis is loading the dataset in memory in /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php:352\nStack trace:\n#0 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(320): Predis\\Client->onErrorResponse()\n#1 /var/www/example.com/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(299): Predis\\Client->executeCommand()\n#2 /var/www/example.com/wp-content/object-cache.php(562): Predis\\Client->__call()\n#3 /var/www/example.com/wp-content/object-cache.php(257): WP_Object_Cache->__construct()\n#4 /var/www/example.com/wp-includes/load.php(730): wp_cache_init()\n#5 /var/www/example.com/wp-settings.php(131): wp_start_object_cache()\n#6 /var/www/example.com/wp-config.php(109): require_once('...')\n#7 /var/www/example.com/wp-load.php(50): require_once('...')\n#8 /var/www/example.com/wp-blog-header.php(13): require_once(...'
[Mon Feb 20 09:59:33.157733 2023] [proxy_fcgi:error] [pid 310553] [client 157.55.39.219:22656] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $image in /var/www/example.com/wp-content/themes/themename/functions.php on line 548'

Any suggestions on how to address these issues?

I am novice server administrator, but keen to learn.

djdomi avatar
za flag
Does this answer your question? [Can you help me with my capacity planning?](https://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning)
Mike Hermary avatar
in flag
@djdomi I have reviewed the post, but it does not assist me too much. The issues I am having only started recently. It worked fine while in development on the same server setup.
djdomi avatar
za flag
is this a private Website?
Mike Hermary avatar
in flag
@djdomi No, it is a public facing [URL](https://www.flagstaff.ab.ca)
djdomi avatar
za flag
Im unsure why you use such a limited VM for a public Website. I had similar issues like this when using wordpress
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.