【Azure App Service】使用 tcpping 来获取App Service的网络状态并把结果保存到文本文件中

问题描述

在云服务的使用过程中,对于网络状态是否有抖动是经常需要考虑的一个问题。

本文以App Service为例,使用它自带的 tcpping 工具,把ping的结果输出到文本文件,用于辅助判断在长ping的时间段中,是否有timeout的情况发生。

 

问题解答

打开Azure App Service门户,需要进入高级工具 (Kudu站点 ) :https://<your app service name>.scm.chinacloudsites.cn/


1: App Service For Windows

进入 Debug Console页面,输入 “ tcpping <your url>:<port> -t > result.txt ” 命令,就可以把每秒的ping结果输出到result.txt文件中。

效果图如下:

 

2: App Service For Linux

进入SSH 或 Bash, 执行 tcpping指令:tcpping <your url> <port> > result.txt

效果图如下:

PS: 通过观察result.txt文件中timeout发生的行数来判断网络抖动的发生时间点,tcpping的ping每秒发送一次,记录执行tcpping的开始时间点 + 行数(秒)来推算时间点。

 

参考资料

App Service For Linux 中安装paping, 用于验证从App Service向外请求的网络连通性 : https://www.cnblogs.com/lulight/p/15067687.html

 

posted @ 2025-06-10 21:43  路边两盏灯  阅读(16)  评论(0)    收藏  举报