Daniel Lyons wrote:
> That would take care of part of it, but the other part is once the 
> server has the file and has to distribute it to other servers, via FTP 
> for example. So the call chain looks like this:
> 
> client ----->  this app's server ------> FTP server 1, FTP server 2, etc.
> 
> I assume threading of some kind would need to be involved because of the 
> time it might take. For example, simply passing a one-line text file to 
> one of my servers with a fast connection takes ~10 seconds, I think 
> mostly FTP overhead (it takes about 1.5 seconds via SFTP). Suppose I 
> have ten servers to upload to. That's 100 seconds, which is 40 seconds 
> more than when HTTP requests time out IIRC. Furthermore, I'd like to 
> spread the file out across the other servers in parallel, because it's 
> probably IO-bound and there seem to be a lot of delays involved with FTP 
> and SFTP in setup and teardown.
> 
> I really should just try making some threads and seeing if it works. 
> It's the former Zope/PHP programmer in me that keeps expecting 
> everything to go haywire if I just do something the way that would be 
> natural to a Python programmer. :)

Oh I see. My approach to this would just be to have the application log 
in a database which files need distributing and have a cron job check 
every few minutes if there are any pending files and transfer them as 
necessary. That way you decouple the two tasks. You might not be able 
to/want to do that with your application though.

I haven't tried any threading from within a Pylons app. Let me know if 
it works!

James

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to