Designing a Web Application for High Performance

Scalable Web Application Design | Serving 1000 Requests per Second

Question

How should a web application be designed to work on a platform where up to 1000 requests per second can be served?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

When designing a web application to work on a platform that can handle up to 1000 requests per second, the following factors should be considered:

A. Use algorithms like random early detection to deny excessive requests.

Random early detection (RED) is a congestion avoidance algorithm that drops packets randomly when the network is congested. It is not suitable for controlling the number of requests in a web application. Using RED in a web application would result in a poor user experience, as users' requests would be randomly dropped, causing frustration and potential data loss.

B. Set a per-user limit (for example, 5 requests/minute/user) and deny the requests from the users who have reached the limit.

Setting a per-user limit is a common method of controlling the number of requests that a web application receives. By setting a limit, the application can prevent a single user from overloading the system with requests. When a user reaches the limit, their requests can be denied or queued until the limit is reset. This approach ensures that all users have a fair share of resources and that the system is not overloaded.

C. Only 1000 user connections are allowed; further connections are denied so that all connected users can be served.

Limiting the number of user connections is a straightforward approach to managing the number of requests a web application receives. By limiting the number of users who can access the application simultaneously, the system can ensure that it can serve all connected users without overloading. This approach can be effective if the application is designed to handle a limited number of users, but it may not be suitable for applications that need to scale up quickly.

D. All requests are saved and processed one by one so that all users can be served eventually.

Queuing requests is another common method of managing the number of requests that a web application receives. By queuing requests, the application can ensure that all users' requests are processed eventually, even if the system is currently overloaded. This approach can result in slower response times, but it ensures that all users are served fairly and that data is not lost.

In conclusion, the most effective approach for managing the number of requests that a web application receives depends on the application's specific requirements. Setting a per-user limit and queuing requests are generally effective approaches for managing the number of requests that a web application receives, while limiting the number of user connections can be effective for smaller-scale applications.