Question

Youtube APIs taking longer on droplet

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::

<?php include ‘curl.php’; $time_start = microtime(true); $data=curlGet(‘https://gdata.youtube.com/feeds/api/standardfeeds/most_popular?alt=json&format=5&time=today&max-results=5’);

$time_end = microtime(true); $time = $time_end - $time_start;

echo “Did nothing in $time seconds\n”;

?>

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.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Are you still experiencing this?

Here is the traceroute output to google servers. <br> <br>traceroute to gdata.youtube.com (173.194.117.14), 30 hops max, 60 byte packets <br> 1 192.241.143.1 (192.241.143.1) 0.338 ms 0.304 ms 0.367 ms <br> 2 69.55.60.18 (69.55.60.18) 0.264 ms 0.264 ms 0.253 ms <br> 3 nyk-b6-link.telia.net (62.115.34.13) 0.464 ms 0.446 ms 0.506 ms <br> 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 <br> 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 <br> 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 <br> 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 <br> 8 72.14.212.90 (72.14.212.90) 103.894 ms 100.596 ms 100.586 ms <br> 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 <br>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 <br>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 <br>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 <br>13 72.14.242.167 (72.14.242.167) 109.627 ms 102.428 ms 96.504 ms <br>14 72.14.235.91 (72.14.235.91) 107.042 ms 102.813 ms 107.070 ms <br>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 <br>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 <br>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 <br>18 216.239.46.157 (216.239.46.157) 170.720 ms 170.597 ms 167.122 ms <br>19 72.14.239.12 (72.14.239.12) 175.916 ms 171.714 ms 175.805 ms <br>20 72.14.233.59 (72.14.233.59) 177.485 ms 173.413 ms 173.889 ms <br>21 209.85.250.124 (209.85.250.124) 308.744 ms 284.685 ms 279.112 ms <br>22 66.249.94.105 (66.249.94.105) 334.432 ms 334.429 ms 335.082 ms <br>23 209.85.244.113 (209.85.244.113) 332.150 ms 335.036 ms 331.269 ms <br>24 sin01s14-in-f14.1e100.net (173.194.117.14) 330.086 ms 327.402 ms 330.793 ms <br>

Its happening with both v2 and v3 APIs. For example this standard feeds api <br> <br>gdata.youtube.com/feeds/api/standardfeeds/most_popular?alt=json&format=5