基于Node.js的高并发在线商城系统的设计与实现
发布时间:2018-08-06 10:42
【摘要】:随着互联网的快速发展,各种互联网产品的用户数量得到了巨大的增长,用户也变得更加积极活跃,大量网站需要面对越来越高的并发访问压力。为了应对海量用户的访问压力,我们通常采用增加硬件如使用更多更快的服务器,或优化软件系统如采用负载均衡、前后端缓存等技术手段来提升系统的并发处理能力。Node.js作为一种新兴和热门的服务器端技术,它独特的事件机制和异步I/O模型对提高Web服务器的并发性能,解决高并发难题提供了有益的解决思路。针对现有Node.js多线程解决方案存在的算法简单负载不均的问题,本文提出了一种基于请求分类和加权轮询的负载均衡方案,并在此基础上设计实现了一个基于Node.js的在线商城系统。首先,考虑到Node.js对不同类型任务的处理效率,本文将用户的请求根据I/O和CPU的使用情况分为三种,然后将同类请求采用加权轮询的方式分配给各个Node.js工作进程。为了简单有效的计算各节点的权值,本文采用响应时间等效计算的方式,并且当节点性能接近饱和时通过反馈机制快速递减权值,以此来均衡负载,提高系统的整体性能。LoadRunner对比传统解决方案的测试结果表明,本文改进的算法能够在复杂网络情况下有效的均衡用户的请求,提高了 Web服务器的处理性能。其次,在研究现有系统的基础上提出了一种高并发的框架,将改进的Node.js多线程解决方案应用在其中作为Web服务器来接收用户的请求。并配合负载均衡、前后端缓存、数据库等常用组件实现了在线商城的开发工作。对比测试表明,和使用传统Apache Tomcat服务器Java语言实现同样的功能相比,使用Node.js作为Web服务器在有限硬件投入的情况下性能提升明显,具有更好的并发处理能力。
[Abstract]:With the rapid development of the Internet, the number of users of various Internet products has been greatly increased, the users have become more active, a large number of websites need to face more and more high pressure of concurrent access. In order to cope with the pressure of massive users, we usually use additional hardware such as using more and faster servers, or optimize software systems such as load balancing. As a new and popular server-side technology, Node.js has unique event mechanism and asynchronous I / O model to improve the concurrent performance of Web server. Solving the problem of high concurrency provides a useful way to solve the problem. Aiming at the problem of simple load balance in existing Node.js multithreading solutions, this paper proposes a load balancing scheme based on request classification and weighted polling, and then designs and implements an online shopping mall system based on Node.js. Firstly, considering the processing efficiency of Node.js for different types of tasks, this paper divides user requests into three types according to the use of I / O and CPU, and then distributes the similar requests to each Node.js work process by weighted polling. In order to calculate the weights of each node simply and effectively, the response time equivalent calculation method is adopted in this paper, and when the performance of the node is close to saturation, the weight value decreases rapidly through the feedback mechanism to balance the load. The test results of improving the overall performance of the system. LoadRunner show that the improved algorithm can effectively balance user requests in complex networks and improve the processing performance of Web servers. Secondly, a framework with high concurrency is proposed based on the research of the existing system, in which the improved Node.js multithreading solution is applied as a Web server to receive user requests. And with load balance, front and rear cache, database and other common components to achieve the development of online shopping mall. The comparison test shows that compared with the traditional Apache Tomcat server Java language, using Node.js as the Web server can improve the performance obviously and has better concurrency processing ability with limited hardware input.
【学位授予单位】:北京邮电大学
【学位级别】:硕士
【学位授予年份】:2016
【分类号】:TP311.52
本文编号:2167483
[Abstract]:With the rapid development of the Internet, the number of users of various Internet products has been greatly increased, the users have become more active, a large number of websites need to face more and more high pressure of concurrent access. In order to cope with the pressure of massive users, we usually use additional hardware such as using more and faster servers, or optimize software systems such as load balancing. As a new and popular server-side technology, Node.js has unique event mechanism and asynchronous I / O model to improve the concurrent performance of Web server. Solving the problem of high concurrency provides a useful way to solve the problem. Aiming at the problem of simple load balance in existing Node.js multithreading solutions, this paper proposes a load balancing scheme based on request classification and weighted polling, and then designs and implements an online shopping mall system based on Node.js. Firstly, considering the processing efficiency of Node.js for different types of tasks, this paper divides user requests into three types according to the use of I / O and CPU, and then distributes the similar requests to each Node.js work process by weighted polling. In order to calculate the weights of each node simply and effectively, the response time equivalent calculation method is adopted in this paper, and when the performance of the node is close to saturation, the weight value decreases rapidly through the feedback mechanism to balance the load. The test results of improving the overall performance of the system. LoadRunner show that the improved algorithm can effectively balance user requests in complex networks and improve the processing performance of Web servers. Secondly, a framework with high concurrency is proposed based on the research of the existing system, in which the improved Node.js multithreading solution is applied as a Web server to receive user requests. And with load balance, front and rear cache, database and other common components to achieve the development of online shopping mall. The comparison test shows that compared with the traditional Apache Tomcat server Java language, using Node.js as the Web server can improve the performance obviously and has better concurrency processing ability with limited hardware input.
【学位授予单位】:北京邮电大学
【学位级别】:硕士
【学位授予年份】:2016
【分类号】:TP311.52
【相似文献】
相关期刊论文 前2条
1 刘生建;袁冠远;杨艳;;基于Node.js的撮合系统开发[J];软件导刊;2014年08期
2 金德鑫,杨芙清,邹悦;一个模块化操作系统的并发处理[J];北京大学学报(自然科学版);1981年03期
相关硕士学位论文 前10条
1 吴博;基于Node.js的高并发在线商城系统的设计与实现[D];北京邮电大学;2016年
2 王金龙;基于Node.js的图片分享应用的设计与实现[D];南京理工大学;2015年
3 邱伟伟;基于Node.js的万向节制造物联网系统[D];浙江工业大学;2016年
4 杨晓婷;基于Node.js的基础框架设计与实现[D];北京邮电大学;2017年
5 王超;基于Node.js的即时消息系统设计与实现[D];北京邮电大学;2016年
6 李博洋;基于Node.js的分布式数字资源开放服务系统的设计与实现[D];北京邮电大学;2014年
7 陶嫒;基于Node.js的心理解压应用的设计与开发[D];北京邮电大学;2017年
8 杨振宇;基于Nodejs的云PACS系统的设计与实现[D];北京交通大学;2017年
9 李堂更;移动通信基站智能锁系统软件设计与实现[D];电子科技大学;2017年
10 吴昊;应用交付设备在公安行业的应用与研究[D];辽宁科技大学;2016年
,本文编号:2167483
本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/2167483.html