Nous avons développé une application web utilisant TomEE 1.5.2 Plus (myfaces 2.1.13) et Primefaces 3.5. Les performances sont acceptables avec des temps de réponse du serveur d'environ 70 ms. En passant à TomEE 7.0.0-M3 Plus (myfaces 2.2.9) et Primefaces 5.3, ces temps de réponse sont maintenant jusqu'à 900ms. À l'aide de la console Web Firefox dans l'onglet Réseau, ces minutages sont tous En attente avec un temps de réception de 0 ms. Ceux-ci semblent être p:remoteCommand
demandes de serveur. Notre application a de nombreuses interfaces utilisateur p:dialog
avec des beans View Scoped gérés. Le plus de dialogues avec p:remoteCommands
le pire de la performance. J'ai essayé TomEE 7.0.1 Plus (myfaces 2.2.10 et Primefaces 6.0 sans meilleurs résultats) Les applications de test ont montré qu'un simple dialogue utilisant un bouton et ap: remoteCommand pour incrémenter un compteur et mettre à jour le formulaire et l'échelle Avec TomEE 7.0.0 et Primefaces 5.3, les boîtes de dialogue, les beans et les boutons atteignent 40 fois le temps d'attente (50ms à 100ms) .Le même code s'exécute sur TomEE 1.5.2 et Primefaces 3.5 ne montre aucune différence (30ms)Temps de réponse réseau très lents pour TomEE/Primefaces App
Lors de la construction avec facesContext.application.projectStage = Development
ou Production dans l'environnement TomEE 1.5.2/Primefaces 3.5, les temps de production sont environ 10% supérieurs en mode Production avec TomEE 7.0.0/Primefaces 5.3 Exemple de code d'application de test ci-dessous:
principal App
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:cc="http://java.sun.com/jsf/composite/components">
<h:head>
<title>COUNTER</title>
</h:head>
<h:body>
<ui:include src="/Dialogs/counterDialog.xhtml" />
<ui:include src="/Dialogs/counterDialog2.xhtml" />
<ui:include src="/Dialogs/counterDialog3.xhtml" />
<ui:include src="/Dialogs/counterDialog4.xhtml" />
<ui:include src="/Dialogs/counterDialog5.xhtml" />
<ui:include src="/Dialogs/counterDialog6.xhtml" />
<ui:include src="/Dialogs/counterDialog7.xhtml" />
<ui:include src="/Dialogs/counterDialog8.xhtml" />
<ui:include src="/Dialogs/counterDialog9.xhtml" />
<ui:include src="/Dialogs/counterDialog10.xhtml" />
<ui:include src="/Dialogs/counterDialog11.xhtml" />
<ui:include src="/Dialogs/counterDialog12.xhtml" />
<ui:include src="/Dialogs/counterDialog13.xhtml" />
<ui:include src="/Dialogs/counterDialog14.xhtml" />
<ui:include src="/Dialogs/counterDialog15.xhtml" />
<ui:include src="/Dialogs/counterDialog16.xhtml" />
<ui:include src="/Dialogs/counterDialog17.xhtml" />
<ui:include src="/Dialogs/counterDialog18.xhtml" />
<ui:include src="/Dialogs/counterDialog19.xhtml" />
<ui:include src="/Dialogs/counterDialog20.xhtml" />
<h:form id="countForm">
<input id="clickMe" type="button" value="clickMe" onclick="openCounterDialog();" />
<h:outputText id="count" value="#{counter.count}" />
<input id="clickMe2" type="button" value="clickMe2" onclick="openCounterDialog2();" />
<h:outputText id="count2" value="#{counter2.count}" />
<input id="clickMe3" type="button" value="clickMe3" onclick="openCounterDialog3();" />
<h:outputText id="count3" value="#{counter3.count}" />
<input id="clickMe4" type="button" value="clickMe4" onclick="openCounterDialog4();" />
<h:outputText id="count4" value="#{counter4.count}" />
<input id="clickMe5" type="button" value="clickMe5" onclick="openCounterDialog5();" />
<h:outputText id="count5" value="#{counter5.count}" />
<input id="clickMe6" type="button" value="clickMe6" onclick="openCounterDialog6();" />
<h:outputText id="count6" value="#{counter6.count}" />
<input id="clickMe7" type="button" value="clickMe7" onclick="openCounterDialog7();" />
<h:outputText id="count7" value="#{counter7.count}" />
<input id="clickMe8" type="button" value="clickMe8" onclick="openCounterDialog8();" />
<h:outputText id="count8" value="#{counter8.count}" />
<input id="clickMe9" type="button" value="clickMe9" onclick="openCounterDialog9();" />
<h:outputText id="count9" value="#{counter9.count}" />
<input id="clickMe10" type="button" value="clickMe10" onclick="openCounterDialog10();" />
<h:outputText id="count10" value="#{counter10.count}" />
<div>
<input id="clickMe11" type="button" value="clickMe11" onclick="openCounterDialog11();" />
<h:outputText id="count11" value="#{counter11.count}" />
<input id="clickMe12" type="button" value="clickMe12" onclick="openCounterDialog12();" />
<h:outputText id="count12" value="#{counter12.count}" />
<input id="clickMe13" type="button" value="clickMe13" onclick="openCounterDialog13();" />
<h:outputText id="count13" value="#{counter13.count}" />
<input id="clickMe14" type="button" value="clickMe14" onclick="openCounterDialog14();" />
<h:outputText id="count14" value="#{counter14.count}" />
<input id="clickMe15" type="button" value="clickMe15" onclick="openCounterDialog15();" />
<h:outputText id="count15" value="#{counter15.count}" />
<input id="clickMe16" type="button" value="clickMe16" onclick="openCounterDialog16();" />
<h:outputText id="count16" value="#{counter16.count}" />
<input id="clickMe17" type="button" value="clickMe17" onclick="openCounterDialog17();" />
<h:outputText id="count17" value="#{counter17.count}" />
<input id="clickMe18" type="button" value="clickMe18" onclick="openCounterDialog18();" />
<h:outputText id="count18" value="#{counter18.count}" />
<input id="clickMe19" type="button" value="clickMe19" onclick="openCounterDialog19();" />
<h:outputText id="count19" value="#{counter19.count}" />
<input id="clickMe20" type="button" value="clickMe20" onclick="openCounterDialog20();" />
<h:outputText id="count20" value="#{counter20.count}" />
</div>
</h:form>
</h:body>
</html>
Dialog
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:cc="http://java.sun.com/jsf/composite/components">
<p:dialog
id="counterDialog1"
header="Counter Form"
widgetVar="counterWidget"
closeOnEscape="true" >
<p:ajax
event="close"
listener="#{counter.buttonHit()}"
update="counterForm"
resetValues="true" />
<h:form id="counterForm">
<p:panel id="counterPanel">
<input id="countMe" type="button" value="countMe" onclick="customfunction();" />
<p:remoteCommand name="increment" actionListener="#{counter.increment}" update=":countForm" />
</p:panel>
<div
align="center"
style="padding: 5px">
<p:commandButton
id="counterOK"
value="Ok"
cache="false"
ajax="true"
style="valign:bottom;float:left;padding-left:10px"
onclick="closeCounterDialog()" />
<p:commandButton
id="counterCancel"
value="Cancel"
style="valign:bottom;float:center;padding-right:10px"
onclick="closeCounterDialog()"
process="@this">
</p:commandButton>
<p:commandButton
id="counterHelp"
value="Help"
style="valign:bottom;float:right;padding-right:10px"
disabled="true">
</p:commandButton>
<p:defaultCommand
target="counterOK" />
</div>
</h:form>
</p:dialog>
<script type="text/javascript">
//<![CDATA[
// Keep script tag outside of any component tag that may need to get updated
// so JavaScript objects are not recreated. E.g. removing event handlers
// won't work after update since handler function is a different intance
function openCounterDialog (event)
{
counterWidget.show();
}
/**
* Remove all the relevant event listeners, re-enable normal behavior and
* hide the dialog
*/
function closeCounterDialog()
{
counterWidget.hide();
}
function customfunction()
{
//your custom code
increment(); //makes a remote call
}
//]]>
</script>
</ui:composition>
gérés Bean classe
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.primefaces.context.RequestContext;
@ManagedBean(name = "counter")
@ViewScoped
public class Counter implements Serializable
{
/** Prevents compiler generating brittle one */
private static final long serialVersionUID = -2L;
int count;
public Counter()
{
count = 0;
}
public void increment()
{
count++;
}
public int getCount()
{
return count;
}
public void buttonHit()
{
RequestContext.getCurrentInstance().execute ("closeCounterDialog()");
}
}
Toutes les idées? Merci d'avance!
Avez-vous vérifié les différences dans le contenu de la demande et la réponse? Avez-vous profilé le côté serveur, par ex. avec un phaselistener? Je vois des choses très bizarres qui me font me demander si ça a bien fonctionné. Ou votre application de test d'échantillon est juste faux et votre application réelle n'est pas – Kukeltje
Exemple d'application est le même design que l'application réelle. Pouvez-vous définir ce que vous voyez comme incorrect dans la conception de l'exemple d'application que j'ai fourni? Je vous remercie. –