[IronPython] Object Pooling of IronPython 2.0 engine

Dino Viehland dinov at exchange.microsoft.com
Thu Jul 17 16:48:22 CEST 2008


We don't have any support for object pooling built-in.

Have you considered having 1 ScriptRuntime/ScriptEngine for all requests?  You could load & compile each piece of code once (so cache any ScriptSource's/CompiledCode objects), and then create a new ScriptScope for each execution to run the code against.  That way you're not doing much work per-request but individual script's state is isolated in the ScriptScope.  I believe this is what the dynamic language support for ASP.NET does in the ASP.NET Futures and we do have some stress tests making sure that works.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata
Sent: Thursday, July 17, 2008 1:58 AM
To: Discussion of IronPython
Subject: [IronPython] Object Pooling of IronPython 2.0 engine

I have a scenario in which I need to execute multiple python scripts within a single HTTP request. Right now I create a new instance of the engine for every single HTTP request and use the engine to service those requests.

This works fine except that the whole stack breaks down in moderate traffic and I start getting a bunch errors.

Is there any facility within the hosting API to support object pooling or do I have to implement them myself? Is object pooling an appropriate solution for this type of scenario at all?

Dody G.

--
nomadlife.org<http://nomadlife.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080717/e88bcb1c/attachment.html>


More information about the Ironpython-users mailing list