Hey Justin,

Thanks for your reply. I ran the pstree -p command like you suggested.
I had to do it on my desktop pc though because the stripped down linux
i'm using doesnt have pstree. I get the same problem on my desktop pc
though. Here is the output.

        ├─lighttpd(27656)───main.py(27657)─┬─{main.py}(27658)
        │                                  ├─{main.py}(27659)
        │                                  ├─{main.py}(27660)
        │                                  ├─{main.py}(27661)
        │                                  └─{main.py}(27662)

I also tried running the main file using the built in development
environment.This is what I got:

init(1)─┬─/usr/bin/termin(6998)─┬─bash(7002)
        │                       ├─bash(7700)───telnet(28882)
        │                       ├─bash(9006)
        │                       ├─bash(10385)───python(29384)─┬─
{python}(29385)
        │                       │                             ├─
{python}(29386)
        │                       │                             ├─
{python}(29387)
        │                       │                             ├─
{python}(29388)
        │                       │                             ├─
{python}(29389)
        │                       │                             ├─
{python}(29390)
        │                       │                             ├─
{python}(29391)
        │                       │                             ├─
{python}(29392)
        │                       │                             ├─
{python}(29393)
        │                       │                             └─
{python}(29394)

To me it appears that web.py is calling the multiple instances and not
lighttpd?

Here is the lighttpd.conf file anyway:

server.modules   = ( "mod_fastcgi", "mod_rewrite", "mod_access" )
server.document-root       = "/mnt/0.4.3"
server.port                = 9000

fastcgi.server = ( "/main.py" =>
 (( "socket" => "/tmp/fastcgi.socket",
    "bin-path" => "/mnt/0.4.3/main.py",
    "max-procs" => 1,
    "bin-environment" => (
           "REAL_SCRIPT_NAME" => ""
     ),
     "check-local" => "disable"

  ))
)

url.rewrite-once = (
      "^/favicon.ico$" => "/static/favicon.ico",
      "^/static/(.*)$" => "/static/$1",
      "^/(.*)$" => "/main.py/$1",
)

I execute lighttpd with lighttpd -f /etc/lighttpd.conf

Any thoughts?

Cheers,
Brendon



On Jul 1, 6:43 am, justin davis <[email protected]> wrote:
> It shouldn't be running more than one process if lighttpd.conf is
> configured to run one.  Let's see where those are coming from... run:
>
> pstree -p
>
> and see what the parent process is.  If they all have lighttpd as the
> parent, I'd make sure that lighttpd is using the config file you're
> specifiying.  If it's less clear, paste the output from that.
>
> Cheers,
> Justin
>
> On Jun 30, 2:57 am, brendon <[email protected]> wrote:
>
>
>
> > I just thought I'd add that I have max_procs => 1 in lighttpd.conf.
>
> > Brendon
>
> > On Jun 30, 4:28 pm, brendon <[email protected]> wrote:
>
> > > I was curious if it is normal for there to always be 6 instances of
> > > web.py running. e.g. when i run the ps command i get 6 instances of
> > > python all with different PID's.
> > > e.g.
>
> > >  1736 root      7228 S    /usr/bin/python /mnt/WebpyTest/main.py
> > >  1737 root      7228 S    /usr/bin/python /mnt/WebpyTest/main.py
> > >  1738 root      7228 S    /usr/bin/python /mnt/WebpyTest/main.py
> > >  1739 root      7228 S    /usr/bin/python /mnt/WebpyTest/main.py
> > >  1740 root      7228 S    /usr/bin/python /mnt/WebpyTest/main.py
> > >  1741 root      7228 S    /usr/bin/python /mnt/WebpyTest/main.py
> > >  1742 root      7228 S    /usr/bin/python /mnt/WebpyTest/main.py
>
> > > However, when I check the memory usage with the top command I get the
> > > following:
>
> > >  1736  1735 root     S     7228 23.5  0.0 /usr/bin/python /mnt/
> > > WebpyTest/main.py
> > >  1737  1736 root     S     7228 23.5  0.0 /usr/bin/python /mnt/
> > > WebpyTest/main.py
> > >  1738  1737 root     S     7228 23.5  0.0 /usr/bin/python /mnt/
> > > WebpyTest/main.py
> > >  1739  1737 root     S     7228 23.5  0.0 /usr/bin/python /mnt/
> > > WebpyTest/main.py
> > >  1740  1737 root     S     7228 23.5  0.0 /usr/bin/python /mnt/
> > > WebpyTest/main.py
> > >  1741  1737 root     S     7228 23.5  0.0 /usr/bin/python /mnt/
> > > WebpyTest/main.py
> > >  1742  1737 root     S     7228 23.5  0.0 /usr/bin/python /mnt/
> > > WebpyTest/main.py
>
> > > I am running this on a very stripped down version of Linux and off a
> > > SD card the system specs are also quite 8MB flash memory, 1GB SD and
> > > only 32MB memory. Hence, it is very important that I use the minimal
> > > amount of resources. I have tried different combinations of Lighttpd
> > > with FastCGI as well as using flups for WSGI, but I am still getting
> > > memory errors always being because main.py used up all the memory.
> > > Apart from my program having a memory leak I just want to know the
> > > following:
> > > 1. Is it normal for there to be so many instances of webpy (main.py in
> > > my case)
> > > 2. Is it a concern?
> > > 3. Any other recommendations to get the web.py memory consumption
> > > down.
>
> > > Any help is greatly appreciated,
>
> > > Brendon
--~--~---------~--~----~------------~-------~--~----~
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