简体   繁体   中英

how to handle 1000 concurrent user requests per second in asp.net web api

We are working with web API to handle a 1000 concurrent user request per second. We are hitting the API through the console application. we have getting message 500 internal server error.so how we can handle the concurrent user request smoothly?

(Adding a case -- In 100 hits - 98 hits are pass(200- ok) and 2 are fail- error 500. all time same parameters?

You need to keep your main attention on 2 things - on asp.net and database side.

While developing asp.net application for such scenario you might find it useful to use asynchronous controllers/pages (http://msdn.microsoft.com/en-us/library/ee728598(v=vs.100).aspx ) to optimize the load on your server and ensure that website will cope with multiple requests without huge delays. Another important thing to consider is the caching layer - you can load the questions at the very beginning and cache them, in turn minimizing the time for accessing your pages.

Also, you should carefully think about your database side and you might find it useful to utilize query hints (READPAST, NOLOCK, ROWLOCK) and design the tables in a smart way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM