Saturday
Aug012009
15 Scalability and Performance Best Practices
Saturday, August 1, 2009 at 11:43PM
These are from Laura Thomson of OmniTi:
- Profile early, profile often. Pick a profiling tool and learn it in and out.
- Dev-ops cooperation is essential. The most critical difference in organizations that handles crises well.
- Test on production data. Code behavior (especially performance) is often data driven.
- Track and trend. Understanding your historical performance characteristics is essential for spotting emerging problems.
- Assumptions will burn you. Systems are complex and often break in unexpected ways.
- Decouple. Isolate performance failures.
- Cache. Caching is the core of most optimizations.
- Federate. Data federation is taking a single data set and spreading it across multiple database/application servers.
- Replicate. Replication is making synchronized copies of data available in more than one place.
- 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
- Use a compiler cache. A compiler cache sits inside the engine and caches the parsed optrees.
- Be mindful of using external data sources. External data (RDBMS, App Server, 3rd Party data feeds) are the number one cause of application bottlenecks.
- Avoid recursive or heavy looping code. Deeply recursive code is expensive in PHP.
- Don’t Outsmart Yourself . Don’t try to work around perceived inefficiencies in PHP (at least not in userspace code!)
- 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
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.
Shallow post. I want to like it but without background the data points are of little use.
The linked to post goes into the detail.
0. Don't use PHP.