徐州手机网站推广公司哪家好wordpress栏目页只显示标题

当前位置: 首页 > news >正文

徐州手机网站推广公司哪家好,wordpress栏目页只显示标题,网站做5级分销合法吗,久久建筑网 66kv架空线路设计图纸Nginx 介绍 Nginx 是一个开源、轻量级、高性能的 HTTP 和反向代理服务器#xff0c;也可以用于 IMAP/POP3 代理服务器。Nginx 因其采用的异步非阻塞工作模型#xff0c;使其具备高并发、低资源消耗的特性。高度模块化设计也使得 Nginx 具备很好的扩展性#xff0c;在处理静…Nginx 介绍 Nginx 是一个开源、轻量级、高性能的 HTTP 和反向代理服务器也可以用于 IMAP/POP3 代理服务器。Nginx 因其采用的异步非阻塞工作模型使其具备高并发、低资源消耗的特性。高度模块化设计也使得 Nginx 具备很好的扩展性在处理静态文件、反向代理请求等方面 Nginx 表现出了很大的优势同时部署维护简单。因此绝大多数企业内部都会用到 Nginx 。 Nginx 的配置结构图如下 主要结构块说明如下 1全局块配置影响 Nginx 全局的指令。 2http块Nginx 配置文件中的主要上下文之一用于定义全局的 HTTP 配置。它可以包含其他模块的配置指令如 server 和 upstream。 3server块是 Nginx 配置文件中的另一个上下文用于定义虚拟主机的配置。每个 server 块代表一个虚拟主机可以包含 listen、server_name、location 和 location 块等指令。 4location块location 是 server 上下文中的一个指令用于定义请求的 URI 或名称空间的匹配和处理规则。它可以包含处理请求的指令如 proxy_pass、root、index 等。 5upstreamupstream 用于定义一个服务器组通常用于负载均衡。它允许 Nginx 将请求分发到多个后端服务器。 通常在 Nginx 监控中可以通过 stub_status 模块提供的如下7个指标来查看 Nginx 的状态信息。 Active connections当前活动的客户端连接数包括等待中的连接accepts接受的客户端连接总数handled处理的连接总数。通常情况下此参数的值与accepts相同除非已经达到了某些资源限制例如worker_connections限制equests客户端请求的总数Reading当前Nginx正在读取请求头的连接数量Writing当前Nginx正在将响应写回客户端的连接数量 但是这些信息对于监控 Nginx 整体运行情况显然不太够用。Nginx VTS 模块会提供更加丰富的 Nginx 监控指标。Nginx VTS 是 Nginx virtual host traffic status module 的简称是一个专门用于 Nginx 服务器的监控模块它的主要目的是收集和呈现关于 Nginx 运行状态的详细信息可以监控 Nginx 的流量、连接数等底层数据对分析 Nginx 的性能非常重要。 该模块允许用户访问 Nginx 的虚拟主机状态信息包括服务器、上游服务器upstreams和缓存状态。它类似于 Nginx Plus 的实时活动监控功能。例如一个 Nginx 的 web 服务中会包含多个 server通常监控的流量都是服务器总的流量。如果要分享找到流量大的 server通常的做法是通过分析日志来进行访问量统计。但是有了 Nginx VTS 模块后通过对 server zone 的统计各个 server 的流量可以一览无余。除了 server 外各个 upstream 也可以分别统计可以很方便的查看 nginx 转发到 upstream 的流量结合监控可以实现动态调整等。 Nginx VTS 模块提供了内置的 HTML 页面以及 JSON、HTML、JSONP 和 Prometheus 格式的数据输出方便用于第三方监控工具进行数据采集并通过监控仪表板进行监控数据的呈现。 Nginx VTS 模块的安装和配置 模块安装 通过如下链接下载 VTS 模块并上传下载文件到 Nginx 服务器或者直接在 Nginx 服务上通过 git 下载。 GitHub - vozlt/nginx-module-vts: Nginx virtual host traffic status module 通过如下命令获取 Nginx 当前的配置情况

nginx -V

configure arguments: –prefix/usr/local/nginx –with-http_ssl_module –with-http_realip_module –with-http_addition_module –with-http_gzip_static_module通过 –add-module 添加VTS模块并编译安装 Nginx 。 ./configure –prefix/usr/local/nginx –with-http_ssl_module –with-http_realip_module –with-http_addition_module –with-http_gzip_static_module –add-module/file_path_to/nginx-module-vts make make install nginx -V – 启动nginx服务并检测开启的模块模块配置 修改 nginx.conf 配置文件添加 VTS 相关配置。重启 Nginx 服务。 http {vhost_traffic_status_zone;server {location /status {vhost_traffic_status_display;vhost_traffic_status_display_format prometheus;}} }备注vhost_traffic_status_display_format 可选格式有json、jsonp、html或prometheus。访问 Nginx VTS 的配置地址 http://localhost/status 。正常情况下会出现如下信息。 观测云 观测云是一款专为 IT 工程师打造的全链路可观测产品它集成了基础设施监控、应用程序性能监控和日志管理为整个技术栈提供实时可观察性。这款产品能够帮助工程师全面了解端到端的用户体验追踪了解应用内函数的每一次调用以及全面监控云时代的基础设施。此外观测云还具备快速发现系统安全风险的能力为数字化时代提供安全保障。 部署 DataKit DataKit 是一个开源的、跨平台的数据收集和监控工具由观测云开发并维护。它旨在帮助用户收集、处理和分析各种数据源如日志、指标和事件以便进行有效的监控和故障排查。DataKit 支持多种数据输入和输出格式可以轻松集成到现有的监控系统中。 登录观测云控制台在 集成 - DataKit 选择对应安装方式当前采用 Linux 主机部署 DataKit 。 采集器配置 我们将通过 DataKit 中的 Nginx 采集器对 Nginx 的监控指标进行采集。配置说明如下 1、开启 Nginx 采集器 cp /usr/local/datakit/conf.d/nginx/nginx.conf.sample /usr/local/datakit/conf.d/nginx/nginx.conf2、编辑 nginx.conf 文件开启 VTS 选项并配置监控数据的访问地址等如下所示 [[inputs.nginx]]## Nginx status URL.## (Default) If not use with VTS, the formula is like this: http://localhost/basic_status.## If using with VTS, the formula is like this: http://localhost/status/format/json.url http://localhost/status/format/jsonuse_vts trueuse_plus_api falseinsecure_skip_verify falseresponse_timeout 20selection false3、重启 DataKit 服务让配置生效。 datakit service -R关键指标 nginx 指标集 1、标签 TagDescriptionhostHost name which installed nginxnginx_portNginx server portnginx_serverNginx server hostnginx_versionNginx version, exist when using vts 2、指标列表 MetricDescriptionTypeUnitconnection_acceptsThe total number of accepts client connectionsintcountconnection_activeThe current number of active client connectionsintcountconnection_droppedThe total number of dropped client connectionsintcountconnection_handledThe total number of handled client connectionsintcountconnection_readingThe total number of reading client connectionsintcountconnection_requestsThe total number of requests client connectionsintcountconnection_waitingThe total number of waiting client connectionsintcountconnection_writingThe total number of writing client connectionsintcountload_timestampNginx process load time in milliseconds, exist when using vtsintmsecpidThe pid of nginx process (only for Nginx plus)intcountppidThe ppid of nginx process (only for Nginx plus)intcount nginx_server_zone 指标集 1、标签 TagDescriptionhosthost name which installed nginxnginx_portnginx server portnginx_servernginx server hostnginx_versionnginx versionserver_zoneserver zone 2、指标列表 MetricDescriptionTypeUnitcode_200The number of responses with status code 200 (only for Nginx plus)intcountcode_301The number of responses with status code 301 (only for Nginx plus)intcountcode_404The number of responses with status code 404 (only for Nginx plus)intcountcode_503The number of responses with status code 503 (only for Nginx plus)intcountdiscardedThe number of requests being discarded (only for Nginx plus)intcountprocessingThe number of requests being processed (only for Nginx plus)intcountreceivedThe total amount of data received from clients.intBrequestsThe total number of client requests received from clients.intcountresponse_1xxThe number of responses with status codes 1xxintcountresponse_2xxThe number of responses with status codes 2xxintcountresponse_3xxThe number of responses with status codes 3xxintcountresponse_4xxThe number of responses with status codes 4xxintcountresponse_5xxThe number of responses with status codes 5xxintcountresponsesThe total number of responses (only for Nginx plus)intcountsendThe total amount of data sent to clients.intB nginx_upstream_zone 指标集 1、标签 TagDescriptionhosthost name which installed nginxnginx_portnginx server portnginx_servernginx server hostnginx_versionnginx versionupstream_serverupstream serverupstream_zoneupstream zone 2、指标列表 MetricDescriptionTypeUnitactiveThe number of active connections (only for Nginx plus)intcountbackupWhether it is configured as a backup server (only for Nginx plus)intcountfailsThe number of failed requests (only for Nginx plus)intcountreceivedThe total number of bytes received from this server.intBrequest_countThe total number of client requests received from server.intcountresponse_1xxThe number of responses with status codes 1xxintcountresponse_2xxThe number of responses with status codes 2xxintcountresponse_3xxThe number of responses with status codes 3xxintcountresponse_4xxThe number of responses with status codes 4xxintcountresponse_5xxThe number of responses with status codes 5xxintcountsendThe total number of bytes sent to clients.intBstateThe current state of the server (only for Nginx plus)intcountunavailThe number of unavailable server (only for Nginx plus)intcountweightWeights used when load balancing (only for Nginx plus)intcount nginx_cache_zone 指标集 1、标签 TagDescriptioncache_zonecache zonehosthost name which installed nginxnginx_portnginx server portnginx_servernginx server hostnginx_versionnginx version 2、指标列表 MetricDescriptionTypeUnitmax_sizeThe limit on the maximum size of the cache specified in the configurationintBreceivedThe total number of bytes received from the cache.intBresponses_bypassThe number of cache bypassintcountresponses_expiredThe number of cache expiredintcountresponses_hitThe number of cache hitintcountresponses_missThe number of cache missintcountresponses_revalidatedThe number of cache revalidatedintcountresponses_scarceThe number of cache scarceintcountresponses_staleThe number of cache staleintcountresponses_updatingThe number of cache updatingintcountsendThe total number of bytes sent from the cache.intBused_sizeThe current size of the cache.intB 场景视图 登录观测云控制台点击「场景」 -「新建仪表板」输入 “Nginx” 选择 “Nginx(VTS) 监控视图”点击 “确定” 即可添加视图。 视图主要由如下3个部分组成 1、总览部分主要显示 Nginx 服务器的总体运行情况。包括整体的请求数连接数收发数据量和响应错误数等。 2、Server 部分主要显示各个虚拟主机的请求数数据收发量和对应的响应错误数据情况。 3、upstream 部分主要显示请求分发到不同后端服务的请求数数据收发量和对应的响应错误数据情况。 监控器告警 连接断开异常告警 断开连接数等于 accept接收和 handled处理之间的差值。在正常情况下断开的连接应为零。如果每单位时间断开连接的速率开始上升需要寻找导致资源饱和状态可能的因素。 请求连接数突变 请求数的剧烈变化可能会是环境中某个地方正在发生问题虽然它并不能确切地告诉问题发生在哪里。但是值得关注并做进一步分析。 服务错误率告警 服务器错误率等于单位时间的 5xx 错误数例如 “502 Bad Gateway”除以请求总数包含 1xx2xx3xx4xx5xx。如果错误率过高则可能需要进行进一步调查。 总结 Nginx VTS 模块提供了一种强大而灵活的方式来监控和分析 Nginx 的性能和流量对于维护和优化 Nginx 服务器提供丰富的监控数据支撑。