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

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 experienc