<br>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. <br><br>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. 
<br>Thanks,<br>Teresa<br><br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Jeff McNeil</b> <<a href="mailto:jeff@jmcneil.net">jeff@jmcneil.net</a>><br>Date: Mar 13, 2007 12:33 PM
<br>Subject: Re: Server-side script takes way too long to launch<br>To: Teresa Hardy <<a href="mailto:thardy99@gmail.com">thardy99@gmail.com</a>><br><br></span>Can you send the program? It's hard to try and follow through without... With the additional socket library calls, that could contribute. 
<div><span class="e" id="q_1114cca4f95bfeae_1"><br><br><div><span class="gmail_quote">On 3/13/07, <b class="gmail_sendername">Teresa Hardy
</b> <<a href="mailto:thardy99@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">thardy99@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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. 
<br><br>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.
<br><br>I like to quote Michael Crighton from his Airframes book..."it is always a compounding series of events that causes a crash."<br><br>Any advice greatly appreciated! <br><br>Access log from Apache...<br>

<a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
127.0.0.1</a> - - [13/Mar/2007:11:33:06 -0700] "GET /cgi-bin/finalcode.py?usae HTTP/1.1" 200 231<br><a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">127.0.0.1</a>

 - - [13/Mar/2007:11:33:07 -0700] "GET /favicon.ico HTTP/1.1" 200 3262
<br><a href="http://192.168.1.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">192.168.1.51</a> - - [13/Mar/2007:11:33:17 -0700] "GET /choosetemplate.swf HTTP/1.1" 200 250695     <-------<<<<
<br><a href="http://192.168.1.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">192.168.1.51</a>
 - - [13/Mar/2007:11:33:17 -0700] "GET /favicon.ico HTTP/1.1" 200 3262<br><a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">127.0.0.1</a> - - [13/Mar/2007:11:30:09 -0700] "GET /cgi-bin/finalcode.py?usae HTTP/1.1" 200 231
<br>
<a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">127.0.0.1</a> - - [13/Mar/2007:11:33:21 -0700] "GET /cgi-bin/xmlmaker.py?swf1 HTTP/1.1" 200 132<br><br>My run log inside Python...
<br>start Tue Mar 13 11:30:10 2007 Tue Mar 13 11:30:10 2007
<br>inside distractor Tue Mar 13 11:30:10 2007                           <-------<<<<<br>after display1.join Tue Mar 13 11:30:10 2007<br>Socket in msg init<br>in main program theme before bridge... Tue Mar 13 11:30:10 2007
<br>Connection received from: <a href="http://192.168.1.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">192.168.1.51</a><br>Socket out msg swf1<br>Connection terminated Tue Mar 13 11:33:21 2007
<br>in main program theme... swf1 Tue Mar 13 11:33:21 2007<div><span><br><br><br><div>
<span class="gmail_quote">On 3/13/07, <b class="gmail_sendername">Jeff McNeil</b> <<a href="mailto:jeff@jmcneil.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jeff@jmcneil.net</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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?  
<br><br>Might want to validate your Apache configuration and have a look at <a href="http://httpd.apache.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">httpd.apache.org</a>.  Sounds to me like DNS lookups are enabled or something of the sort.
<br><br>Thanks,<br><span><br>
Jeff</span><div><span><br><br><br><div><span class="gmail_quote">On 3/13/07, <b class="gmail_sendername">Josh Bloom</b> <<a href="mailto:joshbloom@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">


joshbloom@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Teresa, when you call a python script this way, the server needs to load the python interpreter for each call. <br><br>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.
<br><br>-Josh<br><br><br><div><div><span><span class="gmail_quote">On 3/13/07, <b class="gmail_sendername">Teresa Hardy</b> <<a href="mailto:thardy99@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">




thardy99@gmail.com</a>> wrote:</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span>

I have a webpage calling a python script, using Apache server....http://localhost/cgi-bin/mycode.py?dmn<br>I am using Firefox, WindowsXP Python 2.4<br><br>I can count to 13 from the time I click to the time the browser finds the path.
<br><br>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.
<br><br>Any suggestions on how to speed up the first step?<br><br>Thanks,<br><span>Teresa<br><br><br><br><br><br><br>
</span><br></span></div>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.python.org/mailman/listinfo/python-list</a><br>




</blockquote>
</div><br>
<br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div>




<br>
</span></div><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote>


</div><br>
</span></div></blockquote></div><br>
</span></div>