Skip to content

JsPoolExhaustedException #352

@dgpedro

Description

@dgpedro

Hi,

I was already searching here for this error, and found two threads about it. In one says to do SetReuseJavaScriptEngines(false) and the seconds says this error was fixed. However, in our latest tests we still got this error :(

I didn't yet tried with SetReuseJavaScriptEngines(false), however I've also seen that this makes the JS server rendering not so efficient because for every request has to generate a new JS engine rather than reusing one from the pool, so I would prefer not set this to false.

That said, I would like to ask if someone is aware of this and this is being investigated or not and if so far the only solutions are:

  • SetReuseJavaScriptEngines(false)
  • Disable server rendering

I really would appreciate some help on this, and so I provide also some info about the tests we performed in prd env:

  • Azure web app with 3 instances (each one with 2 cores and 3.5 GB of RAM)
  • Reactjs 15.3.2
  • React.NET 3.0.0
  • JSPool 2.0.0
  • 1000 concurrent tests, during 4m 30s (each test goes to a few pages but requests more often homepage)
  • 124 JsPoolExhaustedException logged
  • Most of the exceptions are in homepage view, however I can also see a few in partial views that are used in Layout.
  • I'm rendering the homepage component like: @Html.React({componentName}, Model, serverOnly: true}). I've put serverOnly: true because like this no extra tags like "data-reactid" are sent to client, and in the latest versions of reactjs this attribute is not needed anymore.

Besides the stack trace below I don't know what info more I can give, but I would really appreciate if someone replied about this and maybe give me some tip about what to do...

JSPool.Exceptions.JsPoolExhaustedException: Could not acquire JavaScript engine within 00:00:05
   at JSPool.JsPool`1.GetEngine (JSPool, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2fc7775f73072640)
   at React.JavaScriptEngineFactory.GetEngine (React.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78)
   at React.ReactEnvironment.<.ctor>b__13_1 (React.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78)
   at System.Lazy`1.CreateValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Lazy`1.LazyInitValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Lazy`1.get_Value (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at React.ReactEnvironment.get_Engine (React.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78)
   at React.ReactEnvironment.EnsureUserScriptsLoaded (React.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78)
   at React.ReactEnvironment.CreateComponent (React.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78)
   at React.Web.Mvc.HtmlHelperExtensions.React (React.Web.Mvc4, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78)
   at BM.Appl.Discounts.Portal.Web.Components.HtmlExtensions.Render (BM.Appl.Discounts.Portal.Web.Components, Version=1.0.92.7561, Culture=neutral, PublicKeyToken=null: E:\TeamCityBuildAgent\work\9a33beb42fe2b911\BM.Appl.Discounts.Portal.Web\Components\HtmlExtensions.cs: 19)
   at BM.Appl.Discounts.Portal.Web.Components.HtmlExtensions.Render (BM.Appl.Discounts.Portal.Web.Components, Version=1.0.92.7561, Culture=neutral, PublicKeyToken=null: E:\TeamCityBuildAgent\work\9a33beb42fe2b911\BM.Appl.Discounts.Portal.Web\Components\HtmlExtensions.cs: 36)
   at ASP._Page_Views_Homepage_Index_cshtml.Execute (App_Web_0utg1tfv, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: D:\home\site\wwwroot\Views\Homepage\Index.cshtml: 34)
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy (System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.WebPages.StartPage.RunPage (System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.WebPages.StartPage.ExecutePageHierarchy (System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy (System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.RazorView.RenderView (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.BuildManagerCompiledView.Render (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass21+<>c__DisplayClass2b.<BeginInvokeAction>b__1c (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass21.<BeginInvokeAction>b__1e (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`1.CallEndDelegate (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1.End (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1.CallEndDelegate (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1.End (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Controller.EndExecuteCore (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Controller.<BeginExecute>b__15 (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1.CallEndDelegate (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1.End (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Controller.EndExecute (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5 (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1.CallEndDelegate (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1.End (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.MvcHandler.EndProcessRequest (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication.ExecuteStep (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions