Could somebody please give some tips about how to improve web2py performance (WSGI apache + MySQL)? I've a credit card applicatoin that receives Ajax demands in the client every couple of seconds to gain access to database and return results. The server is really a Ubuntu machine with 640 Megabytes RAM (virtual server on Amazon . com EC2, no Xserver).

You will find 4 WSGI-processes in apache config. A recently began apache2 instance leaves ca 300 Megabytes free, but following a hundred demands the machine gets slow and you will find lengthy delays. Restarting the server helps you to release memory (I setup cron to get it done every half an hour - however i guess it's bad practice).

Will be thankful for any advance! A far more effective server isn't a choice yet due to your budget.

Thanks ahead of time!

Make certain you utilize connection pools. Constitutes a large difference.

Also don't use cron. Make use of a background process. Cron may eat more memory than necessary.

Read 11 Deployment Recipes from the Web2Py book ! You will find lots of methods to improve web2py performance

If you work with background scripts, make certain to commit() or rollback() your transactions. This isn't needed on web2py atmosphere. But when you're running outdoors scripts it will likely be needed.