Author: |
張祖浩 Tsu-Hao Chang |
---|---|
Thesis Title: |
記憶體資料庫與訊息佇列應用於高並發遊戲伺服器架構之研究 A Study on High Concurrent Requests Game Server usingIn-Memory Database and Message Queue |
Advisor: |
戴文凱
Wen-Kai Tai |
Committee: |
沈上翔
Shan-Hsiang Shen 黃冠寰 Gwan-Hwan Hwang |
Degree: |
碩士 Master |
Department: |
電資學院 - 資訊工程系 Department of Computer Science and Information Engineering |
Thesis Publication Year: | 2021 |
Graduation Academic Year: | 109 |
Language: | 中文 |
Pages: | 36 |
Keywords (in Chinese): | 遊戲伺服器 、伺服器架構 、記憶體資料庫 、訊息佇列 |
Keywords (in other languages): | Game Server, Server Architecture, In-memory Database, Message Queue |
Reference times: | Clicks: 543 Downloads: 23 |
Share: |
School Collection Retrieve National Library Collection Retrieve Error Report |
近年網際網路相關技術的蓬勃發展,帶動了許多網路遊戲興起。隨著玩家人數的增多,伺服器需要處理的請求量也越來越高,導致遊戲開發商在除了提供遊戲本身的體驗,還需花大量時間設計並建構後端伺服器架構部份,以確保玩家的遊戲體驗流暢以及服務穩定。
在本論文中,我們將提出一種伺服器架構,使遊戲伺服器開發者能夠快速串接,並在串接後即具備有高併發、高可用、低延遲的下單系統,並且保證一定的資料一致性及耐久性,並且利用介面定義語言Protocol Buffers與gRPC提供串接介面,使遊戲開發者能夠著重於改善遊戲本身的表現以及遊玩體驗,而不須花費大量心力於後續的資料處理及伺服器建置。之後我們將提出數項績效指標,並依據各個績效指標設計測試流程,評估此系統在各方面之表現。
最後,本論文列出了數項績效指標,並成功建置一伺服器架構,針對性能、可用性、資料一致性與耐久性等各方面做績效指標之相關測試,並建置了一個單純利用資料庫交易的伺服器架構作為Baseline,比較其兩者之差異。
關鍵字:遊戲伺服器、伺服器架構、記憶體資料庫、訊息佇列
The booming development of Internet-related technologies in recent years has led to the rise of many web-based games. As the number of players increases, the amount of requests that servers need to handle is also getting higher and higher. As a result, game developers need to spend a lot of time designing and constructing the back-end server architecture in addition to providing the game experience itself to ensure a smooth gaming experience and stable service for players.
In this paper, we will propose a server architecture that enables game server developers to quickly connect and have a high concurrency, high availability, and low latency betting system, and ensure high-level data consistency and durability. This allows game developers to focus on improving the performance and experience of the game itself, rather than spending a lot of effort on data processing or server setup. After that, we will propose several key performance indicators and design some testing processes to evaluate the system's performance in various aspects based on each indicator.
Finally, this paper lists several key performance indicators and successfully builds a server architecture, and test the performance indicators in terms of performance, availability, data consistency and durability.
Key words: Game Server, Server Architecture, In-memory Database, Message Queue
[1] Google Inc., “Google Cloud Game Servers.” https://cloud.google.com/game-servers/. Accessed: 20210729.
[2] Google Inc., “Agones.” https://agones.dev/site/. Accessed: 20210729.
[3] Google Inc., “Kubernetes.” https://kubernetes.io/. Accessed: 20210729.
[4] Amazon.com, Inc., “Amazon Gamelift.” https://aws.amazon.com/tw/gamelift/. Accessed: 20210729.
[5] Game Server Services, “Game server services.” https://gs2.io/company.html. Accessed: 20210729.
[6] Google Inc., “Protocol Buffers.” https://developers.google.com/protocol-buffers. Accessed: 20210721.
[7] Dropbox, Inc., Google Inc., Skyscanner Ltd. and WeWork Companies Inc., “grpc.” https://grpc.io/. Accessed: 20210721.
[8] Zynga Inc., “FarmVille.” https://www.facebook.com/FarmVille. Accessed: 20210729.
[9] Danga Interactive, “Memcached.” https://www.memcached.org/. Accessed: 20210729.
[10] redislabs, “Redis.” https://redis.io. Accessed: 20210721.
[11] N. Bronson, Z. Amsden, G. Cabrera, P. Chakka, P. Dimov, H. Ding, J. Ferris, A. Giardullo, S. Kulkarni, H. C. Li, M. Marchukov, D. Petrov, L. Puzar, Y. J. Song, and V. Venkataramani, “TAO: facebook’s distributed data store for the social graph,” in 2013 USENIX Annual Technical Conference, San Jose, CA, USA, June 2628, 2013 (A. Birrell and E. G. Sirer, eds.), pp. 49–60, USENIX Association, 2013.
[12] Lua, “The programming language lua.” https://www.lua.org/. Accessed: 20210721.
[13] Pivotal, “Rabbitmq.” https://www.rabbitmq.com/. Accessed: 20210729.
[14] Synadia Communications, Inc., “Nats.” https://nats.io/. Accessed: 20210729.
[15] Apache Software Foundation, “Apache kafka.” https://kafka.apache.org/. Accessed: 20210721.
[16] Q. Fan and Q. Wang, “Performance comparison of web servers with different architectures: A case study using high concurrency workload,” in 2015 Third IEEE Workshop on Hot Topics in Web Systems and Technologies (HotWeb), pp. 37–42, 2015.
[17] S. S. Prakash and B. C. Kovoor, “Performance optimisation of web applications using inmemory caching and asynchronous job queues,” in 2016 International Conference on Inventive Computation Technologies (ICICT), vol. 3, pp. 1–5, 2016.
[18] A. Cansever, U. Özel, Önsel Akın, A. Özmez, F. F. Gönen, G. Altuntas Sen, S. Kalaycı, and U. Çolak, “A distributed message queuing mechanism for a mailing system with high performance and high availability,” in 2018 6th International Conference on Control Engineering Information Technology (CEIT), pp. 1–5, 2018.
[19] Docker Inc., “Docker.” https://www.docker.com/. Accessed: 20210729.
[20] W. Felter, A. Ferreira, R. Rajamony, and J. Rubio, “An updated performance comparison of virtual machines and linux containers,” in 2015 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS), pp. 171–172, 2015.
[21] P. Emmerich, D. Raumer, F. Wohlfart, and G. Carle, “A study of network stack latency for game servers,” in Proceedings of the 13th Annual Workshop on Network and Systems Support for Games, NetGames ’14, IEEE Press, 2014.
[22] R. Morabito, J. Kjällman, and M. Komu, “Hypervisors vs. lightweight virtualization: A performance comparison,” in 2015 IEEE International Conference on Cloud Engineering, pp. 386–393, 2015.
[23] MongoDB Inc., “Mongodb.” https://www.mongodb.com/. Accessed: 20210721.
[24] M. Jones, J. Bradley, and N. Sakimura, “JSON Web Token (JWT).” RFC 7519, May 2015.
[25] Bojand, “ghz, grpc benchmarking and load testing tool.” https://ghz.sh/. Accessed: 20210721.