The title is a quote from Nikita Prokopov, who is wallowing in disenchantment.
Hash rings, sharding, request replication
An incomplete lit review on balancing data and request volumes between shards for performance and reliability, with an extra bit about replicating requests to maximize both. » about 1000 words
MySQL performance tips from around the web
Gospel: use InnoDB, never MyISAM It seems everybody on StackExchange is singing from the same gospel: “[How can I] prevent queries from waiting for table level lock?” Answer: use InnoDB. The major advantages of InnoDB over MyISAM. “Even in a read-intesive system, just one DELETE or UPDATE statement will quickly nullify whatever benefits MyISAM has.” […] » about 400 words
Testing apply_filters() times
Testing how long it takes to assign a variable versus assigning through WordPress’ apply_filters(). Filters are core to WordPress, but I haven’t yet looked at the total number of apply_filters() calls used throughout the code. The answer to this question is that calling a non-existing filter before assignment is about 21 times more costly than […] » about 300 words
Testing file include times for a file that may or may not exist
Question: Should you check for a file before attempting to include it, or just suppress errors? Calling file_exists requires stating it twice if the file does exist, so that could take longer. Answer: the file_exists pattern is more than five times faster than the @include pattern for a file that doesn’t exist, and not substantially […] » about 300 words
Site Load Performance Benchmarks
The Loop’s Jim Dalrymple compiled the following numbers for the time it takes various tech sites to load in a browser in late 2011:
- The Loop: 38 requests; 38.66KB; 1.89 secs
- Daring Fireball: 23 requests; 49.82KB; 566 milliseconds
- Macworld: 130 requests; 338.32KB; 8.54 secs
- Ars Technica: 120 requests; 185.99KB; 2.08 secs
- Apple: 46 requests; 419KB; 1.39 secs
- CNN: 196 requests; 269.41KB; 4 secs
- BGR: 368 requests; 2.74MB; 35.33 secs
- AppleInsider: 141 requests; 649.39KB; 5.64 secs
- Facebook: 137 requests; 993.54KB; 11.19 secs
- MacStories: 119 requests; 2.16MB; 2.13 secs
John Gruber started this by calling out The Next Web for it’s slow performance:
- TheNextWeb: 342 requests; 6MB; no time info
WordPress comments_template() and wp_list_comments() Performance
This thread on memory usage while executing WordPress’s comments_template() raised my awareness of performance issues related to displaying comments on posts in WordPress. The first thing to know is that all the comments on a given post are loaded into memory, even if the comments are paged and only a subset will be displayed. Then comments_template() calls update_comment_cache(), […] » about 500 words
Speed WordPress MultiSite With X-Sendfile For Apache
Like WordPress MU before, MultiSite implementations of WordPress 3.0 use a script to handle image and other attachment downloads. That script checks permissions and maps the request path to the files path on disk, then reads the file out to the web server, which sends it to the browser. That approach has some inefficiencies, and […] » about 400 words
SSD MySQL Performance
The above graph and this MySQL performance blog story are from last year, but I believe are still relevant and instructive now. Sure, the FusionIO is faster, but how the hell can you beat a single SSD in terms of price/performance? RAID 10: 4.8 transactions per minute per dollar SSD: 27 transactions per minute per […] » about 100 words
Why PHP’s RegEx Is Slow, And What You Can Do About It (if you happen to be a committer on the PHP project)
Regular Expression Matching Can Be Simple And Fast, by Russ Cox:
Perl [and PHP and others] could not now remove backreference support, of course, but they could employ much faster algorithms when presented with regular expressions that don’t have backreferences.
How much faster? About a million times (no, I do not exaggerate).
I use a lot of regular expressions, and relatively few of them use backreferences. It’d be worth optimizing.
Put An SSD In Your ExpressCard Slot?
I spied the Wintec FileMate 48GB Ultra ExpressCard and began to wonder how it works as a boot drive for Mac OS X in a late 2008 MacBook Pro (the model just before Apple replaced the ExpressCard slot with an SD slot). But I didn’t have to wonder too much, as a post to this […] » about 300 words
Systems Wrangling Session At WordCamp Developer Day
What is the current status of web servers…Is Apache 2.x “fast enough?”
Automattic uses Lightspeed (for PHP), nginx (for static content), and Apache (for media uploads). For WordPress-generated content, all server options are approximately the same speed.
Automattic uses beta versions of APC, and provides a 3-5x performance increase. It’s tied closely to the PHP version, so Automattic recently switched from PHP 4 to PHP 5.
MySQL scales well and is easy enough to use that there’s little reason to consider other DBs for WordPress content. Other applications may have different needs. Note: FriendFeed uses MySQL to store schema-less data. Single-table key lookups in MySQL are faster than getting the data from Memcached.
Automattic uses Batcache for full-page caching (.002 to .003 second), Memcached persistent object cache, very limited MySQL query cache (never larger than 256MB), sufficiently large key buffer.
HyperDB solves DB scaling problems.
User-data backed up every hour, if something changed. Every blog backed up every 12 hours. Dedicated MySQL slaves do LVM snapshots for backups.
WordPress 2.8 Script Handling
jQuery 1.3.2 is in WordPress 2.8, but the most exciting changes are in the automatic concatenation and compression of scripts via the script loader. Andrew Ozz says “This feature can easily be extended to include scripts added by plugins and to use server side caching, however that would require some changes to the server settings […] » about 100 words
MySQL Slow Query Log Analysis
Peter at MySQL Performance Blog pointed out this sweet perl script to analyze MySQL’s slow query logs. (This is supposedly a PHP port.) The script does a good job of aggregating similar queries (those that only differ in their query values) and displaying overall stats for them. The following two queries are showing up a […] » about 300 words
Looking Back At Mac Hardware Performance
I recently replaced the Mac Mini I use to host my web development with a PowerMac G4. (Story: the Mini was mine, a personal purchase I made to support my work on Scriblio and other WordPress-related projects, but recent changes in our network and firewall policy made the machine inaccessible from off-campus without using the […] » about 200 words
Website Performance vs. Crawl Rate
Simple fact of The Google Economy: people can’t find stuff if it’s not indexed in major search engines. A slow site might not seem as bad as blocking the crawlers that search engines use to index your content, but it does seriously affect the depth and frequency of crawling they do. The above is Google’s […] » about 200 words
Scaling PHP
This two year old post about Rasmus Lerdorf’s PHP scaling tips (slides) is interesting in the context of what we’ve learned since then. APC now seems common, and it’s supposedly built-in to PHP6. Still, I’d be interested in seeing an update. Are MySQL prepared statements still slow?
And that’s where Rasmus’ latest presentation comes in. We don’t learn anything about MySQL prepared statements, but we do learn how to find choke points in our applications using callgrind and other tools. In his examples, he can do a little over 600 transactions per second with both static HTML and simple PHP, but various frameworks — with many inclusions and function calls — can slow that to under 50 transactions per second (I suppose they’d explain that in a TPS report).
Amazon To Offer Content Delivery Services
Via an email from the Amazon Web Services group today: …we are excited to share some early details with you about a new offering we have under development here at AWS — a content delivery service. This new service will provide you a high performance method of distributing content to end users, giving your customers […] » about 400 words
NFL Powered By WordPress
WordPress.com VIP hosts some high-traffic sites, including Gizmodo’s live coverage of the iPhone 3g introduction. Now that the NFL has selected the service for their blogging we’ll get a chance to see how they handle the Superbowl rush.
More Web Performance Tips From Steve Souders
Hearing Steve Souders at WordCamp last week got me thinking about website performance, so I went looking for more. The slides from his WordCamp talk are online, but he gave a similar talk at Google I/O which got videotaped and posted richer detail than his slides alone will ever reveal.
Also on his blog: Use the Google AJAX Libraries API when you don’t have a CDN, and a post that asks why make users wait to download all your javascript before they see the page if you’re only going to use 25% of it at first?
MySQL Performance Monitoring Tips From The MySQL Newsletter
Google turned this up, but i have no idea how old it is: How to Monitor MySQL’s performance.
Quercus PHP To Java Compiler vs. WordPress
Emil Ong is the Chief Evangelist and a lead developer for Caucho Technology, the developers of the Quercus PHP to Java compiler. The idea, I guess, is to write in PHP, deploy in Java, which some people say is better supported by the “enterprise.”
Ong claims 26% performance improvement over Apache + mod_php + APC. That sounds great, I suppose, but it’s less than what Chris Lea suggests is possible if you simply replace Apache with Nginx.
Steve Souders On Website Performance
Steve Souders: 10% of the problem is server performance, 90% of problem is browser activity after the main html is downloaded. He wrote the book and developed YSlow, so he should know.
JavaScripts are downloaded serially and block other activity. Most JavaScript functions aren’t used at OnLoad. We could split the JS and only load essential functions up front, and load all the rest later. How much might that help? He says 25% to 50%. This quickly gets complex, but he’s got a simple plan that considers three questions:
- Is the script URL on the same host as the main HTML?
- Should the browser indicate it’s busy, or not?
- Does script execution order mater?
And at that point things started to get too interesting to take publishable notes. I clearly need to pay more attention to this guy.
Stats he mentioned without being specific about the source:
- Google: 200ms longer download time cut revenue by 20%
- Yahoo: 100ms of latency costs … big.
WordPress Performance Tips
Elliott C. Back points to his use of object caching, WP-Cache, and MySQL query caching among the reasons why his site “is so much faster that yours.”
Changes To WordPress Object Caching In 2.5
Jacob Santos‘ FuncDoc notes: The WordPress Object Cache changed in WordPress 2.5 and removed a lot of file support from the code. This means that the Object Cache in WordPress 2.5 is completely dependent on memory and will not be saved to disk for retrieval later. The constant WP_CACHE also changed its meaning. I’ve just […] » about 200 words