On Jan 9, 4:38 pm, JLIST <[EMAIL PROTECTED]> wrote:
> Hi,
>
> If I understand correctly, web.py is multithreaded internally so
> one web.py instance, when used with lighttpd in FastCGI mode, should
> be able to serve multiple requests. However, Python does not use
> native OS threads so its threading is not as efficient as other
> languages such as C or Java. With lighttpd, I can also run multiple
> web.py processes. I used to run 50-200 PHP processes on a physical
> server but I can not really do this now because 1. Python takes a lot
> of virtual memory and

It is not virtual memory that is the real problem, it is resident
memory, or actual physical memory that has been used by the
application. The web.py framework is actually one of the most light
weight Python web systems around, so unless your application itself
sucks memory up real bad, it should be manageable.

> 2. I'm using a OpenVZ VE so the memory is limited
> (the problem was discussed on this list earlier.)

But then certain VPS systems seem to set stupid restrictions on
theoretical virtual memory usage as well, which does cause problems
but they are because of the use of Linux and not Python. Not sure is
this is one of them. :-)

The real problem in all of this is actually the Linux per thread stack
size. If using Python 2.5 you can control it using
thread.stack_size().

For more details see section 'Memory Constrained VPS Systems' of:

  http://code.google.com/p/modwsgi/wiki/ApplicationIssues

Not for FASTCGI, but still explains it and mentions the threading
function to alter stack size.

> I suppose I could start 5-10 Python processes but they suck lot of
> memory. I'm still trying to determine the optimal configuration. Any
> tip or guideline is appreciated.

Using a single or small number of threaded processes is still
preferable, you just need to configure things properly.

Can't say more than that without you actually giving some real world
figures of actual RSS and VIRT memory usage and indicate if OpenVZ is
one of these overly restrictive VPS systems.

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to