Why is the web server throttling ajax - DDoS requests?

I have a problem with an HTML5 web application where I repeat data updates through an ajax request every two seconds. The first two or three go through 175 ms, but after that they slow down to 500 ms, since then. The business company swears that they are not them. I did a simple test - see Test Scripts below. This is not my application, as this test script has the same results. My question is: Is this a hosting management tool, thinking it's a DDoS attack, or is there something I can do to stop this throttling and slow down ajax requests?

Index file:

<!DOCTYPE html> <html> <head> <script src="jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ var count = 0; var my_timer = setInterval(function(){ $.ajax({url: "test.php", success: function(result){ $("#div1").html(result); }}); count = count + 1; if(count == 10) clearInterval(my_timer); },2000); }); }); </script> </head> <body> <div id="div1">Let jQuery AJAX Change This Text</div> <br> <button>Get External Content</button> </body> </html> 

Php file:

 <?php echo date('h:i:s'); ?> 
+5
source share
1 answer

[SOLVED] After much research on this issue. I think I finally figured it out, or at least found a workaround. Apparently CentOS and / or Plesk Php blocked. As I decided, the problem was re-rendering the server on openSUSE 13.1. With this OS, Ajax requests seem to work as they should. This is just an assumption, but it looks like PHP and / or CentOS software update software also have errors. Updates do not seem to work well and cause problems. So for now, I will not correct what is not broken.

Thanks for entering the comments made by commentators, as he pointed me in the right direction.

+1
source

All Articles