[mapserver-dev] python mapscript and msCleanup issues
Umberto Nicoletti
umberto.nicoletti at gmail.com
Mon Jul 2 22:25:47 PDT 2012
On Monday, July 2, 2012, Stephan Meißl wrote:
> Hi Umberto,
>
> many thanks for your help. I tried both suggestions but without an
> optimal result.
>
> Using msIO_resetHandlers() instead of msCleanup() gives me, after using
> a fairly big amount of memory, quite strange results. In fact sometimes
> results from previous requests are present in responses. It seems, that
> not everything gets cleared. Any suggestion how to investigate this?
msIO_resetHandlers should probably be invoked after the response has been
commited, could you take a look at this page:
http://code.google.com/p/modwsgi/wiki/RegisteringCleanupCode
and implement the cleanup hook as described?
>
> Using msIO_getStdoutBufferString() seems to work for text responses only
> but not for images.
>
> Thanks,
> Stephan
>
>
> On Sun, 2012-07-01 at 12:06 +0200, Umberto Nicoletti wrote:
> > Before we turn on debugging mode let's try a couple of simple changes
> > to your script:
> >
> >
> > http://pastebin.ca/2165984
> >
> >
> > I have replaced the call to msCleanup with a call to
> > msIO_resetHandlers which clears all buffers.
> >
> >
> > http://pastebin.ca/2165986
> >
> >
> > same as before but with the buffer accessed as a string rather than a
> > byte array (string is not copied inside mapscript, array is).
> >
> >
> > Let us now how this goes.
> >
> >
> > Umberto
> >
> > On Thu, Jun 28, 2012 at 8:02 PM, Stephan Meißl <stephan at meissl.name>
> > wrote:
> > Thomas, Umberto,
> >
> > we created a simple (at least as simple as possible) test
> > case. Here is
> > a basic Python script: http://pastebin.ca/2165345 which we
> > deployed in
> > Apache using mod_wsgi with this config:
> > http://pastebin.ca/2165346
> >
> > There is also a basic mapfile using the "road" data in
> > "msautotets/wxs"
> > http://pastebin.ca/2165329 but I suspect you can use whatever
> > mapfile
> > you have at hand.
> >
> > When we issue multiple simultaneous requests e.g. using this
> > script
> > http://pastebin.ca/2165348 (note the "&" at the end of the
> > curl call)
> > some of the requests result in errors.
> >
> > Either removing the call to msCleanup() or extending the
> > Apache config
> > to limit the number of threads to 1
> > (http://pastebin.ca/2165347) seems
> > to resolve the issues but of course with limitations.
> >
> > Are we missing anything essential? How should we free
> > request/map
> > objects without using msCleanup() in Python?
> >
> > Thanks for any hint,
> > Stephan
> >
> >
> > On Thu, 2012-06-28 at 14:15 +0200, Umberto Nicoletti wrote:
> > > Fabian,
> > > if you could put together a test case that I can run to
> > reproduce the
> > > problem I will take a look into it.
> > >
> > >
> > > Regards,
> > > Umberto
> > >
> > > On Thu, Jun 28, 2012 at 1:44 PM, thomas bonfort
> > > <thomas.bonfort at gmail.com> wrote:
> > > Fabian,
> > > can you get a backtrace of the segfaults?
> > >
> > > Aside from that, I would personally refrain from
> > using threads
> > > with
> > > mapscript and stick to a prefork mpm in apache to
> > accomplish
> > > this. It
> > > is also my understanding that calling m
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20120703/c33cfc49/attachment.html>
More information about the mapserver-dev
mailing list