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 7745629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:04:10+00:00 2026-06-01T10:04:10+00:00

I have a website that is implemented in php/mysql, and is hosted at hostmonster

  • 0

I have a website that is implemented in php/mysql, and is hosted at hostmonster (shared hosting).

I am planning to incorporate a chat feature in my website, that enables users to chat with each other. There are approx. 1000 users on my site.
Currently, i have implemented an ajax strategy that sends requests to the server on a periodical basis (say, every 4 seconds) to get the json response about online users and messages.

This is the sample code that sends requests:

var timer, delay = 4000;

timer = setInterval(function(){
    $.ajax({
      type: 'POST',
      url: 'update.php?user_id=2',
      success: function(html){
        $('.chat_messages').append(html);
      }
    });
}, delay);

But as i see, more the number of users, more the requests for every 4 seconds, and more burden on Apache server and database to deliver the response.

So i am planning for an alternate solution, that has no overhead on the server.
I have heard about few servers like APE, Nginx, Node.js, StreamHub that use COMET/reverse ajax technology to serve the requests, and are efficient for my purpose.

But the problem is that, i dont have permission to install a third party server on my hostmonster cpanel.
Is there any other way around, like HTML5 web sockets?

EDIT: By the way, i am also interested to rebuild my application on Java, if there is a viable solution.

  • 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-06-01T10:04:11+00:00Added an answer on June 1, 2026 at 10:04 am

    As you figured out requesting what’s new ever 4 seconds for each user will not scale. And it won’t even work for a chat application as delays between messages would be too long, rendering your chat unusable.

    If I were you I would first look into drop-in chat solutions that don’t require any (or very little) programming on your part. You usually just insert some JavaScript code into your page, and the third party that provides the chat does all the rest (serving files, running the chat server, etc …). I haven’t used any of the avaliable solutions so I can’t recommend any, but a quick google search yielded this: https://www.meebo.com/websites/ this should give you a general idea of what I’m talking about.

    If the above will not suite you then you have a quite a large project ahead of you. What you will have to do is write a websocket server (and then your chat application on top of that). If I wanted to explain how to do it to you I could write a book about it, so I’ll just say this: google is your friend. You are not the first who needs this. So search stackoverflow for tips and there are also open source PHP websocket servers out there (this being one).

    Good luck.

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

Sidebar

Related Questions

I have a website that has approx 1000 different strings in a mysql database
I have a website that I made and I am planning to redo it.
I have implemented OpenID on my website, so that a user can successfully use
So basically I have website that has names of cities that can be checked
I have a website that uses JSP as its view technology (and Spring MVC
I have a website that tells the output is UTF-8, but I never make
I have a website that doesn't seem to redirect from non-www to www. My
I have a website that talks to a remote WCF web service. Both use
I have a website that's sort of a Craiglist type app. In my Database,
I have a website that is updated regularly and I am having a problem

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.