38.7k views
5 votes
What value should I use for my long-poll timeout?

1 Answer

5 votes

Final answer:

The ideal long-poll timeout value varies, typically ranging from 15 to 60 seconds, and depends on the application's need for real-time updates, server resources, and user experience considerations. Adjustments should be made based on server performance.

Step-by-step explanation:

Deciding on the appropriate long-poll timeout value can be essential in optimizing the balance between real-time updates and system resource conservation.

An optimal value is often contingent upon your specific application needs and network circumstances.

A typical range for long-poll requests is between 15 to 30 seconds; however, if your server and clients can handle it, going up to 60 seconds may be more efficient. The key factors to consider include the expected frequency of updates, resource usage, and user experience.

If updates are frequent and immediate delivery is critical, a shorter timeout may be necessary. Conversely, if updates are less frequent or timely delivery is less critical, a longer timeout could be more efficient and reduce server load. You'll want to monitor server performance and make adjustments as needed.

User Bouzid Zitouni
by
8.3k points