• 沒有找到結果。

以任務分配解決即時金融服務中突發流量及網路不穩定問題 - 政大學術集成

N/A
N/A
Protected

Academic year: 2021

Share "以任務分配解決即時金融服務中突發流量及網路不穩定問題 - 政大學術集成"

Copied!
63
0
0

加載中.... (立即查看全文)

全文

(1)國立政治大學資訊科學系 Department of Computer Science National Chengchi University 碩士論文 Master’s Thesis. 以任務分配解決即時金融服務中 突發流量及網路不穩定問題 Task Assignment for Real-time Financial Service System under Bursty Traffic and Unstable Networks. 研 究 生:陳泰銘 指導教授:蔡子傑. 中華民國一零五年一月 January 2016.

(2) 以任務分配解決即時金融服務中 突發流量及網路不穩定問題 Task Assignment for Real-time Financial Service System under Bursty Traffic and Unstable Networks 研 究 生:陳泰銘. Student:Tai-Ming Chen. 指導教授:蔡子傑. Advisor:Tzu-Chieh Tsai. 國立政治大學 資訊科學系 碩士論文. A Thesis submitted to Department of Computer Science National Chengchi University in partial fulfillment of the Requirements for the degree of Master in Computer Science. 中華民國一零五年一月 January 2016.

(3)

(4)

(5) 以任務分配解決即時金融服務中突發流量及網路不穩定問題. 摘要 最近,金融科技(FinTech)和行動金融服務,吸引越來越多的目光。 新的創新金融科技服務,改變了金融服務的消費行為。行動網路的發 展使人們能夠隨時隨地的享受行動銀行的服務已經是個不爭的事實。 然而,由於無線網路先天的特性以及行動裝置的移動性,使行動金融 的服務品質受到網路不穩定的影響。而且,隨著 Bank 3.0 時代的來 臨,將會有大量的使用者同時使用行動金融服務,特別是在股市開盤 以及重大訊息揭露的時候。因著大量使用者瞬間湧入,以及無線網路 不穩定的影響,交易系統的效能很可能會時好時壞,所以無法滿足即 時金融市場的需求。 本論文中,我們提出「行動銀行訊息即服務」的框架,使系統能 夠很容易的水平擴充,並且能夠輕易的實現雙向通訊和雙向交易等多 項行動金融服務。為了達到最少成本追求最大利益的目的,我們發展 了能夠適應突發流量以及網路不穩定性的任務分配演算法,使得不用 增加額外硬體成本的前提下改善系統效能。然後,為了實驗欲模擬大 量行動裝置的使用者,我們觀察真實網路的特性並發明了網路延遲自 相關模型來驗證我們提出的任務分配演算法。結果顯示,透過此任務 分配演算法,確實能夠有效改善系統資源管理的能力。最後,本研究 將系統佈署於真實網路環境當中,並且發現進行同樣實驗的結果與採 用網路延遲自相關模型的實驗結果一致。因此,本研究間接驗證了網 路自相關模型的正確性,以及證明本任務分配演算法,在突發流量和 網路不穩定的即時行動金融服務環境下,能有效降低系統響應時間。 關鍵字:任務分配、負載平衡、突發流量、網路不穩定、網路延遲 自相關模型、排隊理論、金融 3.0 i.

(6) Task Assignment for Real-time Financial Service System under Bursty Traffic and Unstable Networks Abstract FinTech (financial technology) and mobile financial services are getting more and more attention recently. New innovative FinTech services change the consumption behavior for financial services. It is an indisputable fact development of the mobile Internet allows people to enjoy mobile banking everywhere and anytime. However, due to the nature of wireless networking and the mobility of the mobile device, the quality of mobile financial service will be affected by network instability. Moreover, with the coming of Bank 3.0, a huge amount of users would be in the mobile service of finance simultaneously, especially when the instances of the stock market opening or disclosure of highly important financial message. As the result of bursty traffic and network instability, the performance of transaction system is up and down, making it tough to satisfy the demand of real-time financial markets. In this thesis, we propose a “Mobile Banking Messaging as a Service Framework” that can easily scale out and fulfill functions comprising Bilateral Communication, Bilateral Trading, and many other mobile financial services. To pursuit of the greatest benefit along with investment of the least resources, we develop the task assignment algorithm which can adapt the system to bursty traffic and unstable networks to improve performance for free. Then, in order to simulate a large number of mobile users, we observe the characteristic of real-world network delay and propose a network delay autocorrelation model to verify our task assignment algorithm. The results of experiment show that we could actually use our task assignment algorithm to improve the ability of the system to manage resource. Finally, we deploy our system in a realworld network delay environment and find that the results obtained in the real condition are the same with our simulation results. Therefore, this research can indirectly verify the correctness of the network delay autocorrelation model, and prove that our task assignment algorithm can effectively reduce the system response time for real-time mobile financial service system under bursty traffic and unstable networks. Keywords:Task Assignment, Load Balance, Bursty Traffic, Network Instability, Network Delay Autocorrelation Model, Queuing Theory, Bank 3.0. ii.

(7) 致謝辭 我的人生導師 鄭明析先生教導過一句話「人生最大的成功就是瞭解自己該 如何過生活,以及按照所瞭解的去行動。」我體會到,就像是對於自己的研究無 知而無法得到正確的結果一樣,對於自己的人生無知、對於自己的內心和靈魂無 知,無法瞭解的來度過正確的人生,會遭受沒有必要的損害,這有多麼冤枉呢? 能夠遇到可以引導自己人生一位,讓自己面對未來不會迷惘和徬徨,我覺得自己 真的非常的幸運和幸福,我真心的向他獻上感謝! 當自己做研究遇到瓶頸,很無助又還沒吃飯的時候,雖然沒有辦法幫忙研究 的部分,但至少能夠給自己一頓飯吃,也會覺得很感激,因此我真心的感謝養育 我的父母。其實自己並不瞭解如何做研究,但是如果有人願意包容我的無知和不 足,願意給我無數的機會嘗試,不厭其煩的給予我方向和建議,即使看著我做出 來的東西不怎麼樣、問的問題不怎麼樣,也沒有嫌棄和放棄我,而是跟我一起走 到研究的最後一刻,真的要向他獻上感激感謝,因此我很感謝我的指導教授蔡子 傑老師,從第一天到實驗室起至結束,我真的沒有後悔,來愈久就愈覺得來對了, 雖然要做的事情很多,但是蔡老師願意將事情交給沒有經驗的我,而且在每一個 細節上面都很有耐心的指導,因此不論在思考問題方面、做研究的態度,我都透 過他的行為學習很多,這些部分讓我能在一輩子當中受用,我真的很感謝老師。 另外也謝謝口試委員周承復老師、吳曉光老師、陳伶志老師以及江清泉老師撥冗 指導,能夠得到在網路通訊學術領域上,最為專精之傑出教授們的建議,覺得是 很難得的機會以及榮幸,教授們一針見血的提問和建議,幫助我看見自己的盲點, 讓研究能變得更完善,真心的感謝。 在做研究的過程中,真的讓我體會到很多深刻的人生道理和做事的方法。雖 然自認為自己的論文並不是什麼創世巨作,但是跟創世巨作相同的是,都是由無 數個疲憊、孤單又無助的夜晚、無數個日光燈代替陽光和月光,卻沒有人能夠體 諒和理解的日子、無數個想放棄又不能放棄、想死又不能死的掙扎,所累積出來 iii.

(8) 的作品,因此在自己看來仍像創世巨作那樣的珍惜又寶貴。人在遇到人生當中很 辛苦和困難的事時想要尋找幫助與安慰是人之常情,但是真正能幫助自己解決人 生問題的是誰呢?自己最辛苦卻說不出來的時候,令人最受傷而最不想聽到的話 之一就是「你可以畢業了嗎?」其實十年寒窗無人問並不是真的沒有人問,我覺 得是沒有人能夠瞭解自己的內心。我認為得到別人的幫助,向他獻上感謝是身而 為人的基本。比起不經意的關心,如果有人能夠在自己內心倒下的時候,幫助自 己堅持下去、重新再站起來,不論他的國籍、不論是哪個宗教、不論他是不是被 別人認定和接納,都應該要向他獻上感謝。人是除了肉體以外,也擁有內心、精 神和靈魂的存在,在文明與科技發達的時代中,滿足肉體需求已經不是很困難的 事,然而誰能夠解開我們受到綑綁的內心呢?阿摩司書說「人飢餓非因無餅,乾 渴非因無水,乃因不聽耶和華的話」因此我想再次向 鄭明析老師以及透過他教 導話語的 神、聖靈及聖子獻上真摯的感謝,因為在我認為沒有人能夠倚靠和幫 助我的時候,是祂們透過話語給予我堅持下去的希望和力量。 鄭明析老師一生 犧牲奉獻,致力於教導內心的造就與靈魂的救援,一般人在遇到辛苦、被人逼迫、 被信任的人背叛、威脅、蒙冤和受到各種莫須有的污名和毀謗的時候,都會向 神 哭訴並請 神幫助,然而 鄭明析老師在這樣的狀況下,卻在能看透內心的 神面 前真心的告白「我很幸福」,過去我真的無法理解,覺得可能只是自我安慰吧! 然而在自己經歷過一次之後才體會,肉體的問題,要透過物質來解決,內心和靈 魂的問題,則要透過神的真理話語來解決,因此最後,想要透過 鄭明析老師寫 下來的詩所編成的歌曲來期許自己,並向 神獻上告白:. 雖然人們談論到我 都說我是很不幸的人 才不是!其實我是很幸福的人 不管我再怎麼想,我都還是覺得 真的!我是很幸福的人 再怎麼看這個人、再怎麼看那個人 他們並不幸福. 所謂幸福必須要永遠幸福 那才是真幸福 主啊!我很幸福吧? 於是我主對我說 你是瞭解到幸福而活的人 你是很幸福的人. iv.

(9) TABLE OF CONTENT CHAPTER 1 Introduction.............................................................................................. 1 1.1 Background ...................................................................................................... 1 1.2 Motivation ........................................................................................................ 4 1.3 Problem Definition and Our Goal .................................................................... 4 1.3.1 Load Balance ........................................................................................ 6 1.3.2 Bursty traffic ......................................................................................... 7 1.3.3 Network Instability ............................................................................... 7 1.4 Organization ..................................................................................................... 8 CHAPTER 2 Related Work ........................................................................................... 9 2.1 Risk Diversified Schemes ................................................................................ 9 2.1.1 Round Robin Based Schemes ............................................................. 10 2.1.2 Opportunity Based Schemes ............................................................... 10 2.2 Least-Number Based Schemes ...................................................................... 11 2.2.1 Least Connection First (LCF) ............................................................. 11 2.2.2 Shortest Queue First (SQF) ................................................................. 11 2.3 Job-Size Based Schemes ................................................................................ 12 2.3.1 Shortest Job First................................................................................. 12 2.3.2 Min-Min .............................................................................................. 12 2.3.3 Max-Min ............................................................................................. 12 2.4 Consumption Fast First Strategies ................................................................. 13 2.4.1 Flow Control Principle ........................................................................ 13 2.4.2 M/M/1 ................................................................................................. 13 2.5 Summary of Related Work ............................................................................. 14 CHAPTER 3 Mobile Banking Messaging as a Service Framework ........................... 15 3.3 Mobile Banking Messaging as a Service Framework (MBMaaS) ................ 15 CHAPTER 4 Network Delay Autocorrelation Model ................................................. 17 4.1 Hypothesis...................................................................................................... 17 4.2 Autocorrelation .............................................................................................. 18 4.3 Network Delay Autocorrelation Model ......................................................... 19 4.4 Result of the Network Delay Autocorrelation Model .................................... 23 4.4 Autocorrelation Coefficient............................................................................ 25 CHAPTER 5 Research Method ................................................................................... 26 5.1 Pre-study ........................................................................................................ 26 5.2 Method Applied in the Research .................................................................... 28 5.2.1 See the Future Network Delay (SeeFuND) Task Assignment v.

(10) Algorithm ..................................................................................................... 31 5.2.2 Incubation Period Phenomenon .......................................................... 32 5.2.3 Foresight-SeeFuND Task Assignment Algorithm............................... 33 CHAPTER 6 Simulation and Emulation ..................................................................... 34 6.1 Simulation Environment Setup ...................................................................... 34 6.1.1 Response Time with Different Network Correlation .......................... 35 6.1.2 Response Time with Different Loading .............................................. 38 6.1.3 Response Time with Bursty Traffic .................................................... 41 6.2 Emulation Environment Setup ....................................................................... 43 6.2.1 Effectiveness Evaluation ..................................................................... 44 CHAPTER 7 Conclusions and Future Work................................................................ 46 REFERENCE ............................................................................................................... 48. vi.

(11) LIST OF FIGURE Figure 1. System Architecture and the Problem Description .......................................... 5 Figure 2. Mobile Banking Messaging as a Service Framework .................................... 16 Figure 3. Time Series of Real-world Network Delay .................................................... 17 Figure 4. Interval between the Sending of Two Messages ............................................ 20 Figure 5. Functions that Decide the Most Possible Weight ........................................... 21 Figure 6. The Function that Decide the Final Weight ................................................... 22 Figure 7. Using Most Possible Weight Functions to Generate the Corresponding Functions that Decide the Final Weight ......................................................... 22 Figure 8. Network Delay with c=300 When Average 𝞽=10 .......................................... 23 Figure 9. Network Delay with c=100 When Average 𝞽=10 .......................................... 23 Figure 10. Network Delay with c=50 When Average 𝞽=10 .......................................... 24 Figure 11. Network Delay with c=10 When Average 𝞽=10 .......................................... 24 Figure 12. Network Delay with c=1 When Average 𝞽=10 ............................................ 24 Figure 13. Autocorrelation Coefficient of Network Delay Time Series Which are Produced by Six Models Where c = 100~ 600. ............................................. 25 Figure 14. Architecture of Pre-study ............................................................................. 26 Figure 15. Experiment Result of Pre-Study .................................................................. 27 Figure 16. The Impact of Network Delay ..................................................................... 27 Figure 17. Network Delay is Seen as Service Time ...................................................... 29 Figure 18. Other Existing Users Would Cut-in in Front of the Incoming Message ...... 31 Figure 19. Incubation Period Phenomenon ................................................................... 32 Figure 20. Architecture of Experiment .......................................................................... 34 Figure 21. Response Time with Different Network Delay Autocorrelation (a) ............ 36 Figure 22. Response Time with Different Network Delay Autocorrelation (b)............ 38 Figure 23. Response Time with Different Loading (C100) ........................................... 39 Figure 24. Response Time with Different Loading (C300) ........................................... 40 Figure 25. Bursty Traffic Simulation Scenarios ............................................................ 41 Figure 26. The Response Time of Different Task Assignment Algorithm in Different Intensities of Bursty Traffic ........................................................................... 41 Figure 27. Time Series of Response Time for Each Cm Queue of Different Task Assignment Algorithm................................................................................... 42 Figure 28. Architecture of Experiment that User Robots are Deployed in Different Datacenter Region among Several Countries ................................................ 43 Figure 29. Response Time with Different Loading in Real World Network ................. 45 vii.

(12) LIST OF TABLE Table 1. Symbols of Network Delay Autocorrelation Model ...................................... 19 Table 2. The Experimental Parameter of the two Set .................................................. 26 Table 3. Symbols of Queuing Model........................................................................... 30. viii.

(13) CHAPTER 1 Introduction. 1.1 Background “Banking is no longer a place you go, but something you do”, said Brett King, author of Bank 3.0, who is known as the father of banking innovation [1]. In 2014, MingTzung Tzeng, the chairman of Taiwan Financial Supervisory Commission (FSC), announced the launch of the domestic financial Bank 3.0 Digital Development Plan [2] [3]. Digital technology such as mobile device, virtual community, Big Data, and Cloud Computing, has made mobile payment, P2P payment, third-party payment, and O2O cash flow flourish. The rise of mobile Internet in new economic environment brings both opportunities and challenges for the sustainable development of commercial banks. According to the survey of Taiwan Network Information Center (TWNIC), the number of mobile Internet users in Taiwan has raised from 2.66 million to 5.35 million during 2011 to 2012. Shipments of smart phone all over the world are up to 713 million in 2010 which indicates that the generation of mobile life is coming [4]. Mobile technology releases the time-and-space restriction of PC-based Internet and traditional finance. In addition, it is efficient in improving the financial services’ coverage, availability and convenience, which provides people such services whenever and wherever they need one [5]. This implies the indisputable fact that the range of banking service has extended everywhere either in the office or at home as long as the access to Internet is available. Development of the Internet has raised online trading [6]. Nowadays trading 1.

(14) futures is without borders, and in terms of transactions, every minute counts. Numerous large domestic futures traders spend a great deal of money upgrading IT systems and equipment such as powerful trading platform structure and network transmission speed to enhance the competitiveness and to seize business opportunities in the global trading futures market. Some large futures commission merchants indicate that futures trading is a kind of service providing IT electronic transactions. If the futures service providers cannot provide faster, more stable and competitive IT services, they would be eliminated from futures market gradually [7]. Yuanta Securities Co., Ltd., the leading company of domestic futures in Taiwan, said that the futures trading is round-the-clock, across various exchanges around the world and with diverse subjects of transaction such as Index, raw materials, precious metals, and so on. Because futures orders is round-o'clock and more than 90% of its trading is carried out under the electronic trading system, construction of the IT system designed for futures is quite important. Each futures commission merchant has its own trading platform. If the order speed is not fast enough, trading information cannot be confirmed and returned immediately after asking for the order. What’s worse, the system could be blocked by the amount of requests, and it will reduce customers’ willingness of placing orders. Futures order adopts the term that advances money on security, meaning only a slight mistake can cause the actual loss of deals in huge amount that is hard to estimate [8]. In terms of the securities market, to build a capital market with more efficient operation and faster trading, FSC plans to shorten the length of matching cycle by three times in the format of second when bidding price in the intraday auction. On December, 29th, 2014, matching cycle in intraday auction was shortened to 5 seconds. Besides, frequency of revealing front-index, turnover and commissioned Statistics information was adjusted to 5 seconds [9]. Reviewing the world's major stock markets such as New 2.

(15) York, London, Germany, Tokyo, Hong Kong, Singapore, Korea and Shanghai, they all adopt continuous market method in intraday auction. In order to bring Taiwan into the international market in the future, continuous market method is an inevitable trend. In the past, either matching of call auction or revelation of course of exchange functions every 20 seconds in Taiwan stock market. In other words, from 9:00 to 13:30, only 797 transactions were revealed originally. However, now all stocks matching must be completed within 5 seconds so that the revelation of 3,181 transactions is expected. In other words, trading volume has increased four times. If the continuous market method is taken in the future, principal trading volume will be expected to grow 7-10 times [10]. In the case of commodity warrants, after switching to individually match warrants goods in 2010, the original transaction platform is overloading obviously. Building the next-generation transaction platform is necessary for continuous market method. Nai-Kuan Huang, deputy general manager of Taiwan Stock Exchange, said that to do individually match, Stock Exchange inevitably has to re-create a new generation of securities trading platform. Besides ensuring the delivery of transaction information is efficient, the standard of the platform is met and the transaction is completed only when there is no delay and the transmission is fast enough. Furthermore, what really matters in the facet of operation of Trading in the stock exchange is cloud computing. Several personal and people-related services in the company such as video cloud platform for investor conference have been transferred to the cloud computing platform, said Nai-Kuan Huang. Huang also indicated that open and transparent information is the most important thing for the stock market. If any information of listed company is announced or revealed through the video cloud platform of investor conference, then subscribers can be notified on their computer or mobile device. In the beginning of 2013, live broadcast press conferences were played 3.

(16) on the platform such as food scandals of Ting Hsin International Group press conference with more than 10,000 people watching it online. Another instance was Kaohsiung gas explosions, and nearly 20,000 people watched the live press conference at the same time. "Such explosive amount of online flow can only be overcome through the elastic cloud service," said Huang.. 1.2 Motivation Bank 3.0 is an inevitable trend, and the mobile financial service will be provided to a huge amount of users, especially when there are instances of the stock market opening or disclosure of highly important financial message. As a result, this leads to the bursty traffic due to a high flow of financial messages in a short time. Wireless and mobile networks are, however, less stable than the wired networks. Without appropriate resource management to deal with the instability of the network, the performance of transaction system is up and down, making it hard to meet the demand of real-time financial service in such a dynamic financial market. There are many commercial messaging services. For example, Google Cloud Messaging [11], Apple Push Notification Service [12], Parse for push notifications [13], Line [14], and WhatsApp [15] for real time instant messaging. On August, 12th, 2014, Japan's SBI Securities announced that retail investors could check stock prices and trading through Line [16]. But it is doubtful whether the current commercial software is always available in the bursty traffic and unstable network. On the other hand, in consideration of data security and customization, this is an essential issue for banks whether an independent enterprise system is under their plans of future implementation.. 1.3 Problem Definition and Our Goal Take Financial Instant Messaging as an example, our framework could be built on the 4.

(17) top of a proven open source project, the Openfire [17], with Connection Managers [18] that can be horizontally scaled to meet increasing demands, as shown in Figure 1. The Openfire Server is the main XMPP server, handling messaging tasks and logging messages into database. The system can be horizontally scaled by adding more Connection Managers, denoted as CM. The Connection Managers multiplex users’ connections to the Openfire Server. Each Connection Manager deals with about 5000 users. Users connect to the Load Balancer, denoted as LB, which will select an appropriate Connection Manager to build the keep-alive connection with the user for messaging.. Figure 1. System Architecture and the Problem Description. Our goal is to ensure a stable and efficient performance of real-time financial services system with the limited resources even though facing sudden explosion of immense financial information under the bursty traffic and unstable network. Thus, there are some challenging issues we have to discuss. 5.

(18) 1.3.1 Load Balance After the keep-alive connection between the user and the Connection Manager is built, the task sent to the receiver will go through the same connection path until the user is offline. Because each CM queue is a FCFS single queue, the tasks have to be queued in the Connection Manager when sent to the receiver until the previous tasks are all successfully delivered. Therefore, how the LB selects the Connection Manager to build the connection with the users would greatly affect the performance of the system. When facing a huge amount of incoming user in a short time, applying multiple CMs with load balancing instead of a single CM may increase reliability, availability and performance through redundancy and helps optimize resource use, maximize throughput, minimize response time, and avoid overload of any single resource. Production and management of enterprise aims to maximize profits and minimize costs. However, applying multiple components without resource management cannot avoid the excessive concentration and waste of resources. Thus, how to use the least resources to achieve the greatest benefits is a critical issue.. 6.

(19) 1.3.2 Bursty traffic The mobile financial service would be offered to a huge amount of incoming users simultaneously, especially when there is a stock market opening or disclosure of highly important financial message. Thus, in order to notify the users, there will be a lot of messages bursting in a short time. Moreover, each customer has different flow and different time of connection use. When the needs of services burst in a short time, workload will become more non-uniform and more unpredictable. Therefore, the flow control policy for general situation would fail. In the time-sensitive financial markets, efficiency and stability of the system is the key to deciding users’ profits. 1.3.3 Network Instability The users’ mobility and the limits of mobile network bandwidth may cause periodical disconnection. Also, it is hard to analyze the network conditions of millions of customers individually. Because of unpredictable network status and difficulty in detecting and assessing the network condition of each user in advance, an earlier and appropriate adjustment for users would not be practical. To overcome the constraint of mobile devices’ connectivity to the Internet, asynchronous communication protocol is required when we designing the whole system.. 7.

(20) 1.4 Organization The rest of this thesis is organized as follows. Chapter 2 introduces related works in common scheduling and task assignment algorithm. In Chapter 3, we propose a mobile banking messaging frameworks which can easily fulfill functions, including Instant Messaging, Instant Computing and Dissemination of Major Information, Bilateral Communication, Bilateral Trading, and many other mobile financial services. In Chapter 4, we observe the characteristic of real-world network delay and propose a network delay autocorrelation model to verify our task assignment algorithm. In Chapter 5, we have an experiment to find the bottleneck of the system and then propose our task assignment algorithm. In Chapter 6, we take some simulation and emulation to verify the network delay autocorrelation model and our task assignment algorithm. Finally, the conclusions and future work are presented in Chapter 7.. 8.

(21) CHAPTER 2 Related Work. To satisfy the demand for mobile financial service, it is important to overcome bursty traffic and network instability. Especially in financial industry, the pursuit of the greatest benefit is always along with investment of the least resources. Scheduling can be thought of as improving performance for free. Therefore, an appropriate scheduling policy is selected to achieve better efficiency and stability of the network, and mean response time is vastly reduced without requiring the purchase of faster machines. In this thesis, some common scheduling policies are discussed and the feasibility in the time-sensitive financial markets is analyzed.. 2.1 Risk Diversified Schemes The most intuitive and simplest method is diversification of risk based schemes. The simplest example of diversification is provided by the proverb "Don't put all your eggs in one basket". This method allocates loading of work evenly to each host so that a single and specific host won’t face overloading. Methods based on this scheme include Round Robin Based Schemes, Random Based Schemes and so forth.. 9.

(22) 2.1.1 Round Robin Based Schemes. 2.1.1.1 Round Robin (RR) Round Robin (RR) [19][20][21]means each host is selected in a round robin order. 2.1.1.2 Weighted Round Robin (WRR) Weighted Round-Robin [22] is modified from Round-Robin. WRR determines the number of jobs for each server depending on the weight. More algorithms of Weighted Round Robin Based Schemes are derived from the different patterns of calculating weights. These kinds of algorithms should have the best mean response time if the servers’ performance or the workload is uniform. However, if each server has different and changing capacity, the use of the round-robin based schemes system means that a less powerful server or the heaviest load server receives the next inquiry even though it has not yet been able to process the current one. 2.1.2 Opportunity Based Schemes. 2.1.2.1 Random Random [23][24] means that each host has the same probability of being selected. 2.1.2.2 Weighted Random Weighted Random scheduling algorithm [25] is modified from Random. According to different weights, we can determine the probability of each server. Weight of each queue is determined by the computing ability of corresponding server. 10.

(23) The aim of Opportunity Based algorithm is to equalize each server’s expected probability of being selected. Opportunity Based algorithm is oblivious to the change in the state of the system, so it will face the same problem with Round-robin when the servers have different and changing capacities.. 2.2 Least-Number Based Schemes Load balance is achieved by evaluating loading through calculating quantity of users’ connection and queue length (number of jobs). Some of these algorithms are Least Connection First, Shortest Queue First and so on. 2.2.1 Least Connection First (LCF) Least Connection First (Least User First)[26] ensures that the server that is currently servicing the least number of connections is allocated the next service request that is directed at the load balanced server farm. LCF is one of the dynamic scheduling algorithms because it needs to count the number of connections for each server dynamically to estimate its load. Round-robin could not recognize how many connections are maintained over a given time. This potential problem can be avoided with the least-connection-first algorithm. Least connection queue is not necessarily the lightest load queue when the load is not the same for each connection. The least-connection-first algorithm cannot get load well balanced among servers with various processing capacities. 2.2.2 Shortest Queue First (SQF) Assigning priorities is as a function of the number of jobs[27]. This algorithm tries to equalize the instantaneous number of jobs at each server whereas Round-robin balances the expected workload of the system. The advantage of Shortest-Queue-First algorithm 11.

(24) is that it can react quickly as soon as the queue length of each host becomes imbalanced. The shortest queue is not necessarily the fastest consumption rate queue when job size variability is high. In this situation, queues can become empty or explode very suddenly.. 2.3 Job-Size Based Schemes To achieve the lowest possible response time, allocation of job is conducted according to job size or computing time of job. 2.3.1 Shortest Job First Assigning priorities is as a function of the job size [28][29]. That is, each job goes to the queue where it will achieve possibly the lowest response time. This is an ambitious policy because each job is acting in its own best interest. Unlike some of the above algorithms that aim to equalize the probability of being selected of each host, the Shortest-Job-First algorithm focuses on equalizing the total work at each host. 2.3.2 Min-Min The host that has the minimum completion time for all jobs is selected[30][31]. Then the job with the minimum completion time overall is selected and mapped to that resource. 2.3.3 Max-Min Max-Min[32] is similar to Min-Min algorithm. The job with the maximum completion time as a whole is assigned to the host which has the minimum completion time. Both Min-Min algorithm and Max-Min algorithm are good way to balance the load of server farm when it is available to estimate the completion time of each job. 12.

(25) These are ambitious policies because each job is acting in its own best interest. The disadvantage of such algorithm is that it will cause starvation. Furthermore, like Shortest-Job-First algorithm, they fail to function when the completion time or the time of each connection used is unpredictable. Unfortunately, in the real world, it is hard to predict the job size and the time of each connection used before delivering.. 2.4 Consumption Fast First Strategies Load balancing judgment is according to the consumption rate of the queues. 2.4.1 Flow Control Principle Priority of scheduling is received by monitoring consumption rate of queue on each server[33]. 2.4.2 M/M/1 Suppose arriving time of job is Poisson process and service time is exponentially distributed. Response time of each job is predicted by M/M/1 queuing model [34][35] in queuing theory, and server with the shortest response time is selected. In Flow Control Principle, each job is assumed the same in scale, while service time is assumed exponentially distributed in M/M/1. Hence, the prediction is imprecise when the scale of job is very high and there is a wide variety of service times.. 13.

(26) 2.5 Summary of Related Work It is not easy to balance the load of each server considering the bursty traffic and network instability. Constrained by the unpredictable mobile network bandwidth, SJF, Min-Min, Max-Min, and algorithms that require the completion time to function do not correspond to what this research expects to get. Because of users’ mobility, transmission speed of mobile network might be fast or slow. Therefore, transmission time for each job would not be known in advance. On the other hand, the loading of each connection is unknown as well because there is no evidence to show where the heavy user is. When using Shortest-Queue-First algorithm, it may produce a shortest queue that has the longest waiting time. When it comes to Lest-Connection-Fist algorithm, it may balance the connection of each host but not balance the queue length or the response time, not to mention the RR algorithm and the Random algorithm which do not consider the backend state in the bursty traffic and network instability condition. With the goal of achieving the best performance in such an uncertain network environment, this research analyzes the architecture and behavior of the system in the conditions of real world and then proposes an algorithm as a solution to solve these problems.. 14.

(27) CHAPTER 3 Mobile Banking Messaging as a Service Framework. 3.3 Mobile Banking Messaging as a Service Framework (MBMaaS) This research aims at building a framework which can easily fulfill functions, including Instant Messaging, Instant Computing and Dissemination of Major Information, Bilateral Communication, Bilateral Trading, and many other mobile financial services. When it comes to performance, flexible expansion and complete management of resource are in the considerations as well. While the frameworks mentioned above make it feasible to accomplish the horizontal expansion, instant state of background management system cannot be monitored. Thus, only the static policies like Round-robin and Random can be implemented, but they are unable to satisfy instant demand of financial service. As shown in Figure 2, based on the mentioned framework, monitor component is added to each of Connection Manager in the server farm with a view of monitoring the state of server. Information being monitored includes the number of connection, the number of users, the number of job, arrival rate, service rate and so forth. Following the monitoring procedure is the return of information to controller component on Load Balancer where task assignment can make judgment accordingly.. 15.

(28) Figure 2. Mobile Banking Messaging as a Service Framework. 16.

(29) CHAPTER 4 Network Delay Autocorrelation Model. 4.1 Hypothesis In order to solve the network problems, it is necessary to understand the characteristics of real-world network delay so that we can propose an improved method and verify it. Like Figure 3, we observe one of the receivers, whose time series of network delay is recorded. In spite of the continuous variations of network delay, some patterns can be observed. Drastic variations of network delay rarely happen in a short period of time according to the observation. That is, the correlation of network delay exists right before and after a short time period. For instance, if the network delay is “high” before the short time period, so is the network delay of current short time period. This sign continues even after the short time period, meaning a continuous congestion of network may last for a while.. Figure 3. Time Series of Real-world Network Delay To compare the performance of system in the real network when adopting various task assignment policies and to validate correctness and feasibility of task assignment 17.

(30) policy in subsequent tests, a mobile network which consists of tens of millions of users in the experimental environment is necessary to meet the scenario of future Bank 3.0. However, it’s hard to use thousands of real mobile devices and deploy them in different real network conditions to verify the scheduling policy. Moreover, controlled factors would not remain the same in every real experiment, representing the performance of algorithm with different parameters cannot be compared. Hence, a network model is expected to be proposed as a way of simulating the real network condition.. 4.2 Autocorrelation The time series of network delay is assumed to meet the characteristic of autocorrelation. Autocorrelation in the analysis of time series reflects degree of relevance of how the same series takes numerical data in various time periods. When Autocorrelation Coefficient gets greater in time series, this represents there is a higher relevance and likeness between the historical data and the future one. Based on the observation and assumption above, a network delay autocorrelation model is designed to produce a network with the practical characteristic of network delay. By doing so, the systematic performance of different algorithms of task assignment can be evaluated and compared in the same network environment.. 18.

(31) 4.3 Network Delay Autocorrelation Model The following Table 1 lists some of the related parameters we may use: Table 1. Symbols of Network Delay Autocorrelation Model Symbols 𝑚𝑖𝑛 𝑡𝑖𝑛 𝜏𝑖𝑛 𝐷𝑖𝑛. Definition Message i target to the user n, where (i, n =1, 2, 3…) Delivery time of 𝑚𝑖𝑛 , where (i, n =1, 2, 3…) 𝑛 Interval time between 𝑚𝑖𝑛 and 𝑚𝑖−1. Network delay of 𝑚𝑖𝑛 , where (i, n =1, 2, 3…). In our assumption, autocorrelation of network delay is higher before and after a short time period but lower in a longer time period. Hence, a formulation is designed to satisfy the above assumption. If we produce shorter sending time interval through network delay generator, the probability of creating a similar network delay for the current one and the previous one is expected. Thus, this condition is achieved by the formulation as follows: 𝑛 𝐷𝑖𝑛 = weight× 𝐷𝑖−1 + (1-weight)× 𝐷𝑛𝑒𝑤. (1). The Pareto Distribution with alpha=1.1 is set, which is used in the SURGE web workload generator to produce network delay with the initial number 𝐷𝑛𝑒𝑤 . We hope we can follow Pareto Distribution under the law of large numbers, and then time series of network delay meets the characteristic of autocorrelation. Thus, an interval of weight ranging from 0~1 is defined. Whenever the weight approaches 1, 𝐷𝑖𝑛 gets closer to 𝑛 𝐷𝑖−1 , and whenever the weight approaches 0, 𝐷𝑖𝑛 gets closer to 𝐷𝑛𝑒𝑤 . In other words,. to ensure the characteristic of autocorrelation exists in the network delay time series, probability of weight with a value closer to 1 is raised as sending time interval is shorter, and in contrast, probability of owing a weight near 0 is expected when sending time interval is longer. Following is the method of how the weight is generated:. 19.

(32) Step 1:. Figure 4. Interval between the Sending of Two Messages First of all, as Figure 4 shows, an interval between the sending of two messages is recorded. Suppose the message 𝑚𝑖𝑛 for 𝑢𝑠𝑒𝑟𝑛 is sent at time of 𝑡𝑖𝑛 along with 𝑛 𝑛 another message 𝑚𝑖+1 sending at time of 𝑡𝑖+1 , the interval time between the two 𝑛 messages is 𝜏𝑖+1 formulated as: 𝑛 𝑛 𝜏𝑖+1 = 𝑡𝑖+1 − 𝑡𝑖𝑛. (2). Since there is no message before the first message 𝑚0𝑛 , 𝜏0𝑛 is preset as: 𝜏0𝑛 = 0. (3). Step 2: Once 𝜏𝑖𝑛 of the message 𝑚𝑖𝑛 is computed, value of 𝜏𝑖𝑛 and the correlation between 𝑚𝑖𝑛 and network delay are requisite to be defined. A parameter, most possible weight, is defined, too. If the most possible weight equals 1, network delay 𝐷𝑖𝑛 for 𝑛 𝑛 𝑚𝑖𝑛 is highly possible to be similar to network delay 𝐷𝑖+1 for 𝑚𝑖+1 from the. perspective of probability; on the contrary, if most possible weight equals 0, the probability of finding a network delay 𝐷𝑖𝑛 for 𝑚𝑖𝑛 that is similar to network delay 𝑛 𝑛 𝐷𝑖+1 for 𝑚𝑖+1 is very low.. For network delay, probability of drastic variations in the condition of shorter time period is low through observation. Therefore, a function 𝑓(𝜏𝑖𝑛 ) with the characteristics. 20.

(33) stated above is set to describe the most possible weight. A parabola opening downward then is used to denote the function of most possible weight: (𝜏𝑛 )2. 𝑖 𝑓(𝜏𝑖𝑛 ) =1+−2×𝑎. (4). where,. 𝛼 =. 𝐶2 2. (5). The width of parabola is decided by 𝑎 while b equals 𝜏𝑖𝑛 once 𝑓(𝜏𝑖𝑛 ) = 0. In 𝑛 other words, as long as 𝜏𝑖𝑛 ≥ 𝑏, there is no correlation between 𝐷𝑖+1 and 𝐷𝑖𝑛 , which is 𝑛 the previous network delay of 𝑚𝑖+1 .. In Figure 5, this method is applied to produce either large or small functions of network delay autocorrelation by deciding different c. The model is denoted as C100 when c equals 100 and as C200 when c equals 200, and so on.. Figure 5. Functions that Decide the Most Possible Weight Step 3:. After getting the value of most possible weight, the final value of weight is required to compute the network delay. A function that is capable of randomly generating values of weight and enabling the production of most possible weight with the highest probability is expected. Hence, two parabolas, g(x) and h(x), are defined. 21.

(34) While g(x) opens upward and h(x) opens downward, the peaks of two parabolas meet each other at most possible weight, shown as Figure 6.. Figure 6. The Function that Decide the Final Weight In order to make decision on the final weight, value of x is generated along the x axis within a range from 0~1. When 𝑓(𝜏𝑖𝑛 ) > x, weight = g(x); when 𝑓(𝜏𝑖𝑛 ) < x, weight = h(x). According to this method, random values of most possible weight can correspond to g(x) and h(x), deciding the final weight, as Figure 7.. Figure 7. Using Most Possible Weight Functions to Generate the Corresponding Functions that Decide the Final Weight 22.

(35) 4.4 Result of the Network Delay Autocorrelation Model Through Network Delay Generator, different network delay time series of autocorrelation Coefficient are generated, as Figure 8~12.. Network Delay with c=300 When Average 𝞽=10 0.08 0.07 0.06 0.05 0.04 0.03 0.02 0.01 0 1.448E+09. 1.448E+09. 1.448E+09. 1.448E+09. 1.448E+09. Figure 8. Network Delay with c=300 When Average 𝞽=10. Figure 9. Network Delay with c=100 When Average 𝞽=10. 23. 1.448E+09.

(36) Figure 10. Network Delay with c=50 When Average 𝞽=10. Figure 11. Network Delay with c=10 When Average 𝞽=10. Figure 12. Network Delay with c=1 When Average 𝞽=10 24.

(37) 4.4 Autocorrelation Coefficient Whether Autocorrelation Coefficient of network delay time series from different models is the same as expected is calculated and evaluated. s is assumed as starting time while t as ending time. Sequence of network delay is denoted as 𝑋𝑠,𝑡 : 𝑥𝑠 ,𝑥𝑠+1 , 𝑥𝑠+2 , 𝑥𝑠+3 … … , 𝑥𝑡 . 𝜇𝑠,𝑡 and 𝜎𝑠,𝑡 represent the mean value and the standard deviation of the sequence 𝑋𝑠,𝑡 respectively. Thus, autocorrelation of k lags is denoted as follows:. 𝑅(𝑘) =. 𝐸(𝑋𝑘+1,𝑛 −𝜇𝑘+1,𝑛 )(𝑋1,𝑛−𝑘 −𝜇1,𝑛+𝑘 ) 𝜎𝑘+1,𝑛 ×𝜎1,𝑛−𝑘. (6). Figure 13 shows 0~10 lags, Autocorrelation Coefficient of network delay time series is generated by six models where c = 100~ 600. With the same lag, it is found that c and Autocorrelation Coefficient are in positive direction. This evidence proves generation of different network delay time series of Autocorrelation Coefficient is feasible when we adopt different values of c in the network delay autocorrelation model. The result is in accordance with the expectation. Next, a Network Delay Generator with the characteristics of the real network which produces network delay of autocorrelation is applied to verify the task assignment policy.. Figure 13. Autocorrelation Coefficient of Network Delay Time Series Which are Produced by Six Models Where c = 100~ 600. 25.

(38) CHAPTER 5 Research Method The current research aims to improve the performance of system based on the real behavior and bottleneck of system. To test the hypothesis that the qualities of users’ networks have impacts on the performance of system, an experiment is designed. The result of experiment is used to create a task assignment algorithm capable of improving the performance of system.. 5.1 Pre-study Take Financial Instant Messaging as an example, two receivers using mobile devices are arranged and connected to Openfire Server by the same Connection Manager, shown in Figure 14.. Figure 14. Architecture of Pre-study Table 2. The Experimental Parameter of the two Set Receiver 1. Receiver 2. Set 1. 9.72 Mbps (Wi-Fi). 9.72 Mbps (Wi-Fi). Set 2. 9.72 Mbps (Wi-Fi). 2.09 Mbps (3G). Table 2 compares Set1 with Set2. In Set1, two mobile devices receive the message from Wi-Fi with downloading speed at 9.72 Mbps in average, while Set2 assigned two 26.

(39) patterns of downloading speed in average, 9.72 Mbps with Wi-Fi and 2.09 Mbps with 3G respectively. Next, average waiting time of the message staying in Connection Manager is measured after sending the message to Set1 and Set2 with the same speed. In Figure 15, it is found that average waiting time of Set2 is much longer than Set1 because of the impact of network delay, as shown in Figure 16.. Figure 15. Experiment Result of Pre-Study. Figure 16. The Impact of Network Delay According to the experiment, it can be inferred that TCP adopted by Connection Manager is stop-and-wait instead of go-back-N. The reason why go-back-N can be used in TCP is on account of a single connection. The message would not face congestion due to the network delay of the previous message when using go-back-N as TCP. However, in practice ,Connection Manager with go-back-N as TCP in a chat room needs a thread of TCP socket at least for connection because Connection Manager 27.

(40) Module have to manage a portion of the client connections. When facing a huge amount of messages sent by tens of thousands of users, the go-back-N system performs ineffectively because usages of thread and overhead exceed the loading of system. Based on this reason, stop-and-wait is applied to avoid the problem of overloading.. 5.2 Method Applied in the Research Take the extension of Openfire Instant Messaging System as an example of framework. In this framework, to overcome the poor performance made by network instability and bursty traffic, a method is needed to estimate the waiting time of task in the system for more efficient task assignment. When a user’s request enters the horizontal scalable system, there will be an immediate dispatch of the request to the corresponding server. It’s assumed the load balancer and the Openfire main server are in a site of the system. So there will be infinite queuing spaces, and the system runs without bottleneck. Since mobile devices’ network connectivity varies, a message being delivered to a user may not arrive instantly. The message has to be queued in the connection manager when sending to the receiver, which takes up some system resources. In other words, the message will “block” other queued message until a successful delivery. Since the message which the system handles is in the format of words, it does not take much time in computing on CM. What makes the system inefficient is the network jam as the result of network delay. In view of this, computing time of message on CM is neglected in the designed scenario, instead, network delay is seen as service time, as Figure 17 shows.. 28.

(41) Figure 17. Network Delay is Seen as Service Time According to the previous Pre-study, it proves that the variety of network delay would affect the waiting time of messages in CM queue. Based on observation in Chapter 4, it is found there is a correlation between the network delay before and after a short period. Therefore, we can predict the value of future network delay through historical data of the short term. Queuing theory [36][37] is the theory behind what happens when we have lots of jobs, scarce resources, and subsequently long queues and delays[35]. Thus, we use Queuing Theory to model our system and to predict the system performance. The arrival of users’ requests is assumed to follow a Poisson process with an arrival rate of λ, and the service time for each Connection Manager is generally distributed with service rate of μ. The queue in Connection Manager has infinite buffer. Requests at each CM are processed on a first-come first-served (FCFS) basis. Instead of M/M/1 queuing model, M/G/1 queuing model is used to model the Connection Manager because of the highly variable network delay. Table 3 lists some of the related parameters for this study:. 29.

(42) Table 3. Symbols of Queuing Model Symbols. Definition. λ𝑘. Average arrival rate of 𝐶𝑀𝑘 in the sliding window.. 𝜇𝑘 𝑆𝑘̅. Average service rate of 𝐶𝑀𝑘 in the sliding window.. 𝑘 𝑞𝑛𝑜𝑤 𝑘 𝑢𝑠𝑒𝑟𝑛𝑜𝑤 𝑘 𝑞𝑐𝑢𝑡_𝑖𝑛. Average service time of 𝐶𝑀𝑘 in the sliding window. In our scenario, we regarded network delay as service time. Thus, the average service time is also average network delay in the sliding window. Number of messages in the 𝐶𝑀𝑘 queue immediately. Number of users which establish connection to the 𝐶𝑀𝑘 . 𝑘 𝑞𝑐𝑢𝑡_𝑖𝑛 =. 𝑢𝑠𝑒𝑟𝑘 𝑛𝑜𝑤 2. There is an interval time between the predict algorithm processing time and the actual arrival time. In the interval time of the same 𝐶𝑀𝑘 queue, there are probability of 0.5 that the messages which other existing users sent would cut-in in front of the incoming message. 𝑘 𝑇𝑤𝑎𝑖𝑡𝑖𝑛𝑔. The waiting time in the 𝐶𝑀𝑘 queue.. 𝑘 𝑇𝑞𝑢𝑒𝑢𝑖𝑛𝑔 𝑊0𝑘. The queuing time in the 𝐶𝑀𝑘 queue. The average remaining service time for the customer (if any) found in service by a new arrival (work it out using the mean residual life formula). 𝑊0𝑘 is the remaining service time in 𝐶𝑀𝑘 .. 𝑘 𝑊𝑛𝑒𝑤. The predict waiting time for the customer by a new arrival.. The purpose of this study aims at minimizing mean waiting time of message. This means that by knowing queue length and number of connection is not enough because the message with the shortest queue length does not guarantee the shortest waiting time. CM with the least number of connections does not represent the lightest loading. This study recognized that to achieve a better performance, message should always be inserted into the queue with the shortest predicted waiting time. Waiting time is composed of queuing time and remaining service time: 𝑘 𝑘 𝑇𝑤𝑎𝑖𝑡𝑖𝑛𝑔 = 𝑇𝑞𝑢𝑒𝑢𝑖𝑛𝑔 + 𝑊0𝑘. (7). where 𝑊0𝑘 ≜. ̅̅̅̅̅ 2 λ𝑘 ×𝑆 𝑘 2. 30. (8).

(43) 5.2.1 See the Future Network Delay (SeeFuND) Task Assignment Algorithm The characteristic of network delay autocorrelation makes it possible to use historical network delay to predict the future network delay which is seen as service time. Thus, we propose a task assignment algorithm that can see the future network delay from history, named SeeFuND. To approximately calculate the average service time (network delay) in a near time period, considering the variation of network instability, a method called moving average is applied to compute service time. Suppose that the window size of sliding window is N, and average service time within historical information of the near N period is taken as mean service time 𝑆𝑘̅ . Thus, queuing time is: 𝑘 𝑘 𝑇𝑞𝑢𝑒𝑢𝑖𝑛𝑔 = 𝑞𝑛𝑜𝑤 × 𝑆𝑘̅. (9). Consider that there is an interval time between the algorithm processing time and the actual arrival time. In the interval time of the same 𝐶𝑀𝑘 queue, there is an average probability of 0.5 that the messages targeting to other existing users would cut-in in front of the incoming message, as shown in Figure 18.. Figure 18. Other Existing Users Would Cut-in in Front of the Incoming Message. 31.

(44) Given this phenomenon, a correction term is added in equation. Therefore, the 𝑘 waiting time 𝑊𝑛𝑒𝑤 is predicted as follows:. 𝑘 𝑘 𝑘 𝑊𝑛𝑒𝑤 = (𝑞𝑛𝑜𝑤 + 𝑞𝑐𝑢𝑡_𝑖𝑛 ) ∗ 𝑆𝑘̅ + 𝑊0𝑘. (10). where 𝑘 𝑞𝑐𝑢𝑡_𝑖𝑛 =. 𝑢𝑠𝑒𝑟𝑘 𝑛𝑜𝑤 2. (11). 𝑘 SeeFuND task assignment algorithm calculate the expected waiting time 𝑊𝑛𝑒𝑤. of each CM queue, then the queue with the shortest expected waiting time is selected to connect to incoming user. 5.2.2 Incubation Period Phenomenon However, there is still a problem if the model only considers the current waiting time. As the Figure 19, although the current waiting time of 𝐶𝑀1 is shorter than 𝐶𝑀2 , the number of users in 𝐶𝑀1 is much greater than 𝐶𝑀2 . As time ticks down, the probability of bursty traffic of messages in 𝐶𝑀1 is very high. We call this Incubation Period Phenomenon.. Figure 19. Incubation Period Phenomenon. 32.

(45) 5.2.3 Foresight-SeeFuND Task Assignment Algorithm The Incubation Period Phenomenon happens when the load balancer assigns an amount of users to the same CM with the shortest expected waiting time in a short time. In order to avoid the bursty traffic as time goes, the task assignment policy which can solve the incubation period phenomenon fundamentally named ForesightSeeFuND (F-SeeFuND) Algorithm is designed as follows: 1.. CM with the highest number of user connections is ruled out to downsize the probability of facing the occurrence of bursty traffic as time ticks down.. 2.. 𝑘 Within the rest of CMs, CM with the shortest 𝑊𝑛𝑒𝑤 is selected by load balancer. to connect to incoming user. Both M/G/1 queuing model and method of moving average are incorporated in the task assignment policy to tackle the problem of network instability. If there is a huge amount of users using the service, a considerable amount of messages is predicted to 𝑘 flow in and cut in in a short time. 𝑞𝑐𝑢𝑡_𝑖𝑛 is added, therefore, as a way of predicting. waiting time much accurately. The moment the stock market opens or when crucial information is disseminated, a huge amount of users would enter the service, meaning the system would be abundant in numerous users immediately. In the face of this 𝑘 situation, before selecting the CM with the shortest 𝑊𝑛𝑒𝑤 , CM with the highest number. of user connections is eliminated to avoid a huge amount of messages flowing in instantly. Not only does the algorithm in this study solve the problem of load balance, but the solution to the problems of bursty traffic and network instability is put forward in consideration of environment of mobile financial service. Next, empirical test will be displayed to validate the correctness and feasibility of the algorithm. 33.

(46) CHAPTER 6 Simulation and Emulation. 6.1 Simulation Environment Setup Task assignment policy is evaluated in the emulation. The emulator is built by Python. In Figure 20, multiple environments of emulation are executed at the same time where each set of environment has load balancer with different task assignment policy. User request is multicast to each emulated environment simultaneously. Also, on the purpose of comparing performance of system when different task assignment policies are assigned under the same user request and network environment, Network Delay Generator produces network delay of each message on condition that there is the same autocorrelation coefficient. Each host runs on Ubuntu12.04 Linux Server with 8GB Ram, 3 Core Processor, and 20GB Disk.. Figure 20. Architecture of Experiment 34.

(47) 6.1.1 Response Time with Different Network Correlation As Figure 21, in each emulation environment, 5 Connection Manager are deployed to handle the client connections. 10,000 user robots are set to create connections by log in, to be off-line by log out, and to interact with each other through chatting, in simulation. Every users’ requests follow a Poisson process with an arrival rate of λ= 0.05 (message/second), and each experiment takes 30 minutes. Thereby, performance of system with different task assignment policies is observed through variation of Network Delay Autocorrelation ranging from the small to the large. Parameter c in the figure below means the scope of autocorrelation which we have defined in Figure 7. For example, c =100, denote as C100, means there is no correlation with the front network delay when the interval time between the two messages is more than 100 seconds. As regards to response time with network correlation, it is found that M/M/1 is far higher than other algorithms. Besides, M/M/1 is memoryless, which makes network delay inaccurate in high variety. The main reason why there is a substantial increase of mean response time is the result of Incubation Period Phenomenon. CM queue with the shortest mean response time evaluated by M/M/1 queuing model is set to have a connection with user by Load Balancer. A system with a large inflow of users in a short time does not mean a huge amount of inflow of messages. Nothing unusual then would be detected and mean response time of message remains unchanged. As a result, all the inflowing users are assigned to the same CM queue to establish connection. After a period of time, users on the CM begin to exchange information with one another. This brings a huge amount of instant messages, and queue length of CM grows abruptly. Message would not stop increasing except that all the users are off-line and cutting connection. Despite so, congestion caused by the lengthy queue length could not be dealt with, leading to the long mean response time overall. Meanwhile, CM queue with 35.

(48) the shortest mean response time begin to connect to user by Load Balancer. Under the circumstances, it is possible that a huge amount of users would flow into CM queue again. Vicious circle like this indicates M/M/1 is not an efficient algorithm for this concern.. 10000 Current Users Response Time with Network Correlation SeeFuND. F-SeeFuND. SQF. LUF. Random. RR. M/M/1. Response Time (second). 140 120 100 80 60 40 20 0 C100. C200. C300. C400. C500. C600. Network Correlation Figure 21. Response Time with Different Network Delay Autocorrelation (a) Among algorithms except M/M/1 as shown in Figure 22, SQF is the largest one under any circumstances. The reason behind this result is SQF ignores incubation period phenomenon but considers the current benefit since it always allocates user connection to the queue with the shortest connection manager. In the present, the shortest queue length would receive a huge amount of instant users out of bursty traffic of users in the incubation period. When these users receive messages together, queue length increases drastically and immediately. Therefore, average response time is prolonged because of congestion caused by the lengthy queue length which is full of messages. As autocorrelation increases, the continuous congestion gets more serious. 36.

(49) Why SQF is a better algorithm than M/M/1 relies on the growth of queue length, which can be detected earlier than the growth of mean response time. In this study, SeeFuND, modified from M/G/1 queuing model, predicts the congestion in the future by using historical data in the short term. By the time autocorrelation gets higher, since the continuous congestion is getting more serious, SeeFuND can predict the result in a more accurate way and get a relatively lower mean response time. When autocorrelation gets lower, the result is much less precise and the response time can even be higher than Diversification of Risk Based Schemes and LCF. On the other hand, considering that the amount of messages flowing in and cutting in in the future is predicted based on the current amount of users, for SeeFuND, the impact from incubation period phenomenon is smaller in comparison with M/M/1 and SQF. F-SeeFuND is derived from the modified SeeFuND. Comparing with SeeFuND, a huge amount of users is initially avoided to gather at the same CM queue in FSeeFuND, which essentially keeps away from incubation period phenomenon. Not only continuous congestion but bursty traffic of user is avoided by predicting the future based on historical data. Thereby, as autocorrelation is getting higher, F-SeeFuND outperforms other algorithms significantly. Because algorithms inclusive of RR, Random, and LCF manage the risk of congestion by average allocation to connection manager, their impact from incubation period phenomenon is smaller than M/M/1 and SQF. When autocorrelation remains relatively low, these algorithms perform nearly as well as F-SeeFuND, but they happen to increase response time when continuous congestion cannot be avoided in the condition that autocorrelation gets higher.. 37.

(50) 10000 Current Users Response Time with Network Correlation SeeFuND. F-SeeFuND. SQF. LUF. Random. RR. 10. 9. Response Time (second). 8 7 6 5 4 3 2 1 0 C100. C200. C300. C400. C500. C600. Network Correlation Figure 22. Response Time with Different Network Delay Autocorrelation (b) 6.1.2 Response Time with Different Loading In Figure 23, performance of task assignment policies with different loadings is compared when network delay autocorrelation remains in a lower level. Obviously, response time of SQF is higher than other algorithms of task assignment because it cannot avoid incubation period phenomenon. In particular, impact from incubation period phenomenon becomes more drastic as the quantity of users increases. While quantity of users is in a lower level, resources of systems are able to sustain, making the performances of most algorithms remain close. However, as loading keeps 38.

(51) weighting, average response time of system keeps on accumulating and increasing because of uneven allocation in the overloading which leads to the continuous congestion in the system. SeeFuND reaches the highest average response time in the condition of the high loading because its prediction is not precise with low autocorrelation plus impact from incubation period phenomenon. For F-SeeFuND, though its prediction is not as precise as SeeFuND when facing the high loading, it outperforms those algorithms lacking consideration of incubation period phenomenon by successfully avoiding incubation period phenomenon.. Response Time with Different Loading(C100) SeeFuND. F-SeeFuND. SQF. LUF. Random. RR. 25. Response Time (Second). 20. 15. 10. 5. 0 5000USERS. 7500USERS. 10000USERS. 12500USERS. 15000USERS. Loading (Number of Users) Figure 23. Response Time with Different Loading (C100) 39.

(52) The Figure 24 shows performance of task assignment policies with different loadings under a circumstance that network delay autocorrelation remains high. In comparison with the figure above, it is clearly found that the performance of SeeFuND is much better than in the lower network delay autocorrelation. In fact, this proves that the benefit of prediction and avoidance of continuous congestion are attainable by adopting the algorithm with prediction over future congestion based on application of historical data collected in the short term and current quantity of users. At the same time, mean response time is proved to decrease because of adjustments of incubation period phenomenon according to the result that F-SeeFuND performs better than SeeFuND in the condition of high loading.. Response Time with Different Loading(c300) SeeFuND. F-SeeFuND. SQF. LUF. Random. RR. 50 45. Response Time (Second). 40 35 30 25 20 15 10 5 0 5000USERS. 7500USERS. 10000USERS. 12500USERS. 15000USERS. Loading (Number of Users) Figure 24. Response Time with Different Loading (C300) 40.

(53) 6.1.3 Response Time with Bursty Traffic In bursty traffic state, we simulate the stock market opening or disclosure of highly important financial message when financial agents would broadcast many messages to all their customers. In the experiment, there is a five-minute bursty traffic every five minutes, as shown in Figure 25.. Figure 25. Bursty Traffic Simulation Scenarios. Figure 26 shows the response time of different task assignment algorithm in different intensities of bursty traffic. The non-bursty traffic state means that the arrival of messages to each queue follows a Poisson process. The arrival rate of low intensity bursty traffic is 40 messages/sec per queue, and the arrival rate of high intensity bursty traffic is 150 messages/sec per queue. We found that when the intensity of bursty traffic increases from 40 messages/sec per queue to 150 messages/sec per queue, SeeFuND algorithm has the minimum increasing response time.. Response Time(second). 250. 200. 150. 100. 50. 0 Random. non-bursty. RR. SQF. bursty (40msg/s). LUF. SeeFuND. F-SeeFuND. bursty (150msg/s). Figure 26. The Response Time of Different Task Assignment Algorithm in Different Intensities of Bursty Traffic 41.

(54) In Figure 27, we observe the time series of response time for each CM queue which its bursty traffic is 40 messages/sec per queue. The result obviously shows that when bursty traffic happened, SeeFuND algorithm and F-SeeFuND can avoid the continuous congestion.. Figure 27. Time Series of Response Time for Each Cm Queue of Different Task Assignment Algorithm. 42.

(55) 6.2 Emulation Environment Setup In order to observe easily in the above experiments, network delay autocorrelation model is used as a way of simulating network delay with characteristics of real network for a huge amount of users. Next, network delay autocorrelation model is replaced with the real network so that performances among different algorithms in face of the real network can be compared and evaluated. Through the service of IaaS provided by DigitalOcean [38], user robots are deployed evenly in different datacenter region among several countries, as shown in Figure 28. Each host is run on Ubuntu14.04 Linux Server with 1GB Ram, 1 Core Processor, and 30GB Disk. Other factors in the emulating environment are the same as before.. Figure 28. Architecture of Experiment that User Robots are Deployed in Different Datacenter Region among Several Countries. 43.

(56) 6.2.1 Effectiveness Evaluation In the experiment of the real network environment, quantity of users is added up incrementally in order to observe performances of system with different algorithms. In Figure 29, the result of the experiment is in accordance with the experiment applying network delay correlation model as a way of generating network delay. Still, as far as SQF is concerned, mean response time gets raised by the growth of users on account of existence of incubation period phenomenon. Mean response time of system derived from most of the algorithms shows no significant difference when quantity of users remains in a low level. As quantity of users keeps growing, however, loading of system becomes heavier and as a result, mean response time of system gets higher when RR, Random, and LCF get stuck in the continuous congestion. While future congestion is predicted through historical data in SeeFuND, bursty traffic produced by incubation period phenomenon becomes more drastic as quantity of users grows, and it eventually increases mean response time. Meanwhile, F-SeeFuND is actually recognized to have a lower mean response time in the face of bursty traffic and continuous congestion in network. To sum up, this experiment meets the assumption that future congestion can be predicted through historical information and is consistent with the result of the previous experiment which uses network delay autocorrelation model to generate network delay. This experiment indirectly verifies the correctness of the network delay autocorrelation model. Therefore, according to this model, we are able to produce any number of users' network delay in various applications in the future.. 44.

(57) Response Time with Different Loading in Real-world Network SeeFuND. F-SeeFuND. SQF. LUF. Random. RR. 25. Response Time (Second). 20. 15. 10. 5. 0 200USERS. 300USERS. 400USERS. 500USERS. 600USERS. 700USERS. Loading (Numver of Users) Figure 29. Response Time with Different Loading in Real World Network. 45.

(58) CHAPTER 7 Conclusions and Future Work In this thesis, we propose a Mobile Banking Messaging as a Service Framework to satisfy the demand of mobile financial service. With the coming of Bank 3.0, users can enjoy the financial service with their mobile devices everywhere. Because of the overwhelming need for network and system resources when the opening of stock markets or astonishing revelation in news happens, the task assignment policy proposed here can be implemented to solve the problems of the explosive need for network resources and unbalanced network. To verify our algorithm, we proposed network delay autocorrelation model to simulate the realistic condition of network congestion, and we found that when faced with the problem of heavy congestion and explosive need for network resources, we could actually use this algorithm to improve the ability of the system to manage resource. Last but not least, we allocated user robots at datacenter worldwide to verify our experimental results, and the result obtained in the real condition is the same as our simulation result. Therefore, this research can indirectly verify the correctness of the network delay autocorrelation model and the effectiveness of our task assignment algorithm. In the future, because cloud providers offer computer resources to users on payper-use, we will consider the user priority to accommodate the demands of different users. They may enjoy different levels of service quality. On the other hand, using a fixed number virtual machine configuration may fail to deliver good quality of service when the number of incoming requests rapidly rises. It 46.

(59) may leave many virtual machines idle when the number of users is very small. In order to effectively handle a large number of incoming requests, we hope that the system can be auto scaled out before the system is overwhelmed.. 47.

參考文獻

相關文件

Microphone and 600 ohm line conduits shall be mechanically and electrically connected to receptacle boxes and electrically grounded to the audio system ground point.. Lines in

 Combining an optimal solution to the subproblem via greedy can arrive an optimal solution to the original problem. Prove that there is always an optimal solution to the

By using the case study and cross analysis of the results, The Purpose of this research is find out the Business implementing Supply Chain Management system project, Our study

The objective of the present paper is to develop a simulation model that effectively predicts the dynamic behaviors of a wind hydrogen system that comprises subsystems

In this study, variable weights are added into the probabilistic density function of Elliptical Probabilistic Neural Network (EPNN), so that the kernel function can be adjusted

This study proposed the ellipse-space probabilistic neural network (EPNN), which includes three kinds of network parameters that can be adjusted through training: the variable

The exploration of the research can be taken as a reference that how to dispose the resource when small and medium enterprise implement management information system.. The

interview and AHP in order, it comes out that this research can describe the correlation between the economic recession and the investment intentions, and this will help the