Tag Info

Hot answers tagged

24

You could install WordPress on Nginx. There are a number of resources to help: nginx Compatibility plugin HOWTO: Install WordPress On Nginx- Slicehost discussion How To Speed Up WordPress With Nginx And WP Super Cache WordPress on nginx + lighttpd + FastCGI + php Nginx as a front-end proxy cache for WordPress Some performance information from that last ...


22

Set client-side expiries for things like css, images, JavaScript etc which don't need to be redownloaded for each page view. This, by far, made the biggest difference to my site loading times. The fastest download is the download that never happened ... # BEGIN Expire headers <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus ...


22

Not worth the trouble. WordPress doesn't eat a lot of memory just-because. It eats a lot of memory because it runs a lot of functionality under the hood. It is far more easier and efficient to cache results (page generated) with static cache plugin and serve that. That way most visitor will not even hit WP itself.


20

And this is why I think WordPress is in serious need of a rewrite. You can no longer blame its memory consumption on sheer complexity of what it does. It simply does things wrong. What a naive conclusion. Read Things You Should Never Do, Part I. Thanks for the memory usage plots, though.


18

Minimize the number of plugins you run to only what you really need. Especially be aware of plugins that add javascript and CSS code on every page load, even when that code isn't being used on the page. If you are creating your own theme from scratch, break your CSS down so that features that are only need for particular page templates or view types ...


15

Starting with WordPress 3.2, PHP 5.2 will be the minimum requirement. I think with that under our belts, bits of the core can start to be restructured, and use classes with auto-loading. This would let us avoid loading some chunks of code unless they were actually needed. For example, if there were no embeds or galleries in a page view, we might be able to ...


14

How can we make Wordpress initialize its environment in memory only once, and then reuse it many times for each hit? It's called opcode-caching. http://en.wikipedia.org/wiki/PHP_accelerator


11

Run memcached and use an object cache to reduce the number of database queries. This caches data from the database, rather than pages. Not sure if w3-total-cache already does this. Make sure you are running an opcode cache like APC. (There are several more available.)


11

I've developed a 55k product ecommerce site using Wordpress with the Shopp plugin and can share what I've done to MySQL to eke out better performance, YMMV and some (or all) of these may not apply to your situation. Determine how much you need to increase buffers/caches by by looking at the output from a "show status" sql command - there are tools which ...


9

I would indeed switch to InnoDB. Table locking/row locking has long been discussed by many. I would always choose InnoDB hands down. However, there is another profound reason for choosing InnoDB...CACHING. While most people boast that MyISAM is faster for reads, most people forget that the many cache for MyISAM, which is called the key cache (set by ...


8

When updating post taxonomies, you can call wp_defer_term_counting( true ) before you do your mass operation, and then wp_defer_term_counting( false ) to update the term counts only once per term.


8

In addition to using a disk caching plugin like wp-cache, put your blog on a host volume that has the "noatime" property set on it. Otherwise, SSH into your host (if your webhost provides that) and routinely run this command on your files every few days: chattr -R +A ~/* The ~/* means "my files under my home directory". You can change that path as you ...


7

A few answers off the top of my head: 1) Minimize the number of HTTP requests the browser has to make to your host by concatenating JavaScript and CSS where possible/practical. 2) Offload as much of your image/media serving to 3rd party CDNs as possible, particularly if you're using shared hosting. 3) Try reducing the number of posts you're displaying on ...


7

It's really simply GoDaddy and slow mysql and webservers. I've heard apocryphal stories of people making lots of noise to GoDaddy support and as a result, speeds improve. Do they get moved to better servers or get priority load-balancing? Impossible to say. One other thing to try is http://wordpress.org/extend/plugins/use-google-libraries/ but sometimes it ...


7

It did appear that the json wasn't being cached by wp-super-cache, but we decided to take a different approach. By using the transient api, we were able to do a faux-cache on all json, and drastically reduce the taxing of the database. Then on the ajax side of things, we are caching the html that is created from this semi-cached json. Things are super ...


6

WP Super Cache examines your WordPress site's pages for some HTML tags before it caches them. Your pages most probably don't have </html> tag (common issue), in that case, try adding something like //</html> -- that's a workaround, and WP Super Cache should then generate cached versions of your pages. Why does WP Super Cache do it like that? ...


6

Excellent responses on WP Hackers: http://lists.automattic.com/pipermail/wp-hackers/2012-June/043213.html What you're doing with that query, is loading EVERY matching post into memory, including the full post contents. As you can imagine, this is probably quite a lot of items. You can pass 'fields' => 'ids' into WP_Query to simply return a list ...


6

If possible get your PHP updated to the 5.4.x branch. Before you add your caching layer you need to determine whats slowing down MySql and PHP. You need to enable WP_Debug and eliminate any PHP errors. Look for undefined indexes, syntax errors and deprecated functions. That 20 second to first byte is all PHP, MySql and or WordPress related. It sounds ...


6

Hi @goatlady: While this is really a MySQL question it does help to understand the WordPress SQL schema and also I love trying to optimize SQL queries so rather than send you off to StackOverflow I'll try to answer you here. You may still want to post it over there to get some other opinions. And while I don't fully understand your requirement I think I ...


6

I beg to differ with the previous two comments. Using a static home page results in WP using an index scan on the posts table's primary key, vs an (oh so occasional) index scan on post_date, status or post_parent in the posts table. In essence, the home page is dead slow because of the poor database design in WP. The schema has ludicrous multicolumn ...


6

This might be too late for you, but I'm going to reply anyway, with a similar answer as I gave to this related question, so future visitors can refer to both questions. I would not store these values in the post metadata table, or at least not only there. You want a table with post_id, lat, lon columns, so you can place an index of lat, lon and query on ...


5

I think it really breaks down to your traffic. The slower the hardware, the slower (the already slow) page generation. It's not specific to WP, it's the same for all large php scripts. If you get a server hit every now and then, as on a dev box or a family blog, it's no big deal. It'll just spit out pages more slowly. If you get concurrent hits on a regular ...


5

By default there isn't any difference for performance of home page. There is however a possibility that some plugin does something slow on that page alone. There are plenty plugins to profile WP performance. I usually use WP Tuner but it seems to be broken for latest WP version, so I have no immediate replacement to suggest. Simplest way is packing ...


5

Use a database class that is trimmed for optimization. We made good experiences with own code to reduce memory usage and database access speed. Next to that, you can optimize the database structure itself by some small changes that do a lot as well. Part of the database class code can be found in the wordpress trac, it did not made it into core (Ticket ...


5

Unless you need to stay backwards compatible with WP 3.0, you can just take advantage of the advanced taxonomy queries support in WP 3.1. The code that generates the SQL can be found in wp-includes/taxonomy.php


5

InnoDB probably won't help you - page/row level locking helps mitigate contention, but it doesn't feel like that's your issue. There's a lot of stuff out there that suggests MyISAM is slower than InnoDB in the average blog scenario (many more reads than writes). Before making a switch, you should at least do the following run mysqltuner which will give ...


5

Siege. Test against both an actual post/page (which would theoretically hit page cache, APC, varnish, etc. for every request after the first request), and against a 404 (e.g., randomly generated strings), which would require database queries on each hit. A few helpful flags: -b benchmark (don't wait between requests) -c N where N is the number of ...


5

Caching the WordPress Menu also gives you a performance boost. Especially if you have a lot of Pages or a giant Menu Structure, this should be considered. Do it in 2 easy steps. At first, create a function that gets or creates the menu, instead of calling wp_nav_menu directly. function get_cached_menu( $menuargs ) { if ( !isset( $menuargs['menu'] ) ) ...


5

This is nonsense. Almost all URL getters are a result of get_option(), eg. get_option('stylesheet_root'), get_option('template') and so on. These options are loaded very early during the request, they are cached and not fetched again. Since the options are fetched anyway, all you can improve is processing time. Nanoseconds. This isn’t worth the trouble. ...


5

Keep in mind that the $content_width global is not only used for images, but also for embedded objects, such as video. So, any solution won't merely be a case of dropping use/support of $content_width itself. Usually a Theme will constrain content-area images in a few ways: Large Image size: Defining $content_width something appropriate for the Theme ...



Only top voted, non community-wiki answers of a minimum length are eligible