Re: Pylons hosting on a VPS (memory usage)

2010-04-21 Thread cropr
I am running 3 pylons apps on a single VPS with 256 MB ram (no swap
space).  I am using apache in multi threaded mode and mod_wsgi.
Every 2 to 3 months I restart the apache server, because the apache
child processes gradually grow in memory size, reaching slowly the 256
MB limit on busy days.

Ruben

On 20 apr, 00:28, Alex a...@oxygencomputers.co.uk wrote:
 Hi all,

 Does anyone have any advice on hosting multiple Pylons apps in a low
 memory environment like a VPS. I've written a few apps using Pylons
 and it's great, so I'd like to use it for more. However the stuff I've
 used it for so far has justified running the apps on servers of their
 own, so I've been running them using paste behind lighty. However this
 seems to need quite a bit of RAM. I'd like to be able to host quite a
 few low traffic volume apps on the same VPS, but it seems that running
 several paste instances wouldn't be possible in the same way it's
 possible to host lots of low traffic PHP apps behind Apache and
 mod_php.

 Anyone have any advice on deployment?

 TIA.
 Alex

 --
 You received this message because you are subscribed to the Google Groups 
 pylons-discuss group.
 To post to this group, send email to pylons-disc...@googlegroups.com.
 To unsubscribe from this group, send email to 
 pylons-discuss+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/pylons-discuss?hl=en.

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



Re: Pylons hosting on a VPS (memory usage)

2010-04-21 Thread Graham Dumpleton


On Apr 21, 7:57 pm, cropr ruben.dec...@gmail.com wrote:
 I am running 3 pylons apps on a single VPS with 256 MB ram (no swap
 space).  I am using apache in multi threaded mode and mod_wsgi.
 Every 2 to 3 months I restart the apache server, because the apache
 child processes gradually grow in memory size, reaching slowly the 256
 MB limit on busy days.

You are presumably using daemon mode of mod_wsgi else this wouldn't
even likely be possible.

Anyway, read 'http://blog.dscpl.com.au/2009/11/save-on-memory-with-
modwsgi-30.html'. It explains how to counter the leaks in Python which
occur on an Apache restart.

Graham

 Ruben

 On 20 apr, 00:28, Alex a...@oxygencomputers.co.uk wrote:





  Hi all,

  Does anyone have any advice on hosting multiple Pylons apps in a low
  memory environment like a VPS. I've written a few apps using Pylons
  and it's great, so I'd like to use it for more. However the stuff I've
  used it for so far has justified running the apps on servers of their
  own, so I've been running them using paste behind lighty. However this
  seems to need quite a bit of RAM. I'd like to be able to host quite a
  few low traffic volume apps on the same VPS, but it seems that running
  several paste instances wouldn't be possible in the same way it's
  possible to host lots of low traffic PHP apps behind Apache and
  mod_php.

  Anyone have any advice on deployment?

  TIA.
  Alex

  --
  You received this message because you are subscribed to the Google Groups 
  pylons-discuss group.
  To post to this group, send email to pylons-disc...@googlegroups.com.
  To unsubscribe from this group, send email to 
  pylons-discuss+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/pylons-discuss?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 pylons-discuss group.
 To post to this group, send email to pylons-disc...@googlegroups.com.
 To unsubscribe from this group, send email to 
 pylons-discuss+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/pylons-discuss?hl=en.

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



Re: Pylons hosting on a VPS (memory usage)

2010-04-21 Thread Mike Orr
On Mon, Apr 19, 2010 at 3:28 PM, Alex a...@oxygencomputers.co.uk wrote:
 Hi all,

 Does anyone have any advice on hosting multiple Pylons apps in a low
 memory environment like a VPS. I've written a few apps using Pylons
 and it's great, so I'd like to use it for more. However the stuff I've
 used it for so far has justified running the apps on servers of their
 own, so I've been running them using paste behind lighty. However this
 seems to need quite a bit of RAM. I'd like to be able to host quite a
 few low traffic volume apps on the same VPS, but it seems that running
 several paste instances wouldn't be possible in the same way it's
 possible to host lots of low traffic PHP apps behind Apache and
 mod_php.

 Anyone have any advice on deployment?

I've seen a few reports of small Pylons applications taxing the
resources of low-memory servers, more than the applications' apparent
size or traffic would indicate. I don't know how widespread the
problem is or what specifically might be the culprit.

If you're using mod_wsgi, I would follow the advice others have
mentioned in this thread.

-- 
Mike Orr sluggos...@gmail.com

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



Re: Pylons hosting on a VPS (memory usage)

2010-04-21 Thread Jonathan Vanasco
i'm running pylons apps on a few VPS

my issues have been this:
- the database takes up a lot of ram
- the search engine takes up a lot of ram

pylons app performance has been better as more ram is tossed in.

if you're running a DB like postgres or mysql on the same vps, i would
probably use 512mb ram as a minimum... 256 could work.  if you're
running anything like solr/lucene as well, i'd defintely consider 512
a minimum

in terms of the apache issues indicated above -- were they on the
master or child processes ? you should be able to mitigate that
behavior on the children by tweaking max_requests
also, as i remember from my mod_perl days, apache doesn't like to free
memory on a restart.  you need to explicitly stop then start.

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



Re: Pylons hosting on a VPS (memory usage)

2010-04-21 Thread cd34
On Apr 21, 2:51 pm, Jonathan Vanasco jonat...@findmeon.com wrote:
 also, as i remember from my mod_perl days, apache doesn't like to free
 memory on a restart.  you need to explicitly stop then start.

There is still an issue with the OOM killer that kills an apache child
and leaves the shared memory segments active.

With apache stopped,

ipcs | grep www-data
  (or the username that apache runs under)

and you might still see some stale semaphore arrays stuck.

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



Pylons hosting on a VPS (memory usage)

2010-04-19 Thread Alex
Hi all,

Does anyone have any advice on hosting multiple Pylons apps in a low
memory environment like a VPS. I've written a few apps using Pylons
and it's great, so I'd like to use it for more. However the stuff I've
used it for so far has justified running the apps on servers of their
own, so I've been running them using paste behind lighty. However this
seems to need quite a bit of RAM. I'd like to be able to host quite a
few low traffic volume apps on the same VPS, but it seems that running
several paste instances wouldn't be possible in the same way it's
possible to host lots of low traffic PHP apps behind Apache and
mod_php.

Anyone have any advice on deployment?

TIA.
Alex

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



Re: Pylons hosting on a VPS (memory usage)

2010-04-19 Thread cd34
On Apr 19, 6:28 pm, Alex a...@oxygencomputers.co.uk wrote:
 Does anyone have any advice on hosting multiple Pylons apps in a low
 memory environment like a VPS. I've written a few apps using Pylons
 and it's great, so I'd like to use it for more. However the stuff I've
 used it for so far has justified running the apps on servers of their
 own, so I've been running them using paste behind lighty. However this
 seems to need quite a bit of RAM. I'd like to be able to host quite a
 few low traffic volume apps on the same VPS, but it seems that running
 several paste instances wouldn't be possible in the same way it's
 possible to host lots of low traffic PHP apps behind Apache and
 mod_php.

mod_wsgi is one method.
http://pylonsbook.com/en/1.1/deployment.html#setting-up-a-virtual-host

nginx - uwsgi - pylons
http://tonylandis.com/python/deployment-howt-pylons-nginx-and-uwsgi/
word of note, 0.9.5-rc1 had a few issues

There is also cherokee which has native uwsgi support

I believe lighttpd also has support for uwsgi.

You can also use fcgi/flup to deploy pylons projects

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