Cache Shared Data
Anytime you can skip a visit to a critical section, you are looking at a scalability gain. The simplest application of this idea is by caching shared data and reusing it in future access without needing to lock and unlock a shared resource. This was actually the single biggest scalability optimization that we made to our original Web server design and implementation. Initially, not only did it not scale, it had actually exhibited fractional scaling—throughput was slashed in half when we moved from a uniprocessor to a 4-way SMP. Something was seriously wrong.
We have already described the overall design of our Web server earlier in this chapter. We had a 1-1 mapping between threads and requests. A pool of available threads had ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access