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