0

i'm still new to web developing but i made a little tool for me and my friends. it is supposed to send an ajax request every second to update a list of usernames of ppl who have signed up.

when i try it out alone, it works fine, but when i tried it out with 25 other people at the same time, everyone would get internal server errors...

here is the stripped down codesnippet:

function refreshLobby () {
  $.ajax({
    url: "core.php",
    type: "POST",
    data: {lobby: 1},
    success: function (output) {
      console.log(output);
      //irrelevant jquery html stuff
    }
  });
}

$(document).ready(function () {
  setInterval(function () {
    refreshLobby();
  }, 1000);
});

why is it working when i try it out alone, but starts bugging with internal server error when multiple people have it open at the same time ?

ivsterr
  • 128
  • 1
  • 7
  • Did you check your server-log to see what the error was? – Henrik Aasted Sørensen Aug 10 '15 at 12:24
  • 3
    You're going to need to find out what the actual error is. Check the logs, turn on error reporting, etc. Guessing at the problem isn't going to be of much use. Especially when you haven't shown *any server-side code* here. – David Aug 10 '15 at 12:26
  • I agree with @asim answer, you can do this by Node.js – Hardik Raval Aug 10 '15 at 12:56
  • 2
    Node.js is not a magic wand that magically solves scaling issues. Throwing out all the existing code and switching programming languages is rarely all that productive. – Quentin Aug 10 '15 at 13:05

0 Answers0