« Building a Data Intensive Web Application with Cloudera, Hadoop, Hive, Pig, and EC2 | Main | NSFW: Hilarious Fault-Tolerance Cartoon »

15 Scalability and Performance Best Practices

These are from Laura Thomson of OmniTi:

  1. Profile early, profile often. Pick a profiling tool and learn it in and out. 
  2. Dev-ops cooperation is essential. The most critical difference in organizations that handles crises well.
  3. Test on production data. Code behavior (especially performance) is often data driven.
  4. Track and trend. Understanding your historical performance characteristics is essential for spotting emerging problems.
  5. Assumptions will burn you. Systems are complex and often break in unexpected ways.
  6. Decouple. Isolate performance failures.
  7. Cache. Caching is the core of most optimizations.
  8. Federate. Data federation is taking a single data set and spreading it across multiple database/application servers.
  9. Replicate. Replication is making synchronized copies of data available in more than one place.
  10. Avoid straining hard-to-scale resources. Some resources are inherently hard to scale: Uncacheable’ data, Data with a very high read+write rate, Non-federatable data, Data in a black-box
  11. Use a compiler cache. A compiler cache sits inside the engine and caches the parsed optrees.
  12. Be mindful of using external data sources. External data (RDBMS, App Server, 3rd Party data feeds) are the number one cause of application bottlenecks.
  13. Avoid recursive or heavy looping code. Deeply recursive code is expensive in PHP.
  14. Don’t Outsmart Yourself . Don’t try to work around perceived inefficiencies in PHP (at least not in userspace code!)
  15. Build with caching in mind. Caching is the most important tool in your tool box.

Reader Comments (5)

1. What is the different between no 7 and no 15?
2. Dev-ops cooperation is essential. The most critical difference in organizations that handles crises well? can you elaborate more?
3. Profile often? I used to know what's the different between profiling and logging :(. can you remind me.

thanks a zillion

November 29, 1990 | Unregistered CommenterAnonymous

Building without cashing in mind means that you will have problems implementing caching if the need arises.
A very specific example of difference : MYSQL caching. Turning caching on (aka implementing) will not solve problems as long as you will not write statements in same way (build with caching in mind), as this caching is based on sql strings (case sensitive, I believe).
Profiling is testing how specific fragments of code perform efficiency-wise. Logging is just saving results or errors.
I would say that biggest performance loss is due to lack of development for caching, that is either lack of separation between of various code concerns (database queries, display, design) or non-using data that is already there and re-fetching it.

November 29, 1990 | Unregistered Commentergiedrius majauskas

Shallow post. I want to like it but without background the data points are of little use.

November 29, 1990 | Unregistered CommenterAnonymous

The linked to post goes into the detail.

November 29, 1990 | Unregistered CommenterGeneral Chicken

0. Don't use PHP.

November 29, 1990 | Unregistered CommenterAnonymous

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>