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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:44:33+00:00 2026-06-10T20:44:33+00:00

I was implementing the server-push content using comet to the client browser. There should

  • 0

I was implementing the server-push content using comet to the client browser.
There should be updates when mysql got insert then something will happen to client, so I’m currently doing by PHP like this:

PHP
  while (check database if update is there)
  {
    usleep(10000); 
   // do write json
  }

It actually working, but what happening to me is my hosting(shared) run out of resource even when I just test with 5 simultaneous clients.
CPU is 40% loading at this moment and cause account disable.

So please someone advise any idea how to trigger php to send out the new update only without looping check.

  • 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-10T20:44:34+00:00Added an answer on June 10, 2026 at 8:44 pm

    I think your problem is that you have a slight error regarding usleep. The parameter should be:

    micro seconds
    Halt time in micro seconds. A micro second is one millionth of a
    second.

    Your script currently halts for 0.01 seconds instead of 10 seconds, which, I assume, is not what you wanted.


    use:

    usleep(10 * 1000000);
    

    or:

    sleep(10);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing a push notification in my application. Server: php Client: iphone Sever
I'm implementing typical server-push (comet) application. I'm choosing between two options: the longpoll XHR
I am confused about using php or python for implementing server program . I
I'm implementing a small HTTP server with Ruby using Mongrel. My code currently looks
I'm implementing a web - based application using silverlight with an SQL Server DB
I am in process of implementing a REST API server using Apache CXF JAX-RS
BOSH (Bidirectional-streams Over Synchronous HTTP) is a sneaky way of implementing 2-way client-server communication
What are the current options for implementing server push with a dotcloud app hosted
I am implementing both server and client side of a simple file download program.
I am designing a client server socket program using TCP/IP. The server listens on

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.