Web应用程序的性能优化研究
发布时间:2018-03-16 16:13
本文选题:性能优化 切入点:PageLet 出处:《电子科技大学》2014年硕士论文 论文类型:学位论文
【摘要】:Internet的快速发展,基于Web的应用与人们的生活和工作越来越紧密联系在一起。很多传统的信息系统被移植到互联网上,微博、电子商务、社交网站等新型的应用模式也在层出不穷。由于Web具有互动性、便捷性、易用性等特点,受到许多企业和个人的喜欢。性能是一个Web应用程序成功的一个决定性要素。因此,Web应用程序的性能优化成为一个重要的研究问题。通常,当我们谈论一个Web应用程序的性能的时候,想到的都是优化后台服务器性能,前端性能优化往往被忽略。目前,Web应用程序的后端性能优化技术已经非常的成熟,比如负载均衡、反向代理缓存、分布式缓存、共享文件系统、数据库性能优化等等。但当基于Web 2.0技术Web应用兴起的时候,一个普遍的现象是,在现实的应用情况中,终端用户感知这个应用的响应十分缓慢,而在系统服务器方面,却查找不到任何一个资源瓶颈。Web2.0时代的到来,一个页面包含的内容越来越多、越来越丰富。获取一个页面,HTTP请求平均数超过90个,页面的平均大小超过1.5M,平均需要向15个域名发送请求[1]。因此,Web应用程序的前端性能优化不能再被忽视。首先,本文研究了浏览器响应时间的计算模型,还分析了HTTP协议。同时,分析及提出以用户感知时延作为性能衡量的指标,为后续的性能方案的验证作为衡量标准。接着,根据HTTP请求数、渲染速度、缓存机制等因素的分析,提出了减少HTTP请求、加快渲染速度、设置缓存等优化方案,并给出了具体的实施及验证,证实这些优化策略确实可以达到优化性能的目的。再者,本文着重研究了Web请求处理流程存在的问题。传统的Web请求处理方式存在用户体验不好且性能差,而目前广泛使用的AJAX技术,虽然提升了性能和用户体验,却增加了大量请求数,造成了服务器负担过重。因此,本文提出了Web请求流水线化的解决方案。请求流水线化就是要利用Browser和Web Server之间的并行性的特点:首先,将页面划分成多个可调用的Pagelets小块;其次,在Browser和Web服务器之间建立管道;最后,在不同的时期,操作它们的运行。通常,流水线化使用多线程的。在这里,提出了请求流水线化的单线程实现方式及Page Let的优先级。通过实验分析,证实了多线程流水线方式在性能方面确实比AJAX性能方面要好,且对服务器负担也相对较轻。但是,在面对大量并发请求时,它同样会造成性能的严重下降;而单线程的实现方式,相对而言性能影响较小,并且单线程的实现方式同样可以获取良好的用户体验。因此,提出了对Web请求流水线化的改进。即通过服务器增加一层调度,在正常情况下,调度多线程的实现模块;在服务器过载的情况下,调度单线程的实现模块。同时,通过了实验分析,这样确实可以获得良好的性能改善。
[Abstract]:With the rapid development of Internet, the application based on Web is more and more closely related to people's life and work. Many traditional information systems have been transplanted to the Internet, Weibo, e-commerce, Social networking sites and other new application models are also emerging. Because of the interactive, convenient, easy to use and other characteristics of Web, Performance is a decisive factor in the success of a Web application. Therefore, performance optimization for web applications has become an important research issue. When we talk about the performance of a Web application, it's all about optimizing back server performance, and front-end performance optimization is often overlooked. Reverse proxy caching, distributed caching, shared file systems, database performance optimization, etc. But when Web applications based on Web 2.0 technology rose, a common phenomenon was, in real applications, The end user is aware of the slow response of the application, but on the system server side, but can not find any resource bottleneck. Web 2.0 era, a page contains more and more content, The average number of HTTP requests to get a page is over 90, the average page size is more than 1.5m, and the average request needs to be sent to 15 domain names [1]. Therefore, the front-end performance optimization of Web applications can no longer be ignored. In this paper, the computing model of browser response time is studied, and the HTTP protocol is also analyzed. According to the analysis of HTTP request number, rendering speed, cache mechanism and other factors, the optimization scheme of reducing HTTP request, speeding up rendering speed and setting cache is put forward, and the concrete implementation and verification are given. It is proved that these optimization strategies can achieve the purpose of optimizing performance. Furthermore, this paper focuses on the problems existing in the process of Web request processing. Traditional Web request processing methods have poor user experience and poor performance. However, the AJAX technology, which is widely used at present, has increased the number of requests and caused the server to be overburdened, although it has improved the performance and user experience. This paper presents a solution to Web's request for pipeline. The purpose of this paper is to take advantage of the parallelism between Browser and Web Server: first, to divide the page into several callable Pagelets chunks; secondly, to make use of the parallelism between Browser and Web Server. Establish a pipeline between the Browser and Web servers; finally, at different times, manipulate their operations. Usually pipeline uses multithreading. Here, In this paper, a single thread implementation method for pipeline and the priority of Page Let are put forward. The experimental results show that the multithreading pipeline method is better than AJAX in performance, and the burden on the server is relatively light. In the face of a large number of concurrent requests, it also results in a serious decline in performance; the implementation of a single thread has relatively little performance impact, and the implementation of a single thread can also provide a good user experience. In this paper, the improvement of Web request pipeline is put forward, that is, adding a layer of scheduling to the server, scheduling the implementation module of multithread under normal condition, scheduling the implementation module of single thread in the case of server overload, at the same time, Through the experimental analysis, we can get good performance improvement.
【学位授予单位】:电子科技大学
【学位级别】:硕士
【学位授予年份】:2014
【分类号】:TP393.09
【参考文献】
相关博士学位论文 前1条
1 王红斌;Web服务器集群系统的自适应负载均衡调度策略研究[D];吉林大学;2013年
相关硕士学位论文 前1条
1 朱聚豹;移动Web前端性能与图片优化的研究[D];华中师范大学;2013年
,本文编号:1620673
本文链接:https://www.wllwen.com/guanlilunwen/ydhl/1620673.html