[reportlab-users] "medium"-volume site + zope
Robin Becker
reportlab-users@reportlab.com
Mon, 30 Jun 2003 16:24:13 +0100
In article <BB25C53B.75C5%burton_reportlab@artificiel.org>, alexandre
burton <burton_reportlab@artificiel.org> writes
>hello,
>
>i am currently evaluating the use of reportlab through zope. the application
>would be "medium volume" (we expect serving between 1250 and 2500 single
>pages over the course of 2 weeks).
>
>i've read the archive and seen the issues with threads and am concerned if
>it's a risk -- it will certainly occur that concurrent jobs will be called.
>right now the rendering takes about 6 seconds (in a context/setup similar to
>where it wil be used).
>
>is there a way to insure that traffic will not be a problem? i don't have to
>have zope directly call reportlab, i can interface to something else if it
>helps isolate (wrap?) the problems of reportlab in another enveloppe. (i
>only need to pass an ID; python can retrieve all the info from sql).
>
>right now my prototype script does everything i need (i will probably have
>questions on performance with images inclusion) this threading issue is my
>only hesitation before committing and doing some real development.
>
>thanks!
>alexandre.
.... as has been said many times on this list if you want to run
simultaneous jobs that take 6 seconds the collision probability is not
small, but also the loss caused by running the job in an external python
process will likely be small.
I did this kind of thing before in Zope by setting up a single thread
that handled the jobs in a fifo like manner.
This was quite hard as I didn't grok the Zope fullness and was trying to
initialize everything from an Extension module. In order to keep my
JobQueue thread alive I hung it on the main module. That way each
invocation of the zope methods could at least see a common thing.
If your back end is I/O bound you should probably run a separate process
for each request so that I/O can overlap (this is the case when 1 job=6
seconds, but 2 take less than 12 if started simultaneously). On my
rather slow machine I see the following
C:\>TIMETHIS.EXE python \tmp\aaa.py
TimeThis : Command Line : python \tmp\aaa.py
TimeThis : Start Time : Mon Jun 30 16:19:19 2003
hello world
TimeThis : Command Line : python \tmp\aaa.py
TimeThis : Start Time : Mon Jun 30 16:19:19 2003
TimeThis : End Time : Mon Jun 30 16:19:19 2003
TimeThis : Elapsed Time : 00:00:00.280
so the print 'hello world' program takes about .28 seconds to finish.
Clearly reportlab's overhead is larger.
for "from reportlab.pdfgen.canvas import Canvas" I see this
C:\>\ux\TIMETHIS.EXE python \tmp\rl_startup.py
TimeThis : Command Line : python \tmp\rl_startup.py
TimeThis : Start Time : Mon Jun 30 16:22:30 2003
TimeThis : Command Line : python \tmp\rl_startup.py
TimeThis : Start Time : Mon Jun 30 16:22:30 2003
TimeThis : End Time : Mon Jun 30 16:22:31 2003
TimeThis : Elapsed Time : 00:00:01.131
so we can guess that the overhead is around 15%-33% for your sized jobs.
--
Robin Becker