PHP calls python: process vs threads

Gabriel Genellina gagsl-py at yahoo.com.ar
Wed Dec 6 22:12:12 EST 2006


At Wednesday 6/12/2006 13:54, johnny wrote:

>What I want to do is the following:
>
>Web user uploads a word doc, and I need it to move the uploaded word
>doc, on to another machine and conver it to pdf.  Then update the
>database and allow immediate pdf download.  I am thinking of using ftp
>from machine 1 -> machine 2, then convert doc to pdf on machine 2,
>using process or thread.  What is the best way to go about doing this,
>process or threads or pyro?  Pdf is created by calling commands on the
>command line, through python script.

So, your python script does not write the pdf, just invokes some 
other commands to do the job, and waits for completion?
In this case, I doubt Python would be a bottleneck, so the easy way 
is to launch a new process on each job.
If you get many requests per second and notice that it's the Python 
startup which is slowing down the whole process, then you could 
consider changing it.
But in that case I'd change the way the PDF are converted, not the 
Python script which controls that.


-- 
Gabriel Genellina
Softlab SRL 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Python-list mailing list