Get the most out of your Centmin Mod LEMP stack
Become a Member

Timeouts when downloading resources via SSL/IPv6

Discussion in 'Other Centmin Mod Installed software' started by deltahf, Aug 4, 2015.

Tags:
  1. deltahf

    deltahf Active Member

    216
    104
    43
    Jun 8, 2014
    Ratings:
    +161
    Local Time:
    6:25 PM
    I've got a strange issue here that started about a week ago. It caused some problems with my XenForo installation (see my support thread here), but further investigation provides more clues that the problem runs a bit deeper.

    To test, I used a plain old wget to download two images that the XenForo image proxy failed to load:
    Code:
    $ wget https://s-media-cache-ak0.pinimg.com/736x/86/ea/2b/86ea2bb8fc6e82c1db13e1b3cbf09742.jpg
    
    --2015-08-03 18:47:59--  https://s-media-cache-ak0.pinimg.com/736x/86/ea/2b/86ea2bb8fc6e82c1db13e1b3cbf09742.jpg
    Resolving s-media-cache-ak0.pinimg.com... 2600:1408:17:3a2::2781, 2600:1408:17:39e::2781, 2600:1408:17:3a0::2781, ...
    Connecting to s-media-cache-ak0.pinimg.com|2600:1408:17:3a2::2781|:443... failed: Connection timed out.
    Connecting to s-media-cache-ak0.pinimg.com|2600:1408:17:39e::2781|:443... failed: Connection timed out.
    Connecting to s-media-cache-ak0.pinimg.com|2600:1408:17:3a0::2781|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 71070 (69K) [image/jpeg]
    Saving to: “86ea2bb8fc6e82c1db13e1b3cbf09742.jpg”
    
    100%[=========================================================================================================================>] 71,070      --.-K/s   in 0.03s 
    
    2015-08-03 18:48:30 (2.31 MB/s) - “86ea2bb8fc6e82c1db13e1b3cbf09742.jpg” saved [71070/71070]
    
    ...and the second test...
    Code:
    $ wget https://upload.wikimedia.org/wikipedia/commons/c/ce/Alfa_Romeo_GTV_facelift_front.JPG
    
    --2015-08-03 18:51:29--  https://upload.wikimedia.org/wikipedia/commons/c/ce/Alfa_Romeo_GTV_facelift_front.JPG
    Resolving upload.wikimedia.org... 2620:0:861:ed1a::2:b, 208.80.154.240
    Connecting to upload.wikimedia.org|2620:0:861:ed1a::2:b|:443... failed: Connection timed out.
    Connecting to upload.wikimedia.org|208.80.154.240|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 442188 (432K) [image/jpeg]
    Saving to: “Alfa_Romeo_GTV_facelift_front.JPG”
    
    100%[=========================================================================================================================>] 442,188     2.35M/s   in 0.2s  
    
    2015-08-03 18:51:44 (2.35 MB/s) - “Alfa_Romeo_GTV_facelift_front.JPG” saved [442188/442188]
    
    Although both of the images do load eventually, it takes about 10 seconds or so to deal with those timeouts. Clearly, it's breaking XenForo because the PHP script is giving up...but why is it taking so long?

    I noticed in the first request, it never falls back to IPv4 and still downloads the image, but in the second, it does fall back to IPv4. Note that I have never performed any special configurations for IPv6 for my Centminmod install. I have not made any recent changes to the server configuration in over a month, when I made the upgrade to PHP 5.6.10.

    Both of the images can be loaded here just fine.

    Any ideas as to what might be going on?
    [​IMG]
    [​IMG]
     
  2. eva2000

    eva2000 Administrator Staff Member

    31,019
    6,923
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,429
    Local Time:
    9:25 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Useful Useful x 1
  3. deltahf

    deltahf Active Member

    216
    104
    43
    Jun 8, 2014
    Ratings:
    +161
    Local Time:
    6:25 PM
    Thanks, you were exactly right!

    My host (ReliableSite) confirmed and fixed an issue with one of their routers that was causing a delay in IPv6 traffic.

    For anyone else who may be troubleshooting a similar problem, see my post here.
     
    • Like Like x 1
    • Informative Informative x 1
  4. Andy

    Andy Active Member

    333
    48
    28
    Aug 6, 2014
    Ratings:
    +57
    Local Time:
    6:25 PM
  5. BamaStangGuy

    BamaStangGuy Active Member

    475
    137
    43
    May 25, 2014
    Ratings:
    +181
    Local Time:
    5:25 PM
    Yep this is on the ReliableHost server as well.