Fwd: Server-side script takes way too long to launch

Teresa Hardy thardy99 at gmail.com
Wed Mar 14 18:32:02 CET 2007


Thanks Jeff for all the great advice on where to look next, including help
with mailman. (I fell off the list and am using this reply to figure out
why!) Just switched to gmail and still learning it too.

And thanks for being so kind in the code review. Fundamentally, I had too
many imported modules in the original code so I partitioned it to run more
efficiently. The data from the machine up at school on the subset of code
was closer to yours. You have definitely put me back on track.
Thanks,
Teresa


---------- Forwarded message ----------
From: Jeff McNeil <jeff at jmcneil.net>
Date: Mar 13, 2007 12:33 PM
Subject: Re: Server-side script takes way too long to launch
To: Teresa Hardy <thardy99 at gmail.com>

Can you send the program? It's hard to try and follow through without...
With the additional socket library calls, that could contribute.

On 3/13/07, Teresa Hardy <thardy99 at gmail.com> wrote:
>
> Josh, someone mentioned mod_python to me and I wasn't sure if it was the
> right/best solution for accelerating python. I'll chase that one down.
>
> Jeff, If I read this right, the browser isn't showing the launched swf for
> a good 7 seconds on top of the initial latency...some of which is expected.
> There is something else going on with a socket class running without being
> called. Restart doesn't seem to help. But the discussion is helping me
> through some code that might be contributing to the problem. I am going to
> make some more test runs with a subset of the code. In the meantime there
> might be something more obvious to an expert in what I am sending.
>
> I like to quote Michael Crighton from his Airframes book..."it is always a
> compounding series of events that causes a crash."
>
> Any advice greatly appreciated!
>
> Access log from Apache...
>  127.0.0.1 - - [13/Mar/2007:11:33:06 -0700] "GET
> /cgi-bin/finalcode.py?usae HTTP/1.1" 200 231
> 127.0.0.1 - - [13/Mar/2007:11:33:07 -0700] "GET /favicon.ico HTTP/1.1" 200
> 3262
> 192.168.1.51 - - [13/Mar/2007:11:33:17 -0700] "GET /choosetemplate.swf
> HTTP/1.1" 200 250695     <-------<<<<
> 192.168.1.51 - - [13/Mar/2007:11:33:17 -0700] "GET /favicon.ico HTTP/1.1"
> 200 3262
> 127.0.0.1 - - [13/Mar/2007:11:30:09 -0700] "GET /cgi-bin/finalcode.py?usae
> HTTP/1.1" 200 231
> 127.0.0.1 - - [13/Mar/2007:11:33:21 -0700] "GET /cgi-bin/xmlmaker.py?swf1
> HTTP/1.1" 200 132
>
> My run log inside Python...
> start Tue Mar 13 11:30:10 2007 Tue Mar 13 11:30:10 2007
> inside distractor Tue Mar 13 11:30:10 2007
> <-------<<<<
> after display1.join Tue Mar 13 11:30:10 2007
> Socket in msg init
> in main program theme before bridge... Tue Mar 13 11:30:10 2007
> Connection received from: 192.168.1.51
> Socket out msg swf1
> Connection terminated Tue Mar 13 11:33:21 2007
> in main program theme... swf1 Tue Mar 13 11:33:21 2007
>
>
> On 3/13/07, Jeff McNeil <jeff at jmcneil.net> wrote:
> >
> > But even if the server was loading Python on each hit, which it will for
> > CGI, it shouldn't take "a count to 13", especially on localhost. That to me
> > is an indication of a further problem.  Does it take that long to load with
> > each hit, or just the first following a server restart?  What do log
> > timestamps say from initial hit until last-byte from your Python script?
> >
> > Might want to validate your Apache configuration and have a look at
> > httpd.apache.org.  Sounds to me like DNS lookups are enabled or
> > something of the sort.
> >
> > Thanks,
> >
> > Jeff
> >
> >
> > On 3/13/07, Josh Bloom < joshbloom at gmail.com > wrote:
> > >
> > > Teresa, when you call a python script this way, the server needs to
> > > load the python interpreter for each call.
> > >
> > > If you need faster execution you should look into having a server
> > > process running already. Something like mod_python for apache or CherryPy
> > > will help you speed this up.
> > >
> > > -Josh
> > >
> > >
> > > On 3/13/07, Teresa Hardy < thardy99 at gmail.com> wrote:
> > >
> > > > I have a webpage calling a python script, using Apache
> > > > server....http://localhost/cgi-bin/mycode.py?dmn
> > > > I am using Firefox, WindowsXP Python 2.4
> > > >
> > > > I can count to 13 from the time I click to the time the browser
> > > > finds the path.
> > > >
> > > > The python runs okay when I finally get to it. In the first step it
> > > > just launches a Flash file. I benchmarked the time thru the python code and
> > > > it isn't the slow part. It's the launch. Forgive me if I am not explaining
> > > > this well. I am pretty much teaching myself...fumbling thru the process.
> > > >
> > > > Any suggestions on how to speed up the first step?
> > > >
> > > > Thanks,
> > > > Teresa
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > http://mail.python.org/mailman/listinfo/python-list
> > > >
> > >
> > >
> > > --
> > > http://mail.python.org/mailman/listinfo/python-list
> > >
> >
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070314/9d76e9be/attachment.html>


More information about the Python-list mailing list