Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

cURL/wget/ping/... time randomly increases

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
jonasl
Posts: 3
Joined: 2022-08-03 14:00

cURL/wget/ping/... time randomly increases

#1 Post by jonasl »

Hello!

I'm currently working with a debian 11 server. Due to multiple problems with cURL, wget, ... I decided to write a small bash script that saves the time it takes to process "curl google.com", put in into crontab and let it run every minute.

Code: Select all

    #!/bin/bash
    C="$(date +"%T")"
    T="$(date +%s)"
    
    curl google.com
    
    T="$(($(date +%s)-T))"
    echo "TIME: ${C} || CURLTIME: ${T}s" >> /CRONMASTER/curltime.txt
And these were the following "logs" as the incident occurred.

Code: Select all

    TIME: 14:25:01 || CURLTIME: 0s
    TIME: 14:26:01 || CURLTIME: 0s
    TIME: 14:27:01 || CURLTIME: 1s
    TIME: 14:28:01 || CURLTIME: 0s
    TIME: 14:29:01 || CURLTIME: 0s
    TIME: 14:30:01 || CURLTIME: 0s
    TIME: 14:31:01 || CURLTIME: 1s
    TIME: 14:32:01 || CURLTIME: 0s
    TIME: 14:33:01 || CURLTIME: 0s
    TIME: 14:34:01 || CURLTIME: 1s
    TIME: 14:35:01 || CURLTIME: 0s
    TIME: 14:36:01 || CURLTIME: 5s
    TIME: 14:37:01 || CURLTIME: 5s
    TIME: 14:38:01 || CURLTIME: 5s
    TIME: 14:39:01 || CURLTIME: 5s
    TIME: 14:40:01 || CURLTIME: 5s
After a reboot, everything was fine again, and it started printing 0s / 1s again. I'm currently trying to figure out if it happens at a specific time or after an amount of time.

The problem isn't with cURL because it also happens with other commands, e.g.:

Code: Select all

    time curl google.com >> 5.179s
    time wget google.com >> 10.136s
    time ping -c 3 google.com >> 16.067s
    time ping -c 3 172.217.16.206 >> 2.019s
    time traceroute google.com >> 1m5.308s
I thought of an DNS Resolve problem because using the IPv4 works fine (most of the time). So I changed my nameservers to 1.1.1.1 and 8.8.8.8 and disabled IPv6, but the problem seems to persist. Any idea on why this might be happening?

Thanks in advance!

lindi
Debian Developer
Debian Developer
Posts: 412
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 77 times

Re: cURL/wget/ping/... time randomly increases

#2 Post by lindi »

What kind of server do you have? What kind of connection does it have? Does the problem occur if you use "arping" with the IP address of the nearest router?

jonasl
Posts: 3
Joined: 2022-08-03 14:00

Re: cURL/wget/ping/... time randomly increases

#3 Post by jonasl »

lindi wrote: 2022-08-03 19:09 What kind of server do you have? What kind of connection does it have? Does the problem occur if you use "arping" with the IP address of the nearest router?
It's a virtual server / vps that I'm currently renting from a hoster

jonasl
Posts: 3
Joined: 2022-08-03 14:00

Re: cURL/wget/ping/... time randomly increases

#4 Post by jonasl »

Seems like I fixed the issue. It was caused by an iptables rule, to be exact, this one:

Code: Select all

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination
      11173  1267337 DROP       all  --  *      *       1.1.1.1              0.0.0.0/0
Link to the german debian forum thread that helped me solve it: https://debianforum.de/forum/viewtopic.php?t=184715
(No advertisement)

Post Reply