Skip to Content
监控运维实践:原则与策略
book

监控运维实践:原则与策略

by Mike Julian
November 2020
Intermediate to advanced
142 pages
3h 12m
Chinese
Posts & Telecom Press
Content preview from 监控运维实践:原则与策略
服务器监控
|
83
示应用程序出现问题了,这可能会造成销售额损失。
另外一个指标则经常让人困惑:连接数。简单来说,连接数并不是请求数,你应该更多地
关注请求数而不是连接数。若要进一步研究,就得谈及
keepalive
。
在使用
keepalive
之前,每个请求都需要自己的连接。鉴于为了加载页面需要请求网站的
多个对象,这就导致了大量的连接。问题在于,打开一个连接需要经过完整的
TCP
握手、
建立连接、移动数据和断开连接——对于一个页面来说,这个过程要进行几十次。于是
HTTP keepalive
就诞生了:
Web
服务器为客户端保持连接打开而不是断开连接,以允许客
户端重用连接。因此,可以通过单个连接发出许多请求。当然,连接不能永远保持打开状
态,所以
keepalive
通过超时(
Apache
为
15
秒,
NGINX
为
75
秒)控制。在浏览器端也有
一个名为
持久连接
的
keepalive
配置,它具有自己的超时值。所有现代浏览器都默认使用持
久连接。
最后一个有用的指标是请求时间。
NGINX
和
Apache
都在访问日志中基于每个请求公开请
求时间。默认情况下不包括请求时间,所以需要更新日志格式来包含它。
8.5
 数据库服务器
首先要监控的是连接数。特别要注意
MySQL
:
MySQL
将其客户端连接称为
线程
(具体原
因超出了本书的讨论范围),每个客户端连接只生成一个线程,所以当你在本书中寻找连
接数指标却找不到时,请不要感到困惑。所有其他数据库引擎都将它们称为
连接
。
虽然数据库连接数可以显示总体流量水平,但它不一定能表明数据库的实际繁忙程度。为 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java数据科学实战

Java数据科学实战

Michael R. Brzustowicz, PhD
可编程网络自动化

可编程网络自动化

Jason Edelman, Scott S. Lowe, Matt Oswalt
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115550750