# 可扩展性

**可扩展性**是系统的一种特性，表明系统在无需彻底改造架构的情况下，能在多大程度上于工作负载、数据量或用户数量增长时保持可接受的性能，或反过来，在需求下降时削减资源使用。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup> 这一概念横跨计算、网络、数据库工程和分布式系统等领域，且有别于单纯的速率：一个系统在固定负载下可能表现良好，但当需求上升导致其吞吐量或响应时间急剧恶化时，便缺乏可扩展性。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 通过利用额外资源来维持不断增长的工作负载的能力（Herbst 等，2013）<sup>[2](https://link.springer.com/article/10.1007/s10664-022-10162-1)</sup> |
| 两种策略 | 垂直扩展（向上扩展）为单个节点增加资源；水平扩展（向外扩展）增加更多节点并分配工作负载<sup>[3](https://wa.aws.amazon.com/wellarchitected/2020-07-02T19-33-23/wat.concept.horizontal-scaling.en.html)</sup> |
| 水平扩展的要求 | 无状态应用设计、负载均衡和数据分区<sup>[4](https://aws.amazon.com/blogs/architecture/architecting-for-reliable-scalability/)</sup> |
| 向外扩展的主要成本 | 节点间的网络延迟；数据中心内部的往返通信会增加 0.1 至 1 毫秒的开销，而单机内部不存在这一开销<sup>[1](https://technav.ieee.org/topic/scalability/)</sup> |
| 加速上限 | 阿姆达尔定律：设串行比例为 F、处理器数量为 P，最大加速比为 1/(F+(1-F)/P)<sup>[5](https://foldoc.org/Amdahl%27s%2BLaw)</sup> |
| 定量模型 | 通用可扩展性定律将容量建模为处理器数量的有理函数，涵盖了阿姆达尔定律和古斯塔夫森扩展<sup>[6](https://arxiv.org/abs/0808.1431)</sup> |
| 相关概念 | 弹性额外描述了系统适应的速度、频率和粒度；可扩展性是弹性的前提条件<sup>[7](https://elib.uni-stuttgart.de/bitstream/11682/9606/1/AutomatedPerformanceRegressionDetectionInMicroserviceArchitectures.pdf)</sup> |

## 术语的定义与历史

随着客户端-服务器模型被能够处理数百万并发用户的互联网级应用所取代，可扩展性逐渐被视为软件和系统工程中的核心设计要求。该学科借助排队论、并行计算和分布式系统理论来刻画和预测系统在需求变化下的行为。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup>

这一术语长期以来难以精确界定。在 1990 年 ACM SIGARCH 的一篇论文中，[威斯康星大学麦迪逊分校](https://www.edgepedia.org/zh/university-of-wisconsin-madison)（University of Wisconsin–Madison）的计算机科学家马克·D·希尔（Mark D. Hill）考察了可扩展性的形式化定义，并报告称他未能找到有用且严谨的定义；他指出，该术语是多处理器系统频繁宣称的一种属性，其使用更多增添了营销价值而非技术洞见。<sup>[8](https://doi.org/10.1145/121973.121975)</sup> 卡内基梅隆大学软件工程研究所（Carnegie Mellon Software Engineering Institute）的[约翰·B·古迪纳夫](https://www.edgepedia.org/zh/john-b-goodenough)（John B. Goodenough）在一份技术札记中同样将可扩展性界定为处理增加的工作负载的能力，并指出系统无法容纳增加的工作负载并非新问题。<sup>[9](https://resources.sei.cmu.edu/asset_files/TechnicalNote/2006_004_001_14681.pdf)</sup> 在云计算领域，Herbst、Kounev 和 Reussner 提出的一个广泛使用的工作定义指出，可扩展性是系统通过利用额外资源来维持不断增长的工作负载的能力。<sup>[2](https://link.springer.com/article/10.1007/s10664-022-10162-1)</sup>

## 垂直扩展与水平扩展

扩展系统存在两种基本策略。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup>

在垂直扩展中，也称为向上扩展，通过安装额外的 CPU 核心、更多内存或更快的存储来提升单台机器的容量。由于应用无需修改，这种方法在设计上很简单；然而，单台机器可用硬件的上限限制了其潜力，且对单一节点的依赖造成了单点故障。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup> 承载单体应用的垂直扩展服务器还会产生架构师所称的命运共担：该服务器的任何故障都会影响整个应用。<sup>[4](https://aws.amazon.com/blogs/architecture/architecting-for-reliable-scalability/)</sup>

**水平扩展**，也称为向外扩展，向系统添加更多节点并在它们之间分配工作负载。水平可扩展的系统通过添加更多计算机来增加容量，而垂直可扩展的系统则被限制为仅在一台计算机上运行其进程。<sup>[3](https://wa.aws.amazon.com/wellarchitected/2020-07-02T19-33-23/wat.concept.horizontal-scaling.en.html)</sup> 向外扩展并不要求应用以无共享状态的方式构建；结合负载均衡和数据分区，有状态组件也可以水平扩展，使组合容量能够远超任何单台机器的极限。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup><sup> • </sup><sup>[16](https://learn.microsoft.com/en-us/azure/architecture/framework/scalability/capacity)</sup> 将实例分布到多个可用区不仅提升性能，也提升整体可靠性，而单体应用难以实现弹性的水平可扩展性。<sup>[4](https://aws.amazon.com/blogs/architecture/architecting-for-reliable-scalability/)</sup>

在水平扩展中，主要开销在于节点之间的网络延迟：数据中心内部的一次往返通信额外耗费 0.1 至 1 毫秒，而当一切都在单台机器上运行时则不存在这一延迟。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup>

## 设计要求

无状态架构——即应用状态的存储和请求独立于应用实例——是无缝向外扩展行为的基础；它还使服务能够增长、收缩或重启，而不会丢失进行中请求所需的数据。<sup>[4](https://aws.amazon.com/blogs/architecture/architecting-for-reliable-scalability/)</sup><sup> • </sup><sup>[10](https://docs.cloud.google.com/architecture/scalable-and-resilient-apps)</sup> 模块化对此形成补充：具有明确边界的组件可以独立管理、保护和扩展，从而只扩展需要更多资源的组件。<sup>[4](https://aws.amazon.com/blogs/architecture/architecting-for-reliable-scalability/)</sup><sup> • </sup><sup>[10](https://docs.cloud.google.com/architecture/scalable-and-resilient-apps)</sup> 缓存通过减少对基于磁盘的存储的依赖、降低请求延迟并减轻数据库等下游服务的负载来支持可扩展性。<sup>[10](https://docs.cloud.google.com/architecture/scalable-and-resilient-apps)</sup>

在分布式系统中，水平可扩展性通过同时分区计算和数据来实现。无状态层在负载均衡器后方进行复制，使任何实例都能处理任何请求；数据则使用一致性哈希或范围分区等技术在存储节点间进行分区，使数据集增长时不会有单一节点成为瓶颈。埃里克·布鲁尔（Eric Brewer）于 2000 年提出、后经形式化证明的 CAP 定理约束了此类设计：分布式系统最多只能同时提供一致性、可用性和分区容错性中的两项。<sup>[1](https://technav.ieee.org/topic/scalability/)</sup>

## 度量与建模

可扩展性以服务级别目标（SLO）为基准进行度量。一种基准测试方法定义了两种互补的指标：需求指标将每种负载强度映射到满足所有 SLO 所需的最小资源，容量指标将已配置的资源映射到其能够处理的最大负载。容量指标揭示了系统是否在某个最大资源量处停止扩展，例如达到最大并行度时。<sup>[2](https://link.springer.com/article/10.1007/s10664-022-10162-1)</sup> 由于可扩展性不考虑时间因素，其实验在固定负载水平下孤立运行；仅在固定的高负载下测试无法揭示对预期趋势（如资源利用率的线性增长）的偏离。<sup>[2](https://link.springer.com/article/10.1007/s10664-022-10162-1)</sup>

理论模型限定了扩展所能达到的效果。[阿姆达尔定律](https://www.edgepedia.org/zh/amdahls-law)源自[吉恩·阿姆达尔](https://www.edgepedia.org/zh/gene-amdahl)（Gene Amdahl）1967 年发表于 AFIPS 的关于单处理器方法在大规模计算中有效性的论文，它给出 P 个处理器的最大加速比为 1/(F+(1-F)/P)，其中 F 是计算中串行部分的比例；串行比例对处理器增加时的加速比构成严重制约。<sup>[5](https://foldoc.org/Amdahl%27s%2BLaw)</sup><sup> • </sup><sup>[11](https://dblp.org/rec/conf/afips/Amdahl67.html)</sup> 性能分析师、通用可扩展性定律的提出者尼尔·J·冈瑟（Neil J. Gunther）用有理容量函数 \( C_p = P(p)/Q(p) \) 对此进行了推广，其中 \( P(p) \) 是线性的，\( Q(p) \) 是物理处理器数量 \( p \) 的二次多项式；阿姆达尔定律和古斯塔夫森加速比是该排队论上界的推论，该上界等价于具有状态相关服务率的修理工模型中的同步吞吐量。<sup>[6](https://arxiv.org/abs/0808.1431)</sup> 该定律已被应用于从多核平台上 memcached、J2EE 和 WebLogic 等系统的测量中量化扩展性。<sup>[12](https://arxiv.org/abs/1105.4301)</sup>

## 可扩展性、弹性与效率

在云计算中，可扩展性与弹性有所区别。可扩展性描述系统通过使用额外资源来适应不断增长的工作负载的能力；弹性额外增加了系统适应的速度、频率和粒度等方面，使可扩展性成为弹性的前提条件。<sup>[7](https://elib.uni-stuttgart.de/bitstream/11682/9606/1/AutomatedPerformanceRegressionDetectionInMicroserviceArchitectures.pdf)</sup> Herbst 及其同事将弹性定义为软件系统在工作负载增加或减少时动态扩展其所提供资源的能力，并通过资源不足和资源过剩状态来评估，使用诸如离开资源不足状态的平均时间和资源不足的平均量等指标。<sup>[13](https://www.researchgate.net/publication/275971354_Scalability_Elasticity_and_Efficiency_in_Cloud_Computing_a_Systematic_Literature_Review_of_Definitions_and_Metrics)</sup> 时间出现在几乎所有已考察的弹性定义中，而可扩展性的刻画则不涉及适应速度。<sup>[13](https://www.researchgate.net/publication/275971354_Scalability_Elasticity_and_Efficiency_in_Cloud_Computing_a_Systematic_Literature_Review_of_Definitions_and_Metrics)</sup>

## 计算之外的领域

扩展的词汇也延伸到了组织领域。2024 年一项对 2001 年至 2023 年间发表的 57 篇文章的系统文献综述，统一了创业研究中三个相关术语的界定：扩展（scaling）作为组织过程，可扩展性（scalability）作为一般的组织能力，以及规模化（scale-up）作为组织发展的一个阶段。<sup>[14](https://www.sciencedirect.com/science/article/pii/S0883902624000417)</sup> 在制造系统设计中，研究人员同样区分了通过改变机器硬件和控制软件实现的向上扩展，与通过在系统层面添加机器实现的向外扩展，同时指出可扩展性的主张难以被反驳或证明，因为该术语缺乏公认的精确界定。<sup>[15](https://ykoren.engin.umich.edu/wp-content/uploads/sites/122/2014/05/Scalability-2013.pdf)</sup>

## References

1. [Scalability, IEEE Technology Navigator](https://technav.ieee.org/topic/scalability/)
2. [A configurable method for benchmarking scalability of cloud-native applications, Empirical Software Engineering (Springer)](https://link.springer.com/article/10.1007/s10664-022-10162-1)
3. [Horizontal scaling, AWS Well-Architected Framework](https://wa.aws.amazon.com/wellarchitected/2020-07-02T19-33-23/wat.concept.horizontal-scaling.en.html)
4. [Architecting for Reliable Scalability, AWS Architecture Blog](https://aws.amazon.com/blogs/architecture/architecting-for-reliable-scalability/)
5. [Amdahl's Law, FOLDOC](https://foldoc.org/Amdahl%27s%2BLaw)
6. [Neil J. Gunther, A General Theory of Computational Scalability Based on Rational Functions, arXiv](https://arxiv.org/abs/0808.1431)
7. [Automated Performance Regression Detection in Microservice Architectures, University of Stuttgart](https://elib.uni-stuttgart.de/bitstream/11682/9606/1/AutomatedPerformanceRegressionDetectionInMicroserviceArchitectures.pdf)
8. [Mark D. Hill, What is scalability?, ACM SIGARCH Computer Architecture News (1990)](https://doi.org/10.1145/121973.121975)
9. [John B. Goodenough, On System Scalability, Software Engineering Institute, Carnegie Mellon University](https://resources.sei.cmu.edu/asset_files/TechnicalNote/2006_004_001_14681.pdf)
10. [Patterns for scalable and resilient apps, Google Cloud Architecture Center](https://docs.cloud.google.com/architecture/scalable-and-resilient-apps)
11. [Gene M. Amdahl (1967), Validity of the single processor approach to achieving large scale computing capabilities, dblp record](https://dblp.org/rec/conf/afips/Amdahl67.html)
12. [Neil J. Gunther, Shanti Subramanyam, Stefan Parvu, A Methodology for Optimizing Multithreaded System Scalability on Multi-cores, arXiv](https://arxiv.org/abs/1105.4301)
13. [Scalability, Elasticity, and Efficiency in Cloud Computing: a Systematic Literature Review of Definitions and Metrics](https://www.researchgate.net/publication/275971354_Scalability_Elasticity_and_Efficiency_in_Cloud_Computing_a_Systematic_Literature_Review_of_Definitions_and_Metrics)
14. [Organizational scaling, scalability, and scale-up: Definitional harmonization and a research agenda, Journal of Business Venturing (2024)](https://www.sciencedirect.com/science/article/pii/S0883902624000417)
15. [Scalability in manufacturing systems design and operation: State-of-the-art and future developments roadmap](https://ykoren.engin.umich.edu/wp-content/uploads/sites/122/2014/05/Scalability-2013.pdf)
16. [Architecture strategies for optimizing scaling and partitioning - Microsoft Azure Well-Architected Framework](https://learn.microsoft.com/en-us/azure/architecture/framework/scalability/capacity)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Software engineering and development process › Software design and architecture › Titles Mu to Z

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/scalability

English original: https://www.edgepedia.org/scalability
