Johann,

We don't have a lot of information to work off of here; therefore the
culprit could be a lot of things. Typically high memory usage is tied
to how your application processes data.  I've created applications
serving 4 TPS against a 300MB database, with memory usage between
70-80MB and CPU usage around 15%.  I segment the data and only pull
what is needed.  That is to say, I avoid transactions that touch the
entire database for reads or writes with the exception of row counts.
Here's a few things to think about in troubleshooting the issue:

1) What is your transaction volume and how large or complex is the
database?
2) When you run your application locally under light load, how much
memory is used?
3) Database efficiency does not translate to your application using
less memory unless you are using an embedded database; and database
tuning can be an arcane science
4) Database complexity does not automatically translate to your
application using more memory (again, assuming you're not using an
embedded database): Your application and your database are in separate
processes.
5) Do you have an option to store most frequently accessed information
in memcache?  This would save on database reads/writes and offload
some of your memory requirements.  I know Webfaction supports
memcached.

Cheers,
--Scott

On Sep 21, 9:47 am, Johann Spies <johann.sp...@gmail.com> wrote:
> Yesterday for the first time I deployed web2py on a commercial
> platform (Webfaction) and today I received two messages from
> Webfaction that I was using more memory (135Mb) than what the Shared 1
> option allowed for (80Mb).  And that was before the application was in
> full use!   I have requested an upgrade to Shared 3.
>
> Now my question: How do I keep memory usage down on such a platform
> when I have to serve 1. a fairly complex database and 2. a possibility
> of a lot of data? I chose Postgresql as database thinking that with
> the efficiency of Postgresql as backend I would avoid using too much
> memory.
>
> Regards
> Johann
>
> --
>     "The fool hath said in his heart, There is no God..."
>                                Psalm 14:1

Reply via email to