Youtube APIs taking longer on droplet

November 4, 2013 2.6k views
I am working on Youtube apis but each query is taking much longer than expected. While same query on my iPage hosting account is taking 10 times lesser time. Here is the script:: It takes 1.7 seconds on average at digitalocean droplet, while for my iPage account it takes just 0.15 seconds on average. I have tried file_get_contents() too and it takes same amount of time. Please help me in this regards.
4 Answers
What's the youtube API URL that you're trying to access?
Its happening with both v2 and v3 APIs. For example this standard feeds api

gdata.youtube.com/feeds/api/standardfeeds/most_popular?alt=json&format=5
Here is the traceroute output to google servers.

traceroute to gdata.youtube.com (173.194.117.14), 30 hops max, 60 byte packets
1 192.241.143.1 (192.241.143.1) 0.338 ms 0.304 ms 0.367 ms
2 69.55.60.18 (69.55.60.18) 0.264 ms 0.264 ms 0.253 ms
3 nyk-b6-link.telia.net (62.115.34.13) 0.464 ms 0.446 ms 0.506 ms
4 nyk-bb2-link.telia.net (213.155.130.250) 0.855 ms nyk-bb1-link.telia.net (80.91.253.92) 0.510 ms nyk-bb2-link.telia.net (213.155.133.12) 0.846 ms
5 kbn-bb1-link.telia.net (80.91.249.20) 81.405 ms kbn-bb2-link.telia.net (80.91.247.120) 93.962 ms kbn-bb1-link.telia.net (213.155.131.134) 81.566 ms
6 s-bb3-link.telia.net (213.155.136.171) 92.659 ms s-bb4-link.telia.net (213.155.134.142) 100.561 ms 100.571 ms
7 s-b3-link.telia.net (213.155.136.53) 102.092 ms 100.309 ms s-b3-link.telia.net (213.155.131.125) 95.957 ms
8 72.14.212.90 (72.14.212.90) 103.894 ms 100.596 ms 100.586 ms
9 216.239.43.122 (216.239.43.122) 100.499 ms 209.85.250.192 (209.85.250.192) 106.429 ms 216.239.43.122 (216.239.43.122) 104.029 ms
10 209.85.254.33 (209.85.254.33) 104.009 ms 100.347 ms 209.85.254.31 (209.85.254.31) 107.691 ms
11 209.85.254.153 (209.85.254.153) 105.696 ms 101.980 ms 72.14.232.95 (72.14.232.95) 137.362 ms
12 209.85.244.211 (209.85.244.211) 96.704 ms 216.239.47.11 (216.239.47.11) 96.968 ms 209.85.244.211 (209.85.244.211) 102.394 ms
13 72.14.242.167 (72.14.242.167) 109.627 ms 102.428 ms 96.504 ms
14 72.14.235.91 (72.14.235.91) 107.042 ms 102.813 ms 107.070 ms
15 72.14.232.73 (72.14.232.73) 118.031 ms 118.561 ms 72.14.232.71 (72.14.232.71) 118.473 ms
16 209.85.248.214 (209.85.248.214) 132.985 ms 72.14.238.104 (72.14.238.104) 134.992 ms 137.250 ms
17 72.14.239.49 (72.14.239.49) 145.066 ms 216.239.46.52 (216.239.46.52) 138.837 ms 138.822 ms
18 216.239.46.157 (216.239.46.157) 170.720 ms 170.597 ms 167.122 ms
19 72.14.239.12 (72.14.239.12) 175.916 ms 171.714 ms 175.805 ms
20 72.14.233.59 (72.14.233.59) 177.485 ms 173.413 ms 173.889 ms
21 209.85.250.124 (209.85.250.124) 308.744 ms 284.685 ms 279.112 ms
22 66.249.94.105 (66.249.94.105) 334.432 ms 334.429 ms 335.082 ms
23 209.85.244.113 (209.85.244.113) 332.150 ms 335.036 ms 331.269 ms
24 sin01s14-in-f14.1e100.net (173.194.117.14) 330.086 ms 327.402 ms 330.793 ms
Are you still experiencing this?
Have another answer? Share your knowledge.