ReynierPM
ReynierPM

Reputation: 18660

Wordpress extremely slow at VPS

Recently a client buy a VPS at 1&1 and I moved the Worpress site from old shared hosting (Bluehost) to new VPS. The site is extremely slow and I don't know how to fix this meaning where to attack, if I should optimize something in Apache, if I should install some plugin to avoid this or something else so I need some advice. Some data around that WP:

Can any give me some ideas? Advice? Experience? Do not know what else to do or how to attack this problem and my knowledge does not come so far on this.

Note: The site is this test by yourself and notice how slow it is

Performing Tests:

In order to find the bottleneck I've enabled:

For mysql.log I've noticed a tons of access and for mysqld_slow.log I've noticed the following output:

SET timestamp=1423830131;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# User@Host: elclarin_us[elclarin_us] @ localhost []
# Query_time: 0.001520  Lock_time: 0.000043 Rows_sent: 227  Rows_examined: 261
SET timestamp=1423830131;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# Time: 150213 13:22:14
# User@Host: elclarin_us[elclarin_us] @ localhost []
# Query_time: 0.003051  Lock_time: 0.000097 Rows_sent: 227  Rows_examined: 261
SET timestamp=1423830134;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# User@Host: elclarin_us[elclarin_us] @ localhost []
# Query_time: 0.003259  Lock_time: 0.000097 Rows_sent: 227  Rows_examined: 261
SET timestamp=1423830134;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# Time: 150213 13:22:15
# User@Host: elclarin_us[elclarin_us] @ localhost []
# Query_time: 0.001597  Lock_time: 0.000048 Rows_sent: 227  Rows_examined: 261

Why the same query is executed all the time? Any web server thread is killing my Wordpress?

Upvotes: 1

Views: 1016

Answers (1)

user488187
user488187

Reputation:

It looks like you at least need to look carefully in three areas:

  1. How long it takes the server to create the page
  2. GZip compression
  3. What gets loaded when a page displays.

The server is taking a long time to create your page. All of the SQL queries might be why. You will need to find out what the database activity is for a standard page. If you can tell what is causing the activity, it will give you clues about how to attack it. WordPress by itself is not usually that slow even on a slow VPS.

Second, your site is not set up to use GZip. Just turning on GZip would reduce the amount of data to download significantly.

Third, the page at the link you gave above makes 168 different HTTP requests. It is not a surprise that it takes the page so long to display. Some of these requests prevent the browser from starting to display (render) the page. I recommend you use a site like WebPageTest. It will analyze your site and give you detailed information about exactly what is happening. You can then look at each of the items downloaded and see if there is come way to speed it up.

Upvotes: 2

Related Questions