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

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、什么是系統(tǒng)的可擴(kuò)展性?到底什么是可擴(kuò)展性?這年頭,作為軟件設(shè)計(jì)架構(gòu)師如果系統(tǒng)沒有可擴(kuò)展性對外交流時(shí)都不好意思。但是 如何選擇可擴(kuò)展性方案?水平擴(kuò)展還是垂直擴(kuò)展?是不是很矛盾呢,本文為你分析可擴(kuò)展性的真實(shí)含義和 實(shí)際工程中的取舍。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.每每和別人提及可擴(kuò)展性的含義時(shí),很多人開始討論提高性能,實(shí)施高可 用性,甚至談?wù)撎囟ǖ募夹g(shù)或協(xié)議。顯然這些并不是可擴(kuò)展性。不要誤會,您 當(dāng)然需要了解關(guān)于速度,性能,可用性,應(yīng)用平臺

3、,網(wǎng)絡(luò)等相關(guān)的一切,但這 并非可擴(kuò)展性的定義。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.簡單地說,可擴(kuò)展性就是關(guān)于如何處理更大規(guī)模的業(yè)務(wù)。比方, Web應(yīng)用程序就是允許更多的人使用你的效勞。如果你不能弄清楚如何提高性能的同時(shí)向外擴(kuò)展,沒關(guān)系。只要你能處理更大規(guī)模的用戶,即使是存在多個(gè)單點(diǎn)故障也沒有問題。There are two key primary ways of scaling web applications which is in practice today.在今天實(shí)踐中有兩個(gè)關(guān)鍵的縮放 Web 應(yīng)用程序的方式:垂直

5、擴(kuò)展和水平 擴(kuò)展。“ 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.垂直擴(kuò)展“在同一個(gè)邏輯單位添加資源以增加容量。這樣的例子比比皆是, 比方升級效勞器的 CPU ,比方在 RAID/ S

6、AN 存儲設(shè)備上增加硬盤?!癏orizontal 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.“橫向擴(kuò)展“- 增加多個(gè)邏輯單元資源并且使他們作為一個(gè)整體在工作。大多 數(shù)的集群解決方案,比方分布式文件系統(tǒng),負(fù)載均衡都是通過橫向擴(kuò)展技術(shù)來 進(jìn)行的。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.每一個(gè)部件,無論它是處理器,效勞器,存儲驅(qū)動器或負(fù)載均衡有一定的 管理上或者操作上的開銷。當(dāng)您嘗試進(jìn)行擴(kuò)展時(shí),很重要的一點(diǎn)是要了解實(shí)際 的資源利用率,這種測量方法被稱為 “可擴(kuò)展性因子 “法。如果每添加一個(gè) CPU 到系統(tǒng),都

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

10、are that some components may not scale as well as others. A scalability factor below 1.0 is calleub-linear scalability“ .但某些組件有可能無法像別人一樣可以擴(kuò)展,該系數(shù)低于 1.0 的就是所謂分線性可擴(kuò)展性。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ù)量很少,但是參加更多的組件確實(shí)可能會獲得更好的性能(或者可 伸縮性因子)(跨越多個(gè)磁盤的 RAID I / O 性能確實(shí)會更好)。這就是所謂的 “超線性的可擴(kuò)展性。 “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 “ .如果應(yīng)用程序沒有可擴(kuò)展性,當(dāng)對其進(jìn)行擴(kuò)展時(shí),得到了更加糟糕的結(jié)果。 這就是所謂的 “負(fù)可擴(kuò)展性 “。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.如果您迫切需要可擴(kuò)展性,垂直擴(kuò)展可能是最容易的(只要你有足夠的銀 行存款余額)。在大多數(shù)情況下,只要能砸一個(gè)超級昂貴的 64個(gè)來自 Sun 或 HP C

14、PU 效勞器和來自 EMC ,NetApp 和日立的存儲設(shè)備,不用改變一行代碼,一切都OK,至少可以抗一段時(shí)間。不幸的是伴隨您的成長,垂直擴(kuò)展會變得越來越貴。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 “ .另一方面,橫向擴(kuò)展并不要求你購置更多昂貴的效勞器,這意味著應(yīng)用普 通的存儲和效勞器作為解決方案。但是,橫向擴(kuò)展也不廉價(jià),因?yàn)樗枰獞?yīng)

16、用 程序進(jìn)行重新設(shè)計(jì),以運(yùn)行在多個(gè)效勞器之上,但是對外要表現(xiàn)為一個(gè)單一的 應(yīng)用程序。這其中不得不思考兩個(gè)有趣的問題: “腦裂“和硬件故障 “。 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.雖然無限的水平線性可擴(kuò)展性是難以實(shí)現(xiàn)的,無限的垂直擴(kuò)展性也是不可能的。如果你正在構(gòu)建一個(gè)根本預(yù)先可以確定用戶數(shù)量的系統(tǒng),調(diào)查和應(yīng)用垂 直擴(kuò)擴(kuò)展可能是明智的選擇。但是,如果你正在建設(shè)一個(gè)可用于數(shù)百萬用戶的 Web 應(yīng)用程序,垂直擴(kuò)展可能要付出昂貴的代價(jià)。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)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論