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

卖衣服的网站排名怎么创建自己的免费网址

卖衣服的网站排名,怎么创建自己的免费网址,厦门网站制作套餐,北滘做网站当系统卡顿时候,我们需要分析时间花费在哪个缓解。项目的后端接口可以记录一些时间,此外,在我们的tomcat容器和nginx网关上也可以记录一些有关请求用户,请求时间,响应时间的数据,可以提供更多的信息以便于排…

        当系统卡顿时候,我们需要分析时间花费在哪个缓解。项目的后端接口可以记录一些时间,此外,在我们的tomcat容器和nginx网关上也可以记录一些有关请求用户,请求时间,响应时间的数据,可以提供更多的信息以便于排查问题。

1.tomcat日志

server.xml

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt"pattern="%h %l %u %I %t &quot;%r&quot; %s %b %D" />

以下列出了一些基本的日志格式项:

%a – 远程主机的IP (Remote IP address)
%A – 本机IP (Local IP address)
%b – 发送字节数,不包含HTTP头,0字节则显示 ‘-’ (Bytes sent, excluding HTTP headers, or ‘-’ if no bytes
were sent)
%B – 发送字节数,不包含HTTP头 (Bytes sent, excluding HTTP headers)
%h – 远程主机名 (Remote host name)
%H – 请求的具体协议,HTTP/1.0 或 HTTP/1.1 (Request protocol)
%l – 远程用户名,始终为 ‘-’ (Remote logical username from identd (always returns ‘-’))
%m – 请求方式,GET, POST, PUT (Request method)
%p – 本机端口 (Local port)
%q – 查询串 (Query string (prepended with a ‘?’ if it exists, otherwise
an empty string)
%r – HTTP请求中的第一行 (First line of the request)
%s – HTTP状态码 (HTTP status code of the response)
%S – 用户会话ID (User session ID)
%t – 访问日期和时间 (Date and time, in Common Log Format format)
%u – 已经验证的远程用户 (Remote user that was authenticated
%U – 请求的URL路径 (Requested URL path)
%v – 本地服务器名 (Local server name)
%D – 处理请求所耗费的毫秒数 (Time taken to process the request, in millis)
%T – 处理请求所耗费的秒数 (Time taken to process the request, in seconds)
你可以用以上的任意组合来定制你的访问日志格式,也可以用下面两个别名common和combined来指定常用的日志格式:
common – %h %l %u %t "%r" %s %b
combined -
%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"
另外你还可以将cookie, 客户端请求中带的HTTP头(incoming header), 会话(session)或是ServletRequest中的数据都写到Tomcat的访问日志中,你可以用下面的语法来引用。
%{xxx}i – 记录客户端请求中带的HTTP头xxx(incoming headers)
%{xxx}c – 记录特定的cookie xxx
%{xxx}r – 记录ServletRequest中的xxx属性(attribute)
%{xxx}s – 记录HttpSession中的xxx属性(attribute)
2.nginx日志
 log_format access_json '{"@timestamp":"$time_iso8601",''"host":"$server_addr",''"clientip":"$remote_addr",''"size":$body_bytes_sent,''"responsetime":$request_time,''"upstreamtime":"$upstream_response_time",''"upstreamhost":"$upstream_addr",''"login_user":"$cookie_login_user",''"http_host":"$host",''"url":"$uri",''"method":"$request_method",''"domain":"$host",''"xff":"$http_x_forwarded_for",''"referer":"$http_referer",''"status":"$status"}';
request_time(单位为秒)

官网描述:request processing time in seconds with a milliseconds resolution; time elapsed between the first bytes were read from the client and the log write after the last bytes were sent to the client。

指的就是从接受用户请求的第一个字节到发送完响应数据的时间,即$request_time包括接收客户端请求数据的时间、后端程序响应的时间、发送响应数据给客户端的时间(不包含写日志的时间)。

upstream_response_time(单位为秒)

官网描述:keeps time spent on receiving the response from the upstream server; the time is kept in seconds with millisecond resolution. Times of several responses are separated by commas and colons like addresses in the $upstream_addr variable.。

是指从Nginx向后端建立连接开始到接受完数据然后关闭连接为止的时间。

从上面的描述可以看出,$request_time肯定比$upstream_response_time值大;尤其是在客户端采用POST方式提交较大的数据,响应体比较大的时候。在客户端网络条件差的时候,$request_time还会被放大。


参考文档:

Tomcat访问日志浅析_org.apache.catalina.valves.accesslogvalve_yaerfeng的博客-CSDN博客

Nginx - request_time和upstream_response_time详解_nginx request_time_zzhongcy的博客-CSDN博客

http://www.yayakq.cn/news/445468/

相关文章:

  • 沈阳建立网站做网站需要多大的空间
  • 购买了网站空间如何进入工程建设造价信息网站
  • 网站建设与维护考题公司网络营销方案思路
  • 合肥网站优化排名推广上海网站建设 普送
  • 网站开发运营维护方案建议文档北京seo报价
  • 广东深广东深圳网站建设一键免费搭建手机网站
  • dw网页制作详细步骤搜索引擎优化seo名词解释
  • it美工做网站咸阳制作网站
  • 专门做护理PDCA的网站学校校园网站建设服务
  • 荆门公司做网站天水有做网站的地方吗
  • 网站建设硬件配置金顺广州外贸网站建设
  • 万网有网站建设吗佛山网红
  • 专业网站建设信息易优cms企业网站管理系统
  • 网站搭建费用价格表多用户网上商城系统
  • 开发个微网站多少钱怎么把网站扒下来
  • 怎样建设个自己的网站东莞seo优化排名推广
  • 石家庄招聘网最新招聘企业网站seo诊断工具
  • 企业网站开发开题报告兰州装修公司哪家好
  • 自建网站服务器河北石家庄网站
  • Seo建设网站的步骤做网站接私活价格怎么算
  • 廊坊建设银行网站中国电商集团股份有限公司
  • 泰安做网站建设的公司租车公司网站 模板
  • 泉州地区网站建设公司网站建设总体规划
  • 创建网站的基本流程简单项目计划书模板
  • 加强档案网站建设西安免费做网站多少钱
  • 建筑型专业网站有哪些品牌百度网站建设
  • 如何建立自己的购物网站电子政务平台官网
  • 网站推广优化平台青岛网站的优化
  • 哪里有网站制作技术网页制作与设计源代码
  • 做网站排名大概要多少国家世界新闻