45 messages in com.googlegroups.pylons-discussRe: Reducing pylons app memory usage?
FromSent OnAttachments
Marcin Kasperski16 Oct 2007 07:21 
Max Ischenko16 Oct 2007 10:46 
Marcin Kasperski17 Oct 2007 02:59 
Dalius Dobravolskas17 Oct 2007 03:04 
Christoph Haas17 Oct 2007 07:12 
Max Ischenko17 Oct 2007 11:02 
Ben Bangert17 Oct 2007 13:19 
Christoph Haas17 Oct 2007 14:23 
Ben Bangert17 Oct 2007 16:32 
Graham Dumpleton17 Oct 2007 16:56 
Ian Bicking17 Oct 2007 16:58 
Marcin Kasperski18 Oct 2007 03:18 
Ben Bangert18 Oct 2007 11:34 
Philip Jenvey18 Oct 2007 12:22 
Ben Bangert18 Oct 2007 12:32 
Ian Bicking18 Oct 2007 12:37 
Marcin Kasperski19 Oct 2007 02:35 
Marcin Kasperski19 Oct 2007 02:42 
Graham Dumpleton21 Oct 2007 16:12 
Jon Rosebaugh21 Oct 2007 16:48 
Graham Dumpleton21 Oct 2007 18:20 
Marcin Kasperski22 Oct 2007 05:11 
Bob Ippolito22 Oct 2007 05:28 
Bob Ippolito22 Oct 2007 05:33 
Graham Dumpleton22 Oct 2007 16:23 
Graham Dumpleton22 Oct 2007 16:25 
Cliff Wells22 Oct 2007 17:52 
Graham Dumpleton22 Oct 2007 17:59 
Cliff Wells22 Oct 2007 18:53 
Graham Dumpleton22 Oct 2007 22:58 
Marcin Kasperski31 Oct 2007 08:39 
Ben Bangert31 Oct 2007 08:56 
Marcin Kasperski31 Oct 2007 09:38 
Marcin Kasperski31 Oct 2007 09:40 
Ben Bangert31 Oct 2007 12:08 
Graham Dumpleton31 Oct 2007 15:52 
Graham Dumpleton31 Oct 2007 16:44 
Ben Bangert31 Oct 2007 17:04 
Ben Bangert31 Oct 2007 17:08 
Marcin Kasperski05 Nov 2007 03:53 
Marcin Kasperski05 Nov 2007 04:08 
Marcin Kasperski05 Nov 2007 04:33 
Alberto Valverde05 Nov 2007 04:57 
Marcin Kasperski05 Nov 2007 06:03 
Ian Bicking05 Nov 2007 06:58 
Subject:Re: Reducing pylons app memory usage?
From:Ian Bicking (ianb@public.gmane.org)
Date:10/17/2007 04:58:24 PM
List:com.googlegroups.pylons-discuss

Ben Bangert wrote:

On Oct 17, 2007, at 2:24 PM, Christoph Haas wrote:

Why am I still confused by the top columns after 15 years of UNIX usage. Yes, the virtual usage is around 100 MB while the resident size is at about 18 MB.

Of course, since most of this ram use is from the libraries, it means it will increase very little should you run multiple Pylons apps in a single process. You can do this with the ini file to tell Paste to load multiple apps, and even host them on different virtual hosts, that'll save you some ram if you're running multiple Pylons apps on the same machine.

It'd be hot if you could load up Pylons and then fork for each app, sharing a bunch of the libraries.

You can't. But such a thing is not impossible. Mmm... a whole entry point:

[app:otherprocapp] use = egg:DeploySubprocess app = config:%(here)s/myapp.ini # maybe also: add_libraries = /path/to/some/virtualenv-or-workingenv/

It'd fork, use that add_libraries to do a site.addsitedir(), and maybe start up with flup's scgi or fcgi server, with s/fcgi_app on the unforked site, forwarding any requests over, and doing a little process management (just passing over signals, so that you can kill both as a unit by killing the parent).

I'm guessing 200 lines of code. Who wants to write it?

Note you won't notice the memory savings unless you look closely; it's hard to see shared memory. Surprisingly hard. But much of the memory will be shared between the master process and the forked subprocess.