Performance Java : Mesure et Optimisation Partie 1 www.objis.com - Jmaghreb 2012 - Performance Java 1 Présentateur : Douglas MBIANDOU Président fondateur Objis (2005) Ingénieur école INSA Lyon (2000) Architecte formateur Java/J2ee Ambition : N°1 formation Java Afrique www.objis.com - Jmaghreb 2012 - Performance Java 2 Marocain(e)s : profitez des 200 tutoriaux Objis ! www.objis.com - Jmaghreb 2012 - Performance Java 3 Programme Formation 'Architecture JAVA' (4 ans+ exp) www.objis.com - Jmaghreb 2012 - Performance Java 4 Programme Formation 'Architecture SOA' (6 ans+ exp) www.objis.com - Jmaghreb 2012 - Performance Java 5 Clients www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 6 Performance Java : Mesure et Optimisation www.objis.com - Jmaghreb 2012 - Performance Java 7 Problèmes de performance J2EE Dégradation du temps réponse Pics de CPU et gel de l'application (freeze) Fuite légère de mémoire → dégradation perf Fuite forte de mémoire → Crash JVM www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 8 Objectifs 1 rappel 7 repères clés 1 stratégie tuning 1 outil / 3 techniques monitoring www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 9 Rappel : 4 atouts clés Java Portabilité Réseau Mémoire Sécurité www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 10 Repère 1 : architecture J2ee www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 11 Repère 2 : livrables J2EE www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 12 Repère 3 : Services clés Web : Html, images, css, jsp, servlet → livrable WAR EJB : composant métier distribué → livrable EJB JMX : Java Management eXtension (Monitoring Mbeans) JNDI : Java Naming Directory Interface JAAS : Java Authentication & Authorisation Service JCA : Java Connector Architecture (Connexion SI/ERP) JTA : Java Transaction API JPA : Java Persistence API (Mapping objet/relationnel) JMS : Java Message Service JAX-WS : Java API for XML Web Services JAXP : Java API for XML Processing (Sax/Dom/Stax) www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 13 Repère 4 : Pools www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 14 Repère 5 : Cache www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 15 Repère 6 : Stratégie Tuning 5 Application livrée 4 Serveur d'application 3 JVM 2 OS 1 Physique www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 16 Repère 7 : performance et cycle projet www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 17 Bonnes pratiques Performance et cycle de vie projet Architecture • Bonne pratique : intégrer le SLA dans use cases ! Développement • Tests unitaire → Junit / TestNG • Analyse heap → Eclise MAT • Analyser cycle de vie Objets + utilisation objets Qualité • Tests d'acceptance : inclure sla ! • Considérer échec performance = bug Pré-Production • Tests de charge (identifier saturation) www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 18 Outil : JvisualVM Mise en œuvre : http://visualvm.java.net/gettingstarted.html www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 19 Monitoring JMX www.objis.com - Formation SPRING www.objis.com - Jmaghreb 2012 - Performance Java 20 Technique 1 : Analyse memoire www.objis.com - Formation SPRING www.objis.com - Jmaghreb 2012 - Performance Java 21 Technique 2 : profiling CPU www.objis.com - Formation SPRING www.objis.com - Jmaghreb 2012 - Performance Java 22 Technique 3 : profiling Mémoire www.objis.com - Formation SPRING www.objis.com - Jmaghreb 2012 - Performance Java 23 Définir performance Nécessité d'un SLA (Service Level Agreement) • Ex : 2000 personnes 9h-17h en semaine. Quel niveau de performance ? • Les applications répondent 'suffisamment' vite • Les applications ne consomment pas plus de ressources qu'il n'en faut • Les performances du système dans son ensemble satisfont les utilisateurs. www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 24 Tuning Mettre en oeuvre la méthodologie •Tuning matériel / réseau •Tuning OS •Tuning JVM •Tuning Serveur d'application •Tuning applications www.objis.com - -Jmaghreb 2012 - Performance Java www.objis.com Formation SPRING 25 Objis : spécialiste formation JAVA 70% travaux pratiques 200 tutoriaux 'cadeau' sur www.objis.com – 2000 visiteurs / jour – Profitez-en dès maintenant !!! Nous formons les architectes de demain Clé USB offerte avec outils / Tps Satisfait ou remboursé www.objis.com - Jmaghreb 2012 - Performance Java 26 Formations Objis Maroc 2013 (cibles développeurs 4-6 ans exp) Architecture JAVA – 8-12 avril (Casablanca) – 10-14 juin (Rabat) Architecture SOA – 23-27 septembre (Casablanca) – 2-6 décembre (Rabat) www.objis.com - Jmaghreb 2012 - Performance Java 27