Comparison of Real-time Communication Performance between Web sockets using Socket.io and Long-Polling using Ajax

Presenter(s)

Ei Myatnoe Aung, Early Year Research Presenter

Abstract

Short polling, long polling, server-sent events, and web sockets are some of the current techniques used to accomplish real time communication in web applications. They are based on a client-server communication model. Among these techniques, long polling and web sockets are the most popular and are more frequently used for real life projects. Long polling keeps the connection alive until there is valid response from the server, and terminates the connection tarts a new connection. Web sockets keep the connection open regardless until client or server leaves the connection. This study compares the performance of two most popular real-time communication techniques, long polling and web sockets. Real-time data dashboard was implemented in two versions: one with web sockets using Socket.io library and another in long polling using Ajax. The database in the backend was constantly updated at random intervals and all the changes were sent back to client side at real time through the respective real time techniques. The time needed by the two technologies based on the number of requests made, the total response time, and the CPU utilization were measured. The final testing results suggest that web sockets performance is comparable to that of long polling.

College

College of Science & Engineering

Department

Computer Science

Campus

Winona

First Advisor/Mentor

Mingrui Zhang

Second Advisor/Mentor

Sudharsan Iyengar

Start Date

4-19-2023 9:00 AM

End Date

4-19-2023 10:00 AM

Presentation Type

Poster Session - Early-Year RCA

Format of Presentation or Performance

In-Person

Session

1a=9am-10am

Poster Number

2

Share

COinS
 
Apr 19th, 9:00 AM Apr 19th, 10:00 AM

Comparison of Real-time Communication Performance between Web sockets using Socket.io and Long-Polling using Ajax

Short polling, long polling, server-sent events, and web sockets are some of the current techniques used to accomplish real time communication in web applications. They are based on a client-server communication model. Among these techniques, long polling and web sockets are the most popular and are more frequently used for real life projects. Long polling keeps the connection alive until there is valid response from the server, and terminates the connection tarts a new connection. Web sockets keep the connection open regardless until client or server leaves the connection. This study compares the performance of two most popular real-time communication techniques, long polling and web sockets. Real-time data dashboard was implemented in two versions: one with web sockets using Socket.io library and another in long polling using Ajax. The database in the backend was constantly updated at random intervals and all the changes were sent back to client side at real time through the respective real time techniques. The time needed by the two technologies based on the number of requests made, the total response time, and the CPU utilization were measured. The final testing results suggest that web sockets performance is comparable to that of long polling.