Thanks for the tip, we'll give that a try. Delaying the startup time could well be a trade-off worth taking, as I'd rather have a delay but then an instance that can handle a flood of requests.
-----Original Message----- From: Thiago H. de Paula Figueiredo <thiag...@gmail.com> Sent: Monday, November 25, 2024 12:57 PM To: Tapestry users <users@tapestry.apache.org> Subject: Re: Thread locking (deadlock) issue using Tapestry 5.8.7 under heavy load [You don't often get email from thiag...@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] On Fri, Nov 15, 2024 at 12:38 PM Scott McCarthy < scott.mccar...@clarivate.com> wrote: > Hi All, > Hello! > We are running a fairly large Tapestry application with hundreds of > concurrent users. > When under load, we are occasionally seeing an instance go into > deadlock, whereby the Tomcat threads max out, but the CPU is virtually zero. > This can commonly occur when a new instance starts up under heavy > load, but can also happen on an instance that has been running for several > days. > Tapestry creates pages instances on demand by default, so I guess the problem here is deadlocks while the somewhat complex project that is involved in getting the pages assembled. A possible simple solution you can use right now is to preload all pages when in production mode, so your webapp only takes requests when all the pages are already assembled. Something like this in your AppModule or other module class, not tested, but I hope is enough to give you a good idea: public static void contributeRegistryStartup(OrderedConfiguration<Runnable> configuration, PageSource pageSource, @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode, ComponentClassResolver componentClassResolver) { if (productionMode) { for (String pageName: componentClassResolver.getPageNames()) { pageSource.getPage(pageName); } } } This will add some time to the webapp startup process, but it's a tradeoff with fixing the threadlock problem. Please let me know if this works. One of my future plans is to add support in Tapestry for eager loading everything possible (page instances, services, assets, etc) so, when the webapp starts accepting requests, everything is ready and the first requests aren't slowed down by initializations. Cheers! -- Thiago H. de Paula Figueiredo Software developer/engineer Apache Tapestry consultant, committer and project management committee member You can sponsor my work on Tapestry at https://github.com/sponsors/machina-br Confidentiality note: This e-mail may contain confidential information from Clarivate. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this e-mail is strictly prohibited. If you have received this e-mail in error, please delete this e-mail and notify the sender as soon as possible.