跳转至

工程实践与运维

Improve the performance of your webapp: configure Nginx to cache

Nginx

原文链接:https://www.theodo.fr/blog/2016/06/improve-the-performance-of-your-webapp-configure-nginx-to-cache/ Sometimes, improving the user’s loading experience is not enough, and you need real changes to make your application load faster. So you try CSS and JS minification or image compression but your app is only a bit faster to load. These tricks reduce the size of resources that need to be downloaded, but what if your users didn’t have to download anything at all? That’s what caching is for!

In this article, I will explain how you can configure Nginx to enable the browser cache, thus avoiding painfully slow downloads. If you are not familiar with Nginx, I recommend reading this article.

网站性能指标

QPS

每秒查询率(Query Per Second),每秒响应请求数

QPS = 完成Request量/所花时间(单位 Request/s)

吞吐量(Throughput)

吞吐量是指系统在单位时间内响应的数据量

一个系统吞吐量通常由QPS(TPS)、并发数两个因素决定,每套系统这两个值都有一个相对极限值,在应用场景访问压力下,只要某一项达到系统最高值,系统的吞吐量就上不去了,如果压力继续增大,系统的吞吐量反而会下降,原因是系统超负荷工作,上下文切换、内存等等其它消耗导致系统性能下降