That is true ... per-process. If my apache server has several processes, I must make sure that all processes are triggered. This is difficult to guarantee.
On Thursday, January 17, 2013 8:50:53 PM UTC+1, Niphlod wrote: > > I'm not very well versed in all the intricacies, but if the "layer" calls > os.fork() (if you're on linux, that's probably what the underlying server > does) your import will happen only on the first request. > All the subsequent should not import anything because they will "acquire" > the current status of the process when they are forked. > There are some options in most of the "layers" (being apache, uwsgi, and > so on) to tell the interpreter to completely restart the process after a > while, but if you have those issues you'll be better off never forcing a > restart of the interpreter. > > On Wednesday, January 16, 2013 5:47:18 PM UTC+1, Daniel Gonzalez wrote: >> >> That would work, and is what I am planning to do, but: how can I >> guarantee that all processes (threads?) have been targetted?. >> I guess this is not possible, unless I start at least N parallel >> requests, N being the number of processes ... >> >> On Wednesday, January 16, 2013 5:37:24 PM UTC+1, Niphlod wrote: >>> >>> do an "outside" request as soon as you reload apache with curl ? >>> >>> Il giorno mercoledì 16 gennaio 2013 12:06:14 UTC+1, Daniel Gonzalez ha >>> scritto: >>>> >>>> Hi, >>>> >>>> In my models I am importing third party libraries. Importing those >>>> libraries takes time (3s) which means the first requests (one per process) >>>> take long time to be served. >>>> >>>> Do you have any suggestion on how to trigger the importing before the >>>> first requests arrive? I am running web2py via apache / mod_wsgi. >>>> >>>> Thanks, >>>> Daniel >>>> >>> --

