Skip to Content
Web容量规划之美
book

Web容量规划之美

by Arun Kejariwal, John Allspaw
August 2019
Beginner to intermediate
232 pages
3h 50m
Chinese
China Electric Power Press Ltd.
Content preview from Web容量规划之美
93
测量
容量的单位
缓存系统
我们之前提过磁盘是基础设施中最慢的部分,对其访问最耗时。多数大型网站通
过将数据缓存在不同位置来减轻这种昂贵操作的需求。
Web
架构中,缓存最经常被用于存储数据库结果(比如用
Memcached
)或实际
文件(比如用
Squid
Varnish
)。这两种方法都需要考虑容量规划方面的要求。
它们是反向代理的示例,都是将缓存数据从
Web
服务器发向客户端(通常是
Web
浏览器)的专门系统。
首先让我们来看看图
3-13
中的图标,观察
Squid
Varnish
缓存是如何与服务器正
常写作的。如图
3-14
所示,当说明
Memcached
风格的数据库缓存时,图标只是略
有不同。
3
-
13
:服务器缓存机制的基本内容(反向代理)
缓存效率:工作集和动态数据
两个影响缓存容量的主要因素是你工作集的大小及你的数据动态和变化的程度。
你的数据多久改变将决定你是否会选择缓存该数据。有一些数据几乎从来没有改
变过。这种类型的数据包括用户名称和账户信息。还有一部分信息频繁地变动,
如用户发出的最后一条评论,或上传的最后一张照片。图
3-15
说明了缓存效率和
数据类型之间的关系。
94
3
3
-
14
:数据库缓存
3
-
15
:缓存效率取决于变更的频率
很显然,将频繁更改的数据缓存没有什么益处,因为代理将要花更多的时间使缓 ...
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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

GPT-3

GPT-3

Sandra Kublik, Shubham Saboo

Publisher Resources

ISBN: 9787519831073