Here is a module that implements Least Recently Used caching using only python. This can be used on servers that don't have a dedicated caching system.
In my performance tests I hit the server with 200 requests per second for 60 seconds, 20 times, and averaged the results. Using --pycache vs no caching showed these improvements with a postgress database:
100% increase in average responses/requests served in 60 seconds (4,041 -> 8,094 requests server)
13% decrease in average request timeouts in 60 seconds (1715 -> 1484 timeouts)
92% decrease in average response time (546ms -> 46ms response time)
Additionally the server no longer became overwhelmed and unresponsive.
Here is a module that implements Least Recently Used caching using only python. This can be used on servers that don't have a dedicated caching system.
In my performance tests I hit the server with 200 requests per second for 60 seconds, 20 times, and averaged the results. Using --pycache vs no caching showed these improvements with a postgress database:
100% increase in average responses/requests served in 60 seconds (4,041 -> 8,094 requests server) 13% decrease in average request timeouts in 60 seconds (1715 -> 1484 timeouts) 92% decrease in average response time (546ms -> 46ms response time)
Additionally the server no longer became overwhelmed and unresponsive.