Could you please help me?
I developed web-based sysytem wich send async requests to server. Server takes big data from db and cache it. It takes ~5 sec. Next call Server search in cache so it takes ~ 0.05 sec.
For first time 5 sec is ok, but if I send more than 5 async requests in one time each thread create cache so it takes first time more than 20 sec.
How can I improve this?
Could you please help me? I developed web-based sysytem wich send async requests to
Share
I’ve had this before, the solution is to marshal all the requests into a queue of some sort or set a busy flag up in the database/cache so that subsequent requests know something is working on the issue.
So first request flags as busy and performs request. Following requests see that it’s busy and will wait until the flag is no longer marked as busy. Those requests should then be able to pull the cached copy.