Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Site Painfully slow. WordPress

  • SOLVED

We have rebuilt the entire theme and removed all uploads. It seems to be something to do with the amount of uploads and the file size of them. Uploads Directory is 1.44 GB

We need someone to suggest a way to speed the site up that will work. The site runs nice and smooth with the uploads folder deleted but once we start uploading the site becomes VERY slow.

We can provide access to our mirror of the site and answer questions.

http://dev.overhaulmedia.com/cms

Answers (4)

2011-01-10

Jonah Schulte answers:

It looks like your site is trying to load several files that do not exist and is returning a 404 error for those files. It seems the missing files may be causing some of the slow load time:

http://dev.overhaulmedia.com/cms/wp-content/themes/faith/library/styles/reset.css
Total Duration 2.8s

http://dev.overhaulmedia.com/cms/wp-content/themes/faith/library/styles/base.css
Total Duration 7.8s

http://dev.overhaulmedia.com/cms/THEMECSS/print.css
Total Duration 8.5s

The first two CSS files are referenced using @import in the following CSS file:

http://dev.overhaulmedia.com/cms/wp-content/themes/faith/style.css

Just remove the @import statements at the top of that file to remove these erroneous includes.

For the /cms/THEMECSS/print.css file, it seems like "THEMECSS" should be replaced by the actual path to where your theme's CSS file exists. I tried a few things but couldn't locate a print.css file on your site. That doesn't mean there isn't one, but the /cms/THEMECSS path is not correct. I'm also seeing a THEMEIMG folder referenced in some places.

I also see that you're including the following file on your page:

http://faithinyourfuture.ca/wp-content/themes/Faith/assets/images/middle_resources_bg.gif

That's probably not a big deal, but you may as well copy that image and host it within the dev.overhaulmedia.com domain so it saves the user a DNS lookup (and therefore saves load time).

Please try the above changes and we can see what else may need to be done to improve performance!

Cheers,
Jonah


Jonah Schulte comments:

If you want to private message me with access to your server environment I can troubleshoot the problem and determine what is causing the slow page load. I would need SSH/FTP access as well as a login for your Wordpress admin. Happy to help!


Jonah Schulte comments:

Can you post the .htaccess file you are using for the faithinyourfuture.ca site?


Overhaul Media comments:

# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
<FilesMatch "\.(css|js)$">
FileETag None
<IfModule mod_headers.c>
Header set X-Powered-By "W3 Total Cache/0.9.1.3"
</IfModule>
</FilesMatch>
<FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$">
FileETag None
<IfModule mod_headers.c>
Header set X-Powered-By "W3 Total Cache/0.9.1.3"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$">
FileETag None
<IfModule mod_headers.c>
Header set X-Powered-By "W3 Total Cache/0.9.1.3"
</IfModule>
</FilesMatch>
# END W3TC Browser Cache

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


Jonah Schulte comments:

As a test, you should try removing the W3TC section of the .htaccess file and leave only this in the file:


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


I bet it will make a difference...


Jonah Schulte comments:

What plugins do you have installed in the wordpress admin for that site? You should try disabling them one by one to see if the site suddenly begins to load quickly. If one plugin in particular is causing the slowness, you may be able to replace it with a different plugin that does not cause the issue. As always, a full backup of the site and database are recommended before making changes like that...


Overhaul Media comments:

As mentioned, we removed all plugins previously with no effect. I will try the .htaccess tweak though.


Overhaul Media comments:

.htaccess had no effect. :(


Jonah Schulte comments:

Keep in mind that changes you make to files on MediaTemple may not have immediate effect. Sometimes it takes 5 or 10 minutes for a change to happen because your files are on "the cloud" and the server you're connecting to might not have the latest version yet. I might suggest making the .htaccess change and waiting 10-15 minutes and then trying the site. Just one idea... it might not help, but if you just tested the change quickly it may not have had any effect.


Jonah Schulte comments:

Another idea is... try disabling Permalinks in the wordpress admin and see if that makes a difference for the page load time. You can always turn them back on once you've tested that change.


Overhaul Media comments:

I can't believe we didnt try that before.. That is what it is.... Now how can we go about fixing this issue? Other then just disabling them?


Jonah Schulte comments:

For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to have at least two path segments in your post's permalink structure such as /%year%/%post_name%/ or even /posts/%post_name/. (Some people recommend /%post_id%/%post_name%/ which works for performance reasons but others recommend against it because it is unfriendly to users in the many contexts in which users interact with URLs.)

Here are some links with more information about how to solve this issue:

http://digwp.com/2010/07/optimizing-wordpress-permalinks/
http://codex.wordpress.org/Using_Permalinks

Let me know if you need anything else!

Thanks,
Jonah


Jonah Schulte comments:

Another suggestion... change your 404 page to a very small page to see if that helps with the load time. If there are any broken images or missing files on the page, in theory I think the server generates a 404 page for each missing file and sends it to the browser even though the browser typically ignores it. Right now your 404 page is the site's home page:

http://faithinyourfuture.ca/wtjhwtr/ikahtui3ta3htu3t5t/

Changing that may help a little, too.

2011-01-10

Andrew B answers:

URL?


Overhaul Media comments:

Added to the description. I was hoping I could do that privately.

2011-01-11

philip answers:

Use Chrome with resource tracking enabled? Very handy!

Like you say it is the images taking rather a long time to return a 404.

http://www.faithinyourfuture.ca/wp-content/uploads/2009/04/jim1.jpg

is ridiculously slow, but

http://www.faithinyourfuture.ca/wp-content/themes/Faith/assets/images/principal8.jpg

seems fine

but navigate to a different page other than home, and the 'document' load takes forever.

in order you could:

switch to the default theme and see if the page load issues are still present to determine whether it's your theme code

remove plugins, incl. Caching ones (I see that on staug.faithinyourfuture.ca performance is good without W3 Cache)

you could try removing the slider functionality if in the code and other scripts one at a time ... good candidates for fouling things up

export the important stuff and do a fresh install, including the DB, loading plugins one at a time,

is this a multisite with subdomains? check the individual site options page for untoward references specifically to the uploads folders?

Good luck!

PS Is .htaccess mangled?


Overhaul Media comments:

The site you are looking at is the FAST one.
This is a rebuilt theme, scaled back plugins, new database.
The SLOW site is http://faithinyourfuture.ca

As I said in my original post. Its something to do with the /uploads/ folder. Once we start putting them into the mirror site it also becomes painfully slow (4-7) seconds load time.

We already did pretty much everything you suggested.


philip comments:

Out of curiosity did you try turning the permalinks back on? and what were the offending rewrite_rules on the site?


Overhaul Media comments:

We tried turning them back on with a few combination's, all of which seemed to fail and make the site brutally slow again. For now we can run without them but I would really like to know how/why this happened and how to prevent it.


philip comments:

Clutching at straws here

1) Add Options +FollowSymLinks to the .htaccess, though I imagine it is already enabled
2) Possibly there is something untoward in your apache conf file / virtual hosts file.
3) See what the options table has in rewrite_rules ... not sure what you'll be looking for but compare with a subsite that works with permalinks
4) take a look at http://ottopress.com/2010/category-in-permalinks-considered-harmful/ and related articles
5) If your host has a top notch unix developer on the staff, they'll like this sort of problem, especially if it exonerates them from blame!

Take care

2011-01-11

Dave Holowiski answers:

Hi. There are many optimizations that you could do to your web site, as others have mentioned. However, I don't think that is the problem. I believe the server that you are on is severely overloaded.
I tried downloading individual images from your 'uploads' folder, and some download immediately but some take several minutes, or fail totally. Because there are so many images on your site the problem is multiplied.

In addition, the version running on your dev server loads pretty fast, except for the images, which are hard coded to the production server (faithinyourfuture.ca). The images are either slow or don't load. This is more evidence that your server is the cuplrit here.

It looks like you're using MediaTemple for the hosting. I would guess you're using their Grid service? While it sounds great in theory, I have heard people complain about speed issues with this service.

My recommendation: Switch hosting providers (I can give recommendations if you like). It might be worth contacting Media Temple support and asking them why your server is running so slow (You might be sharing it with someone who is abusing the server) but they're just as likely to blame WordPress as they are to fix it.

update...
That's a good point about the other sites being on the same server... strange.
I also noticed that all of the uploads on the home page were in /wp-content/uploads/2009/04/ - is this true of everything, or are they distributed though other folders (by year and month)?
If you have thousands of files in one folder the OS can choke trying to find a file - this is why WordPress splits uploads by year and month.


Overhaul Media comments:

I tend to agree.. We're actually on a DV there which has more power and has been good for years they do not provide much support for. The strange thing is.. http://ht.faithinyourfuture.ca/ that's a site on the same server, account even that runs well. The dev.overhaulmedia.com is the same server too.. so it's only the one site/directory that's slow.