面向高并发在线考试系统的性能优化
Performance Optimization for High Concurrency Online Exam System
王原昭 1卢春雨 1蒲鹏1
作者信息
- 1. 华东师范大学数据科学与工程学院,上海 200062
- 折叠
摘要
在线考试是线上教育的重要组成部分,随着线上教育的迅速发展,加之考试本身的特殊性,在线考试系统往往会面临高并发场景.本文分析在线考试系统中出现的高并发场景,在传统的系统架构之上,加入基于Redis的缓存层,并提出两个优化方法:缓存预热和延迟写入,分别用于改善在线考试开始时高并发读和在线考试期间高并发写的性能.实验结果表明,这两种方法能有效提高单机处理请求的吞吐量,降低请求的平均响应时间,因而能在机器数量保持不变的情况下,提高整个在线考试系统的并发量.此外,为了避免缓存层不可用时,整个系统无法正常提供服务,本文提出一种容错机制,将系统与缓存层进行解耦,从而提高系统的可用性.目前,这些优化方法已经被用于华东师范大学研发的"水杉在线"学习平台,有效提高了用户的体验感.
Abstract
Online exam is an important component of online education,and due to the rapid development of online education,coupled with the particularity of exams,online exam systems often face high-concurrency scenarios.This paper analyzes the high-concurrency scenarios that occur in online exam systems and proposes two optimization methods based on Redis cache layer:cache warm-up and delayed write,which are used to improve the performance of high-concurrency reading at the beginning of online examination and high-concurrency writing during online examination.Experimental results show that these two methods can effectively improve the throughput of single machine processing requests and reduce the average response time of requests,thereby increasing the concurrency of the entire online examination system while keeping the number of machines constant.In addition,to avoid the situation where the entire system cannot provide services when the cache layer is unavailable,this paper proposes a fault-tolerant mechanism that decouples the system from the cache layer,thereby improving the system's availability.Currently,these optimization methods have been used in the"Shuishan"learning platform developed by East China Normal University,effectively improving the user experience.
关键词
Redis/延迟写/高并发/在线考试/优化/容错Key words
Redis/delayed writing/high concurrency/online examination/optimization/fault tolerance引用本文复制引用
出版年
2024