系統(tǒng)的可擴展性_第1頁
系統(tǒng)的可擴展性_第2頁
系統(tǒng)的可擴展性_第3頁
已閱讀5頁,還剩2頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、什么是系統(tǒng)的可擴展性?到底什么是可擴展性?這年頭,作為軟件設計架構師如果系統(tǒng)沒有可擴展性對外交流時都不好意思。但是 如何選擇可擴展性方案?水平擴展還是垂直擴展?是不是很矛盾呢,本文為你分析可擴展性的真實含義和 實際工程中的取舍。When asked what they mean by scalability, a lot of people talk about improving performa nee, about impleme nting HA, or even talk about a particular tech no logy or protocol. Unfortunate

2、ly, scalability is none of that. Don t get me wrong. Youstill n eed to know all about speed, performa nee, HA tech no logy, applicati on platform, n etwork, etc. But that is not the defi niti on of scalability.每每和別人提及可擴展性的含義時,很多人開始討論提高性能,實施高可 用性,甚至談論特定的技術或協(xié)議。顯然這些并不是可擴展性。不要誤會,您 當然需要了解關于速度,性能,可用性,應用平臺

3、,網(wǎng)絡等相關的一切,但這 并非可擴展性的定義。Scalability, simply, is about doing what you do in a bigger way. Scali ng a webapplication is all about allowing more people to use your application. If you can tfigure out how to improve performa nee while scali ng out, its okay. And as long as you can scale to han dle larger

4、 nu mber of users its ok to have multiple sin gle points of failures as well.簡單地說,可擴展性就是關于如何處理更大規(guī)模的業(yè)務。比方, Web應用程序就是允許更多的人使用你的效勞。如果你不能弄清楚如何提高性能的同時向外擴展,沒關系。只要你能處理更大規(guī)模的用戶,即使是存在多個單點故障也沒有問題。There are two key primary ways of scaling web applications which is in practice today.在今天實踐中有兩個關鍵的縮放 Web 應用程序的方式:垂直

5、擴展和水平 擴展?!?Vertical Scalability - Addi ng resource withi n the same logical un it to in creasecapacity. An example of this would be to add CPUs to an existing server, or expanding storage by adding hard drive on an existing RAID/SAN storage.垂直擴展“在同一個邏輯單位添加資源以增加容量。這樣的例子比比皆是, 比方升級效勞器的 CPU ,比方在 RAID/ S

6、AN 存儲設備上增加硬盤。“Horizontal Scalability-Adding multiple logical units of resources and makingthem work as a single unit. Most clustering solutions, distributed file systems, load-balancers help you with horizontal scalability.“橫向擴展“- 增加多個邏輯單元資源并且使他們作為一個整體在工作。大多 數(shù)的集群解決方案,比方分布式文件系統(tǒng),負載均衡都是通過橫向擴展技術來 進行的。Ev

7、ery component, whether its processors, servers, storage drives or load-balancers have some kind of management/operational overhead. When you try to scale that, its important to understand what percentage of the resource is actually usable.This measurement is called“ scalability factor “. If you loos

8、e 5% of a processorpower every time you add a CPU to your system, then your“ scalability factor is0.95. A scalability factor of 0.9 means you will only be able to use 90% of the resource.每一個部件,無論它是處理器,效勞器,存儲驅動器或負載均衡有一定的 管理上或者操作上的開銷。當您嘗試進行擴展時,很重要的一點是要了解實際 的資源利用率,這種測量方法被稱為 “可擴展性因子 “法。如果每添加一個 CPU 到系統(tǒng),都

9、會失去 5的處理器功率,那么您的可擴展性系數(shù)為 0.95 。當可擴 展系數(shù)為 0.9 時,意味著你將只能使用 90的資源。Scalability can be further sub-classified based on the“scalability factor .以 “可擴展性因子 “為根底,可擴展性可以進一步細化分類。If the scalability factor stays constant as you scale. This is called“ linear scalabilitya如果你的可擴展性系數(shù)保持不變,這就是所謂的 “線性的可擴展性 “。But chances

10、are that some components may not scale as well as others. A scalability factor below 1.0 is calleub-linear scalability“ .但某些組件有可能無法像別人一樣可以擴展,該系數(shù)低于 1.0 的就是所謂分線性可擴展性。Though rare, its possible to get better performance (scalability factor) just byadding more components (i/o across multiple disk spindle

11、s in a RAID gets better with more spindles). This is called“ supra-linear scalability “ .雖然數(shù)量很少,但是參加更多的組件確實可能會獲得更好的性能(或者可 伸縮性因子)(跨越多個磁盤的 RAID I / O 性能確實會更好)。這就是所謂的 “超線性的可擴展性。 “If the application is not designed for scalability, its possible that things can actually get worse as it scales. This is ca

12、lled“negative scalability “ .如果應用程序沒有可擴展性,當對其進行擴展時,得到了更加糟糕的結果。 這就是所謂的 “負可擴展性 “。If you need scalability, urgently, going vertical is probably going to be the easiest (provided you have the bank balance to go with it). In most cases, without a line of code change, you might be able to drop in your app

13、lication on a super- expensive 64 CPU server from Sun or HP and storage from EMC, Hitachi or Netapp and everything will be fine. For a while at least. Unfortunately Vertical scaling, gets more and more expensive as you grow.如果您迫切需要可擴展性,垂直擴展可能是最容易的(只要你有足夠的銀 行存款余額)。在大多數(shù)情況下,只要能砸一個超級昂貴的 64個來自 Sun 或 HP C

14、PU 效勞器和來自 EMC ,NetApp 和日立的存儲設備,不用改變一行代碼,一切都OK,至少可以抗一段時間。不幸的是伴隨您的成長,垂直擴展會變得越來越貴。Horizontal scalability, on the other hand doesn t require you to buy more andmore expensive servers. Its meant to be scaled using commodity storage and server solutions. But Horizontal scalability isn t cheap either. The

15、application hasto be built ground up to run on multiple servers as a single application. Two interesting problems which most application in a horizontally scalable world have to worry about are “ Split brain and “ hardware failure “ .另一方面,橫向擴展并不要求你購置更多昂貴的效勞器,這意味著應用普 通的存儲和效勞器作為解決方案。但是,橫向擴展也不廉價,因為它需要應

16、用 程序進行重新設計,以運行在多個效勞器之上,但是對外要表現(xiàn)為一個單一的 應用程序。這其中不得不思考兩個有趣的問題: “腦裂“和硬件故障 “。 While infinite horizontal linear scalability is difficult to achieve, infinite vertical scalability is impossible. If you are building capacity for a pre-determined number of users, it might be wise to investigate vertical scala

17、bility. But if you are building a web application which could be used by millions, going vertical could be an expensive mistake.雖然無限的水平線性可擴展性是難以實現(xiàn)的,無限的垂直擴展性也是不可能的。如果你正在構建一個根本預先可以確定用戶數(shù)量的系統(tǒng),調查和應用垂 直擴擴展可能是明智的選擇。但是,如果你正在建設一個可用于數(shù)百萬用戶的 Web 應用程序,垂直擴展可能要付出昂貴的代價。But scalability is not just about CPU (process

18、ing power). For a successful scalable web application, all layers have to scale in equally. Which includes the storage layer(Clustered file systems, s3,etc), the database layer (partitioning,federation), application layer(memcached,scaleout,terracota,tomcat clustering,etc), the web layer, loadbalanc

19、er , firewall, etc. For example if you don t have a way toimplement multiple load balancers to handle your future web traffic load, it doesn t really matter how much money and effort you put into horizontal scalability of the web layer. Your traffic will be limited to only what your load balancer can push

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論