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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:17:01+00:00 2026-05-23T03:17:01+00:00

Why is HTTP-Polling so laggy? What I have is a button, and whenever a

  • 0

Why is HTTP-Polling so laggy?

What I have is a button, and whenever a user clicks it a MySQL database field gets updated and the value is displayed to the user. I’m polling every 800 milliseconds and it’s very laggy/glitchy. Sometimes when clicking the button it doesn’t register it. And I actually need to be polling quite a bit more frequent than every 800 milliseconds.

This is also with just 1 user on the website at a time… When in the end there is going to be many at once.

  • 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-23T03:17:02+00:00Added an answer on May 23, 2026 at 3:17 am

    HTTP-streaming/Long-polling/Websockets instead of polling

    When you need real-time information you should avoid polling(frequently). Below I would try to explain why this is wrong. You could compare it to a child in the back of your car screaming every second “are we there yet” while you are replying “we are not there yet” all the time.

    Instead you would like to have something like long-polling/HTTP-streaming or websockets. You could compare this to a child in the back of your car telling you to let him know when “we are there” instead of asking us every second. You could imagine this is way more efficient then the previous example.

    To be honest I don’t think PHP is the right tool for this kind of applications(yet). Some options you have available are:

    hosted solutions:

    • http://pusherapp.com:

      Pusher is a hosted API for quickly,
      easily and securely adding scalable
      realtime functionality via WebSockets
      to web and mobile apps.


      Our free Sandbox plan includes up to
      20 connections and 100,000 messages
      per day. Simply upgrade to a paid plan
      when you’re ready.

    • http://beaconpush.com/

      Beaconpush is a push service for
      creating real-time web apps using
      HTML5 WebSockets and Comet.

    host yourself:

    • http://socket.io:

      Socket.IO aims to make realtime apps
      possible in every browser and mobile
      device, blurring the differences
      between the different transport
      mechanisms

    When becoming very big the “host yourself” solution is going to less expensive, but on the other hand using something like pusherapp will get you started easier(friendly API) and also is not that expensive. For example pusherapp’s “Bootstrap” can have 100 concurrent connections and 200,000 messages per day for $19 per month(but when small beaconpush is cheaper => do the math :)). As a side-note this plan does not include SSL so can not be used for sensitive data. I guess having a dedicated machine(VPS) will cost you about the same amount of money(for a simple website) and you will also have to manage the streaming solution yourself, but when getting bigger this is probably way more attractive.


    Memory instead of Disc

    whenever a user clicks it a MySQL
    database field gets updated and the
    value is displayed to the user

    When comparing disc I/O(MySQL in standard mode) to memory it is extremely slow. You should be using an in-memory database like for example redis(also has persistent snapshots) or memcached(completely in memory) to speed up the process. I myself really like redis for it’s insane speed, simplicity and persistent snapshots. http://redistogo.com/ offers a free plan with 5MB of memory which will probably cover your needs. If not the mini plan of $5 a month will probably cover you, but when getting even bigger a VPS will be cheaper and in my opinion the prefered solution.


    Best solution

    The best solution(especially if you are getting big) is to host socket.io/redis yourself using a VPS(cost money). If really small I would use redistogo, if not I would host it myself. I would also start using something like beaconpush/pusherapp because of it’s simplicity(getting started immediately). Hosting socket.io(advice to play with it on your own machine for when getting big) is pretty simple, but in my opinion more difficult than beaconpush/pusherapp.

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

Sidebar

Related Questions

I have a Runnable running inside a ThreadPoolExecutor long polling on an http request
I have a web server hosting an HTTP chat application that works with long-polling.
I have an Zend–based application that uses long polling. Basically it makes a HTTP
We have an app with a long polling scheme over HTTP (although this question
I have an XML document at a Url http://test.com/data.xml which I am currently polling
Is this chat using long polling or http streaming ? http://go-mono.com/moonlight/chat.aspx
The overhead for long polling is http connection establishment, also on server side the
I am very tempted to use long wait http or periodic polling by the
I am writing a little app similar to omegle. I have a http server
How can I do long-polling using netty framework? Say for example I fetch http://localhost/waitforx

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.