Improving web2py performance - databases and apache

Can someone please give some advice on how to improve web2py performance (WSGI apache + MySQL)? I have an application that receives Ajax requests from the client every few seconds to access the database and return the results. The server is a Ubuntu computer with 640 MB of RAM (virtual server on Amazon EC2, no Xserver).

There are 4 WSGI processes in apache configuration. A recently launched instance of apache2 leaves about 300 MB for free, but after a hundred requests the system slows down and there are long delays. Restarting the server helps free up memory (I configured cron to do this every 30 minutes, but I think this is bad practice).

We will be grateful for any step! A more powerful server is not yet an option due to the budget.

Thanks in advance!

+3
source share
3 answers

Make sure you use connection pools. Makes a big difference.

Also do not use cron. Use a background process. Cron can consume more memory than necessary.

+2
source

Read 11 Deployment Recipes in Web2Py! There are many ways to improve web2py performance.

+1
source

, () rollback(). web2py. , .

+1

Source: https://habr.com/ru/post/1785980/


All Articles