I'm currently running 5 instances of bjoern per 3 sites, 1 instance of
nginx with 4 worker processes, and Postgres which spawns 5 processes
total for itself. All in all this totals to 102MB memory used in idle
mode (my sites are not active now so there are no visitors to speak
of).

Since Bjoern is a single-threaded on-blocking WSGI server, you can get
more juice out of it if you spawn two processes at different ports,
and allow lighty or nginx to load-balance. I do that with two of my
apps, and one doesn't use a load balancer (that's why I have 5
application processes). Of course, you don't get any improvement if
your server's CPU is sinlge-core, but on multi-core servers you will
get a bit of a boost.

Btw, you only need 2 lines of code (including the import line) to
start serving with Bjoern. ;)

On Mon, Apr 18, 2011 at 10:54 PM, Ken <qichangx...@gmail.com> wrote:
> how many sites do you running?
> in Apache with python, it will one site one process to liston it. and a
> process about 20m memory...
> you can: ps -u yourname -o pid,command
> (about)
> and check it
>
> On Mon, Apr 18, 2011 at 11:53 PM, Ken Dere <kpd...@verizon.net> wrote:
>>
>> I have created a scientific application in Python that I typically use
>> interactively and I have modified it so that it can be used on the web.
>>  It
>> imports various modules such as numpy, scipy and matplotlib.
>>
>> I have it running on Webfaction with web.py with an apache2 wsgi web
>> server.
>> Things work fine except that they say I am running over my memory quota of
>> 120
>> mb.
>>
>> the way that i work is to save the current data set to a pickle file,
>> delete
>> the data sets and then unpickle them in the class that is called next.
>>
>> I have used heapy to monitor my memory usage and find that my biggest
>> objects
>> are a string followed by a tuple and I don't really understand how that is
>> happening.  I do see some numpy stuff but it is all much smaller.  All of
>> my
>> attempts (mostly using the 'del' statement) limit memory usage don't seem
>> to
>> work.
>>
>> So my first question is, is this sort of memory usage to be expected and I
>> should just up my memory quota on Webfaction?
>>
>> I can see that the Apache server uses a certain amount of memory just
>> standing
>> still.  Perhaps lighttpd might help?
>>
>> Any suggesting for how I might reduce my memory requirements?  The
>> documentation on heapy is not very helpful.
>>
>> thanks,
>>
>> Ken Dere
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "web.py" group.
>> To post to this group, send email to webpy@googlegroups.com.
>> To unsubscribe from this group, send email to
>> webpy+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/webpy?hl=en.
>>
>
>
>
> --
> http://t.sina.com.cn/qichangxing
> http://t.qq.com/qichangxing
> http://simple-is-better.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to webpy@googlegroups.com.
> To unsubscribe from this group, send email to
> webpy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to webpy@googlegroups.com.
To unsubscribe from this group, send email to 
webpy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to