Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6625339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:45:47+00:00 2026-05-25T21:45:47+00:00

I have a long-term goal of eventually creating a chat sort by any means,

  • 0

I have a long-term goal of eventually creating a chat sort by any means, but for now I’d like to just have a simple one with some Mysql and ajax calls.

To make the chat seem instant, I’d like to have the ajax request interval as fast as possible. I get the feeling if it’s as low or lower than a second, it’s going to bog down the browser, the user’s internet, or my server.

Assuming the server doesn’t return anything, how much bandwidth and cpu/memory would the client use with constant, one second apart ajax calls?

edit: I’m still open to suggestions on how I can do a chat server. Anything that’s possible with free hosting from x10 or 000webhost. I’ve been told of Henoku but I have no clue how to use it.

edit: Thanks for the long polling suggestion, but that uses too much cpu on the servers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:45:48+00:00Added an answer on May 25, 2026 at 9:45 pm

    One technique that can be used is to use a long-running ajax request. The client asks if there’s any chat data. The server receives the request. If there’s chat data available, it returns that data immediately. If there is no chat data, it hangs onto the request for some period of time (perhaps two minutes) and if some chat data appears during that two minutes, the web request returns immediately with that data. If the full two minutes elapses and no chat data is received, then the ajax call returns with no data.

    The client can then immediately issue another request to wait another two minutes for some data.

    To make these “long” http requests work, you just need to make sure that your underlying ajax call has a timeout set for longer than the time you’ve set it for on the server.

    On the server, you need to do an efficient mechanism of waiting for data, probably involving semaphores or something like that because you don’t want to be polling internally in the server either.

    Doing it this way, you can get near instantaneous response on the client, but only be making 30 requests an hour.

    To be friendly to the battery of a laptop or mobile device, you need to be sensitive to when your app isn’t actually being used (browser not displayed, not the current tab, etc…) and stop the requests during that time.

    As to your other questions, repeated ajax calls (as long as they are spaced at least some small amount of time apart) don’t really use much in the way of CPU or memory. They may use battery if they keep the computer from going into an idle mode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been a long-term .NET developer, but dabble in Java and PHP development
I have a string like this 4741:GREEN,CIRHOSIS,ORANGE,Long-term,GREEN,HIS B CHIC,4642:GREEN,CRHOSIS,GREEN,HSysk B CC, the sting contains
I've recently started coding in C++, but I have long time writing in C.
How long have the MySQL XML functions like ExtractValue() and UpdateXML() been supported? A
I have a few long term processes and temporary processes in Python. While shell
I am a long-term user of Java (but I am a scientist and not
I'm about to start a long term windows application project but not sure which
I'm writing mostly embedded code at work. We have a big long-term project that's
One long term project I have is working through all the exercises of SICP.
My client is a long term rental agency. So we have Goods pk modelId

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.