Skip to main content

Performance Web avec Java

Vous voyez la page d'accueil de Hertz? J'ai reçu une exception en y accédant ce matin, et je suis sidéré par la pile des appels, d'un point de vue performance:

Error Message: Filter [SystemFilter]: com.hertz.ecom.framework.presentation.servlets.SystemFilter was found, but is missing another required class.
Error Code: 500
Target Servlet: /index.jsp
Error Stack:
java.lang.NoClassDefFoundError: com.hertz.ecom.framework.presentation.servlets.SystemFilter (initialization failure)
     at java.lang.J9VMInternals.initialize(J9VMInternals.java:123)
     at java.lang.Class.newInstanceImpl(Native Method)
     at java.lang.Class.newInstance(Class.java:1263)
     at java.beans.Beans.instantiate(Beans.java:219)
     at java.beans.Beans.instantiate(Beans.java:63)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:421)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:379)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:238)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:296)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:721)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
     at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
     at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205)
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3252)
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:264)
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
     at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
     at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
     Caused by: java.lang.Throwable: java.lang.RuntimeException
     at com.hertz.irac.framework.presentation.FrameworkBroker.getDirectoryPaths(FrameworkBroker.java:740)
     at com.hertz.ecom.framework.presentation.servlets.SystemFilter.<clinit>(SystemFilter.java:104)
     at java.lang.J9VMInternals.initializeImpl(Native Method)
     at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
     at java.lang.Class.newInstanceImpl(Native Method)
     at java.lang.Class.newInstance(Class.java:1263)
     at java.beans.Beans.instantiate(Beans.java:219)
     at java.beans.Beans.instantiate(Beans.java:63)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:421)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:379)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:238)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:296)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:721)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
     at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
     at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205)
     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:277)
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3252)
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:264)
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
     at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
     ... 1 more

Avec ASP.NET, on aurait facilement mis toute la page ou sa majeure partie en cache de sortie (une ligne sur la page ASPX), car c'est une page très demandée qui change peu. Cela qui aurait donné à peu près les mêmes performances qu'une simple page HTML. Alors qu'ici on a un appel de presque 70 méthodes pour répondre à une requête toute simple.

Peut-être que l'application est tout simplement mal codée, donc que ça n'a rien à voir avec Java, mais 70 méthodes au lieu de une ou deux pour une requête simple, ça pose forcément des problèmes de performance.

Ca me rappelle le cas d'un client qui devait gérer des appels extrêmement fréquents sur un Web service, et faisait tourner en parallèle du Java et de l'ASP.NET pour répondre à la demande. Il me disait qu'avec une seule machine ASP.NET il traitait plus de requêtes qu'avec trois machines Java. Bien sûr, cela n'a rien d'un test objectif de performance, mais j'ai comme l'impression que Java semble en général moins performant qu'ASP.NET pour le Web.

Comments

'gro said…
en effet java aime empiler les couches pour rien, par contre c'est pas parce que le serveur affiche la pile d'appel que ca reflete forcement la realite bas niveau, la JVM compile/inline le code a sa sauce selon les besoins donc ca doit etre moins moche que ca en a l'air. Mais dans tous les cas voir des composants qui contiennent des beans qui contiennent des jsp qui contiennent des customs tags ca me fait toujours mal aux yeux ^^ ( surtout pour des choses plutot bidons en general )
Arnaud said…
@'gro: merci pour la remarque. Effectivement, j'ai interprété ça avec le point de vue ASP.NET: si je vois ces méthodes dans la pile des appels c'est qu'elles ont été appelées... Tant mieux si ce genre de choses est optimisé par la JVM.

Popular posts from this blog

Gift idea : help your loved ones take their IT skills to the next level

You surely know a special person who works in IT. Learn Kubernetes & Docker enables them to quickly ramp up on those two technologies that one doesn't want to miss in 2021. With smoother operations, better scaling and availability, DevOps tooling, containers and containers orchestration smartly solve many problems that developers and system administrators commonly face. Don't let your loved ones face problems in their IT job : offer them the book that takes them from zero to productive in a matter of days. Grab it now! Get the ebook from Leanpub , Amazon or choose from many retailers . Get the print edition from Lulu .  

Learn Meteor book available

I'm pleased to announce the general release of my Learn Meteor book. It is now available as an ebook or print book from various sources: Learn Meteor print (paperback) on Lulu Learn Meteor ebook on LeanPub Learn Meteor ebook on Barnes & Noble Learn Meteor ebook on iBooks Learn Meteor ebook on Kobo Learn Meteor ebook on Scribd Learn Meteor ebook on Inktera Page Foundry Learn Meteor ebook on 24symbols Learn Meteor ebook on Amazon US Learn Meteor ebook on Amazon UK Learn Meteor ebook on Amazon France Learn Meteor ebook on Amazon Deutschland Learn Meteor ebook on Amazon Canada Learn Meteor ebook on Amazon India Learn Meteor ebook on Amazon Brasil Learn Meteor ebook on Amazon Mexico Learn Meteor ebook on Amazon España Learn Meteor ebook on Amazon Italia Learn Meteor ebook on Amazon Netherlands Learn Meteor ebook on Amazon Japan Learn Meteor ebook on Amazon Australia More sources are coming soon for the print version. Learn Meteor has been a fun expe...

Learn ASP.NET Core: read the book as it is being written

     TL;DR: get the discounted book now using the coupon , then get the full version for free. Thanks to the great acceptance of my previous books, ( Learn WPF MVVM ,  Learn ASP.NET MVC and Learn Meteor ), I'm in the process of writing a fourth one. Learn ASP.NET Core - MVC and DI with .NET Core 1.1 using Visual Studio 2017 teaches you how to quickly get coding using that technology. Just as I did previously, I'm publishing it before it is even finished. Would you like to read it? You can get it for half the price: 50% off the book using that coupon (limited to the first 100 readers and up to august 1st 2017): http://leanpub.com/netcore/c/K9mHH0IzfI2F About 50% of the book is already written, yet it is already available for download as an ebook: PDF, EPUB, MOBI: you choose your format. Over the next days I'll be writing the rest of the book, and publishing updates often. The final book will be ready by au...