Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I know if socketIO will offer any benefit over long-polling?
    primarykey
    data
    text
    <p>I recently inherited a PHP application using the CodeIgniter framework - which handles authentication, user sessions, CRUD operations, routing, templating, and pretty much all aspects of the application just beautifully. However, one feature requires the use of long-polling. Certain admins need near real-time updates on what other users are doing. Everything is working fine now for a few hundred users, but we're scaling up to support a few thousand, and I'm worried the long-polling will cause some performance issues.</p> <p>Here's the basics of the long-poll process:</p> <ol> <li><p>The browser makes a GET request which kicks off the long-poll process.</p></li> <li><p>The long-poll process checks the timestamp of a txt file every 1/4 seconds.</p></li> <li><p>a) If the txt file is updated, the long-poll process returns the changes to the browser and the view is updated.</p> <p>b) If no changes are found in 25 seconds, the long-poll ends and returns null.</p></li> <li><p>Repeat step 1.</p></li> </ol> <p>This process takes place outside of the codeigniter framework. I'm thinking that it's a good idea to replace this process with a socket.io implementation. </p> <p>Will socket.io be a better solution than the long-polling? If so, what convincing evidence do I have without actually building a demo and doing load testing? It seems like a good idea in my head, but I need to justify the time and effort to make the switch.</p> <p>Also, sorry if this doesn't make sense, or 'is not a real question' by SO standards. I'm pretty new to back-end scalability and most of this stuff is brand new to me. Please offer helpful guidance for rewording (if needed) before downvoting. Thanks.</p> <p>EDIT: The preference here is to keep things as-is, because it's expensive to rip out code and replace it with new things, especially when new things are untested. So I guess my question is, when/if the long-polling solution hits a brick wall, will socket.io be a viable replacement?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload