Web Analytics Made Easy -
StatCounter How might they do it? - CodingForum


No announcement yet.

How might they do it?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How might they do it?

    I was taking a look through CampFire (http://www.campfirenow.com). (If you don't know if it, just use an ajax "shoutfox" for reference I guess)

    The system polls the server every 3 seconds for new messages/events/etc.

    Unless I'm totally out of it, my thoughts are that each poll results in queries:
    - Check for latest messages
    - Check for members in room

    That would mean 2 queries for each of the above every 3 seconds. Surely that isn't the way it's done though, as I would think that would create massively unnecessary serverload.

    Any ideas how to more efficiently accomplish such a task?

  • #2
    the queries wouldn't need to actually be executed on every poll, they could quite easily be cached for a few seconds (meaning that the query-overhead is the same, no matter how many users).
    two queries every 3 seconds isn't really that much, but if it were done independently for each user, it would grow quite a lot.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com