Bandwidth Question

  • Page

    of 1

    Previous Next
  • catterz 15 Sep 2008 12:15:11 8,763 posts
    Seen 1 year ago
    Registered 12 years ago
    As some of you may know, I'm in the process of writing a website. I've found a good way to build chat rooms in Javascript, php and mySQL which involves polling the database on a timed delay to check for updates to the table and then pulling that data into a parent window (done to counter page flicker).

    The thing is, I've noticed that this may cause a high amount of bandwidth from even a single user. Apart from changing the timer on the refresh rate, does anyone have any ideas how I might lower the bandwidth usage?

    Still stalking this place, old-school style (UID: 1053)

  • JetSetWilly 15 Sep 2008 12:30:21 5,721 posts
    Seen 2 weeks ago
    Registered 9 years ago
    Have a store procedure at the database end only pushing stuff out when required?
  • catterz 15 Sep 2008 13:45:17 8,763 posts
    Seen 1 year ago
    Registered 12 years ago
    Explain please?

    Still stalking this place, old-school style (UID: 1053)

  • JetSetWilly 15 Sep 2008 14:08:43 5,721 posts
    Seen 2 weeks ago
    Registered 9 years ago
    If I understand you right you've got the client-side javascript polling the database asking "Anything changed I need to know about?" at regular intervals. If that's taking up lots of bandwidth could you attack things from the other way round? Use a stored procedure or a trigger that pushes stuff from the database to the client when something changes, thus reducing the traffic.
  • catterz 15 Sep 2008 14:23:32 8,763 posts
    Seen 1 year ago
    Registered 12 years ago
    That would be ideal, unfortunately I'd need to use asp or another server-side scripting language, which are unavailable on the servers I'm currently running. Probably isn't an alternative in that case.

    Still stalking this place, old-school style (UID: 1053)

  • Steviebdotnet 16 Sep 2008 10:10:18 21 posts
    Seen 6 years ago
    Registered 6 years ago
    Tbh the bandwidth shouldn't be that high if it's only serving text. Even with hundreds of users you are still only going to be serving the most basic of data.

    If you have a copy of the script I'll happily test it on a test environment to test bandwidth usage.
  • Page

    of 1

    Previous Next
Log in or register to reply