Troubleshooting proxy and/or 3rd party URLs
This is extremely useful troubleshooting external URLs going through proxy / eGTMs / iGTMs and all other sort of combinations.
What i really like about it is it really gives good data for different touch points.
1.time_namelookup
2.time_connect
3.time_appconnect
4.time_pretransfer
5.time_redirect
6.time_starttransfer
It helped me handling extrenal 3rd party URLs and their response times, handshake failures.
*****************************************************************************************************************************************************
$ cat curl-format.txt
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
$ curl -p 10.43.196.140:80 -w "@curl-format.txt" -o /dev/null -k https://na60.mywiseguys/services/Soap/class/AllySFBridgeIntegrationService?wsdl
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 677 100 677 0 0 41924 0 --:--:-- --:--:-- --:--:-- 42312
time_namelookup: 0.000
time_connect: 0.007
time_appconnect: 0.000
time_pretransfer: 0.008
time_redirect: 0.000
time_starttransfer: 0.016
----------
time_total: 0.016
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 405 Only POST allowed</title>
</head>
<body><h2>HTTP ERROR 405</h2>
<p>Problem accessing /services/Soap/class/EventGuyZSFBridgeIntegrationService. Reason:
<pre> Only POST allowed</pre></p><hr /><br/>
<!-- Body events -->
<script type="text/javascript">function bodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken="null";};}function bodyOnBeforeUnload(){}function bodyOnFocus(){}function bodyOnUnload(){}</script>
</body>
</html>
<!--
...................................................................................................
...................................................................................................
...................................................................................................
...................................................................................................
-->time_namelookup: 0.012
time_connect: 0.013
time_appconnect: 0.251
time_pretransfer: 0.251
time_redirect: 0.000
time_starttransfer: 0.507
----------
time_total: 0.507
*****************************************************************************************************************************************************
Here is what each value represents, according to curl’s manual page:
- lookup: The time, in seconds, it took from the start until the name resolving was completed.
- connect: The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.
- appconnect: The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0)
- pretransfer: The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.
- redirect: The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections. (Added in 7.12.3)
- starttransfer: The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result.
- total: The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution.
Note:- Proxy details are below, replace proxies as & when requested in the curl command.
User Proxies (from branches)
DFW: 10.43.196.141,142,143,144,148,149
SAT: 10.47.196.141,142,143,144,148
System Proxies (from data center, system to system)
DFW: 10.43.196.139, 140
SAT: 10.47.196.139, 140
NOTE: You must create the curl-format.txt file where it is that you are going to run the command. The contents need to be
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
SYNTAX of the command is
curl -p <enter proxy IP:port> -w "@curlformat.txt" -o /dev/null -k <enter URL>
BELOW you will find some examples of running the command
Here is another example:
Here is a FAILED request
linux001:~ iSupportU$ curl -p 10.43.196.140:80 -w "@curl-format.txt" -o /dev/null -k https://na60.mywiseguys.com/services/Soap/class/EventGuyZSFBridgeIntegrationService?wsdl % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 799 100 799 0 0 9384 0 --:--:-- --:--:-- --:--:-- 9400 time_namelookup: 0.005050 time_connect: 0.043789 time_appconnect: 0.000000 time_pretransfer: 0.043842 time_redirect: 0.000000 time_starttransfer: 0.085053 ---------- time_total: 0.085140 time_namelookup: 0.066539 time_connect: 0.000000 time_appconnect: 0.000000 time_pretransfer: 0.000000 time_redirect: 0.000000 time_starttransfer: 0.000000 ---------- time_total: 225.609011 curl: (7) Failed to connect to na60.mywiseguys.com port 443: Operation timed out
Here is a SUCCESSFUL request (reason this is being truncated is because the entire page is displayed in html text format and its just too much to copy and paste)
linux001:~ iSupportU$ curl -p 10.43.196.140:80 -w "@curl-format.txt" -o /dev/null -k https://confluence.int.eventguyz.com % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 799 100 799 0 0 9385 0 --:--:-- --:--:-- --:--:-- 9400 time_namelookup: 0.005206 time_connect: 0.044339 time_appconnect: 0.000000 time_pretransfer: 0.044383 time_redirect: 0.000000 time_starttransfer: 0.085003 ---------- time_total: 0.085130 <!DOCTYPE html> <html> <head> <title>Dashboard - EventGuyZ Confluence Powered Wiki</title> <------- tons of stuff that I'm removing and skipping to the end ------→ <script type="text/javascript"> AJS.BigPipe = AJS.BigPipe || {}; AJS.BigPipe.metrics = AJS.BigPipe.metrics || {}; AJS.BigPipe.metrics.pageEnd = typeof window.performance !== "undefined" && typeof window.performance.now === "function" ? Math.ceil(window.performance.now()) : 0; AJS.BigPipe.metrics.isBigPipeEnabled = 'false' === 'true'; </script> </body> </html> time_namelookup: 0.004505 time_connect: 0.040007 time_appconnect: 0.184635 time_pretransfer: 0.184683 time_redirect: 0.000000 time_starttransfer: 0.256104 ---------- time_total: 0.272074
With an example of both you can now do comparisons and see the difference of a successful and failed connection attempt
0 Comments
Recommended Comments
There are no comments to display.