将可扩展性工程化到应用程序中 [英] Engineering scalability into an application

查看:39
本文介绍了将可扩展性工程化到应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么意思 - 将可扩展性工程化到应用程序中.是否存在可以使应用程序更具可扩展性的设计模式?这个问题主要是在 Web 应用程序或基于 SOA 中间件的应用程序的上下文中.

What does it mean to say - Engineering scalability into applications. Are there design patterns that would make an application more scalable? This question is mainly in the context of web applications or SOA middleware based applications.

推荐答案

当我想到大规模应用程序"时,我会想到三个非常不同的事情:

When I think about "large scale applications" I think of three very different things:

  1. 将在大型横向扩展集群(远大于 1024 个内核)中运行的应用程序.

  1. Applications that will run across a large scale-out cluster (much larger than 1024 cores).

将处理比物理内存大得多的数据集的应用程序.

Applications that will deal with data sets that are much larger than physical memory.

具有非常大的代码源库的应用程序.

Applications that have a very large source base for the code.

每种可扩展性"都会引入不同类型的复杂性,并需要一组不同的折衷方案.

Each kind of "scalability" introduces a different kind of complexity, and requires a different set of compromises.

横向扩展应用程序通常依赖于使用 MPI 来协调各种进程的库.一些应用程序是令人尴尬的并行",并且在不同进程之间需要很少(甚至不需要)通信来完成任务(例如渲染动画电影的不同帧).这种类型的应用程序往往会受到基于 CPU 时钟速率或内存带宽的性能限制.在大多数情况下,添加更多内核几乎总是会增加应用程序的可扩展性".其他应用程序需要不同进程之间的大量消息流量,以确保解决方案的进展.这种应用风格往往会受到节点之间互连的整体性能的限制.这些消息密集型应用程序可能受益于非常高的带宽、低延迟的互连(例如 InfiniBand).将可扩展性工程化到这种应用程序中,首先要尽量减少所有进程对共享文件或资源的使用.

Scale-out applications typically rely on libraries that use MPI to coordinate the various processes. Some applications are "embarrassingly parallel" and require very little (or even no) communication between the different processes in order to complete the task (e.g. rendering different frames of an animated movie). This style of application tends to be performance bound based on CPU clock rates, or memory bandwidth,. In most cases, adding more cores will almost always increase the "scalability" of the application. Other applications require a great deal of message traffic between the different processes in order to ensure progress toward a solution. this style of application will tend to be bound on the overall performance of the interconnect between nodes. These message intensive applications may benefit from a very high bandwidth, low latency interconnect (e.g. InfiniBand). Engineering scalability into this style of application begins with minimizing the use of shared files or resources by all the processes.

第二种可扩展性是在少量服务器(包括单个 SMP 风格服务器)上运行的应用程序,但它们处理非常大的数据集或非常多的事务.向系统添加物理内存通常可以增加应用程序的可扩展性.但是,在某些时候物理内存将耗尽.在大多数情况下,性能瓶颈会与系统的磁盘 I/O 的性能有关.在这些情况下,添加高性能持久存储(例如剥离的硬盘驱动器阵列),甚至向某种 SAN 添加高性能互连都有助于提高应用程序的可扩展性.为这种应用程序设计可扩展性始于算法决策,该决策将最大限度地减少重复接触相同数据(或设置相同基础架构)的需要,而不是完成任务所需的次数(例如,打开到数据库的持久连接,而不是打开每个事务的新连接).

The second style of scalability are applications that run on a small number of servers (including a single SMP style server), but that deal with a very large dataset, or a very large number of transactions. Adding physical memory to the system can often increase the scalability of the application. However, at some point physical memory will be exhausted. In most cases, the performance bottleneck will be related to the performance of the disc I/O of the system. In these cases, adding high performance persistent storage (e.g. stripped hard drive arrays), or even adding a high performance interconnect to some kind of SAN can help to increase the scalability of the application. Engineering scalability into this style of application begins with algorithmic decisions that will minimize the need to repeatedly touch the same data (or setup the same infrastructure) more than is necessary to complete the task (e.g. open a persistent connection to a database, instead of opening a new connection for each transaction).

最后,还有与源代码库的整体大小相关的可扩展性问题.在这些情况下,良好的软件工程实践有助于最大限度地减少冲突,并保持代码库干净.大规模 C++ 软件设计一书是第一本我遇到的一个真正承担了为大型源代码基础软件开发提供最佳实践的挑战.本书侧重于将 C++ 作为实现语言,但指南和实践可以应用于任何项目或语言.将可扩展性工程化到这种类型的应用程序中涉及对代码结构做出高层决策,以最大限度地减少代码库中的依赖关系(例如,不要有一个 .h,当更改时将强制重建整个代码库,使用构建将尽可能重用 .o 的系统).

Finally, there is the case of scalability related to the overall size of the source code base. In these instances, good software engineering practices can help to minimize conflicts, and to keep the code base clean. The book Large Scale C++ Software Design was the first one that I encountered that really took on the challenge of providing best practices for large source base software development. The book focuses on C++ as the implementation language, but the guidelines and practices can be applied to any project or language. Engineering scalability into this style of application involves making high level decisions about the structure of the code to minimize dependencies within the code base (e.g. do not have a single .h that when changed will force a rebuild of the entire code base, use a build system that will reuse .o's whenever possible).

这篇关于将可扩展性工程化到应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆