gctrace: setting gctrace=1 causes the garbage collector to emit a single line to standard error at each collection, summarizing the amount of memory collected and the length of the pause. Setting gctrace=2 emits the same summary but also repeats each collection. The format of this line is subject to change. Currently, it is: gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #->#-># MB, # MB goal, # P where the fields are as follows: gc # the GC number, incremented at each GC @#s time in seconds since program start #% percentage of time spent in GC since program start #+...+# wall-clock/CPU times for the phases of the GC #->#-># MB heap size at GC start, at GC end, and live heap # MB goal goal heap size # P number of processors used The phases are stop-the-world (STW) sweep termination, concurrent mark and scan, and STW mark termination. The CPU times for mark/scan are broken down in to assist time (GC performed in line with allocation), background GC time, and idle GC time. If the line ends with "(forced)", this GC was forced by a runtime.GC() call and all phases are STW.
1
gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #->#-># MB, # MB goal, # P
gc # :编号
@#s :自程序启动到打印 gc 日志的时间
#%:自程序启动,gc 花费的时间占比
#+#+# ms clock:垃圾回收时间,(sweep)+(mark & scan)+(termination)
#+#/#/#+# ms cpu:垃圾回收占用的 CPU 时间 (sweep)+(mark & scan (辅助时间/后台gc时间/空闲时间))+(termination)
#->#-># MB:gc 开始时堆大小、gc 结束时堆大小、存活堆大小
#MB goal :全局堆大小
#P :使用的处理器数量
ms cpu 约等于 cpu_num * ms clock
示例
1 2 3
gc 35 @1130.489s 1%: 0.71+3290+0.12 ms clock, 5.7+5932/26084/4619+1.0 ms cpu, 35956->37042->8445 MB, 37411 MB goal, 32 P
我们的 consul dashboard(基于 consul ui 源码,新增了权限控制,独立部署)突然出现 504 异常。
打开浏览器调试器的 network,查看异常的请求。
/v1/* 接口,向部署的node应用发送请求,node 应用再将请求通过插件( express-http-proxy )代理转发至 consul server。
很奇怪,其他所有机房都没有问题。而且,多刷几次,偶尔可以正常响应。
服务
这一台机器的 Java 服务报了奇怪的 \n not found: limit=0 content=�~@� 异常。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[ERROR 2021-03-15 20:21:39.114] com...init(ConsulBase.java:58) [[consul] init consul base failed, e=[com.orbitz.consul.ConsulException: Error connecting to Consul at com.orbitz.consul.AgentClient.ping(AgentClient.java:69) at com.orbitz.consul.Consul$Builder.build(Consul.java:708) ... Caused by: java.io.IOException: unexpected end of stream on http://127.0.0.1:8500/... at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:205) at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:105) ... at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184) at okhttp3.RealCall.execute(RealCall.kt:66) at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at com.orbitz.consul.AgentClient.ping(AgentClient.java:62) ... 14 more Caused by: java.io.EOFException: \n not found: limit=0 content=�~@� at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:231) at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.kt:210) at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:181) ... 35 more
传输层提供端到端的数据传输服务。它定义了两个主要的传输协议:TCP(Transmission Control Protocol)和UDP(User Datagram Protocol)。TCP提供可靠的、面向连接的数据传输,而UDP提供无连接的、不可靠的数据传输。该层还处理数据分段、流量控制和错误恢复等任务
网络层(Internet Layer)
网络层实现了IP协议,负责在不同网络之间进行数据包的路由和转发。它使用IP地址标识主机和网络,并通过路由选择算法确定最佳路径。主要协议包括IP(Internet Protocol)、ICMP(Internet Control Message Protocol)和ARP(Address Resolution Protocol)
万维网(World Wide Web)是一种基于英特网的信息系统,通过超文本链接的方式来组织、检索和共享文档和资源。在万维网上,不同的文档和资源通过统一的标识符(URL,统一资源定位符)进行唯一标识。万维网的核心技术是HTTP(Hypertext Transfer Protocol),它定义了在网络上传输超文本资源的规范。
MAC 地址
MAC地址(Media Access Control Address)是网络设备(如网卡、无线适配器)在出厂时固定分配的唯一标识符。它是一个由12个十六进制数(0-9,A-F)组成的字符串,通常以冒号或短横线分隔。MAC地址由两部分组成:前6个十六进制数表示厂商代码(OUI,Organizationally Unique Identifier),用于标识设备制造商;后面的6个十六进制数是设备的序列号,由制造商分配。