Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

GlassFish in Production Environments

Get to know GlassFish Community, the differences between Oracle GlassFish Server, and also all the capabilities for Management, Administrative tasks, Monitoring, Tuning and Configuration for Production Environments of all your Java EE applications

  • Login to see the comments

GlassFish in Production Environments

  1. 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1 GlassFish in Production Environments Bruno Borges Principal Product Manager Java Evangelist
  2. 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.2 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  3. 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3 Open Source Project Commercial Product GlassFish Server Reference Implementation Glass Fish
  4. 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4 GlassFish Server Reference Implementation
  5. 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5 Java EE – And GlassFish - Journey Java EE 7 2005-2012 Ease of Development Lightweight Developer Productivity & HTML5 1998-2004 Enterprise Java Platform Robustness Web Services 2013 - Future
  6. 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6 Java EE 7 ThemesJava EE 7 Themes DEVELOPER PRODUCTIVITY MEETING ENTERPRISE DEMANDS Java EE 7  Batch  Concurrency  Simplified JMS  More annotated POJOs  Less boilerplate code  Cohesive integrated platform  WebSockets  JSON  Servlet 3.1 NIO  REST
  7. 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7 Java EE 7 Community Momentum ACTIVEPROJECTS 26 Active and transparent mailing lists JSRsADOPTED 22 JUGs 19 Adopt a JSR PROMOTEDBUILDS 89 GlassFish YOU 187 COMPANIES 32 EXPERTS SPECLEADS 16 ACTIVEJSRs 14
  8. 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8 GlassFish Server Open Source Project
  9. 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9 GlassFish Server  Built in open source  World’s first Java EE 7 Application Server  Lightweight / modular / easy to use  Production ready Open Source Project
  10. 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10 The GlassFish Community  10+ million annual downloads  FishCAT - Early testing and fixes  Active user forums  Community contributions
  11. 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11 Centralized management  Integrated GlassFish Server Provisioning  Manage instance/cluster lifecycle  Manage configurations  Manage Java EE resources  Manage application lifecycle
  12. 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12 Flexible Administration Web Browser REST API Command Line
  13. 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13 GlassFish Server Administration Architecture Cluster 1 Domain Administration Server (DAS) instance4 ssh / dcom / http http Repository instance2 instance3 instance1 REST JSON XML
  14. 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14 GlassFish Server Clustering  Manage 100 instances per domain – Standalone – Clusters (max 10 per cluster)  Dynamically resize cluster  JMS Broker Clustering  Load Balancing – Commercial plugin – AJP (mod_jk, mod_proxy)
  15. 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15 Application Versioning  Deploy multiple versions application versions  Activate any version  For example: – Roll forward and backwards between versions – Pre-deploy application for later activation – Enable new version at specific time of day
  16. 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16 GlassFish Modularity  Starts in seconds  Only loads required modules  Including “infrastructure” features In a nutshell OSGi EJB Servlet 274 JPA … JMS Broker app1.war CDI CDI REST WebSocket Bean Validation Clustering Console HTTP app2.ear
  17. 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17 OSGi Support  OSGi Runtime (Apache Felix) – Also runs on others – Ships with ~275 modules – Integrates OSGi management tools  Hybrid Java EE / OSGi Applications – Expose EJBs as OSGi Services – Inject OSGi services into Java EE applications  Run any OSGi bundle  Supports OSGi Enterprise
  18. 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18 Extending GlassFish Server  Define a new container – System-level logic – Implement administration commands  Expose administration capabilities – Administration Console – Command Line – RESTful Interface  Embeddable API  Re-brand user interface
  19. 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19 Built-in Developer Features  Ultra-fast deployment – Hot deployment – Directory deployment – Auto-deploy directory  Run as a single JAR java –jar glassfish.jar app1.war  Maven Plugin mvn gf:run, gf:start, gf:deploy
  20. 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20 Active Redeploy  Maintains state across redeploys  Rapid Iterative development – Edit – Save – Refresh 1) Edit 2) Save 3) Refresh
  21. 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21 NetBeans 7.3.1 + GlassFish 4.0  NetBeans bundles GlassFish  Incremental compilation; auto-deploy  Complete Java EE 7 support – All Java EE 7 project types – Maven Support – Wizards – Advanced Wizards  Entity to REST generation  Database to JSF 2.2
  22. 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22 Oracle GlassFish Server Commercial Product
  23. 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23 Oracle GlassFish Server  Commercial Distribution of GlassFish Server Open Source Edition  GlassFish Server Control  Java SE support  24 x 7 x 365 premium support  Regular patch releases  Indemnification Java EE 6 Compliant
  24. 24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.24 Oracle Enterprise Manager 12c  Features – Discovery  Applications not discovered – OOTB Monitoring (live, historical) – Event Monitoring – Configuration management – Process controle (live, schduled)  EM FMW Plugin 12.1.0.4  GlassFish Open Source and Commercial versions GlassFish Plugin
  25. 25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.25 GlassFish Server Control Performance TunerDAS Backup & Recovery Monitoring Scripting Client ActiveCache for GlassFish Oracle Access Manager Integration Load Balancer Plugin & Installer
  26. 26. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.26 TUNING FOR PRODUCTION ENVIRONMENTS
  27. 27. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27 Quick Start and Overview  Download from glassfish.org – ZIP and native installers (Mac, Linux, Windows) – Download Size  Smallest at 37Mb for English Web Profile  Biggest at 114Mb for Multilingual Full Profile  Install (requires JDK 7) – Execute native installer or uncompress ZIP file  Run – $ cd glassfish4 – $ ./bin/asadmin start-domain Download, Install, Run
  28. 28. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28
  29. 29. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29 Default configurations  GlassFish comes by default best configured for development environments – Default security configurations OTOH come pre-configured – A default GF domain does not enables remote access for admin  Best for hot deployment  Great for integrating and using from within IDEs Development purpose
  30. 30. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30 Basic stuff: JVM options  A production domain will need more memory, and other fine tuned options – Edit <java-config> inside domain.xml manually, or – Edit through Admin CLI or Web UI  JVM Options -Xms and -Xmx to same value (at least 2GB) -XX:MaxPermSize and -XX:MinPermSize to same value (at least 256mb) More memory for production environments
  31. 31. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31 Garbage Collector and Heaps  There are several options, but G1 is available for a while and you should consider it. Analyse, compare, and decide  Enable -verboce:gc  Enable -XX:+PrintGCDetails  Inform -Xloggc:/tmp/my_glassfish_vm_gc.log  Make sure devs can’t freeze your VM by enabling – XX:+DisableExplicitGC  Enable heap dump for when you get OOME Analyse and consider G1 from HotSpot 7
  32. 32. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32 Disabling Developer Features  Disable auto-deploy and dynamic application reload  Disable JSP check for modified date  Enable cache of characters in Strings – Edit domain1/config/default-web.xml – genStrAsCharArray=true – ** this might bring encoding issues Because this is a production environment
  33. 33. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33 Request and Acceptor Threads  Define Acceptor Threads to a number similar to the number of Cores in your CPU  Increase the number of threads for the HTTP Listener, to as much as your CPU can handle simultaneously  Set min and max threads pool size to same value Handling more than <several> users at the same time
  34. 34. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34 LOGGING  Always disable: Unnecessary logging
  35. 35. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35 Monitor, tune, monitor, tune  Always monitor  Keep tuning  Tools – jmap / jps, jstat, jconsole
  36. 36. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36 CUSTOMER STORIES
  37. 37. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37 Customers using GlassFish in Production  Jelastic was the first cloud to provide GlassFish 4.0 with Java EE 7  Pense Imóveis, real estate buyer/seller network  Guia da Semana, enterteinment/schedule website  Parleys.com  CloudBees first to ofer Java EE 7 (Using GlassFish) Besides Jelastic
  38. 38. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.38 ROADMAP
  39. 39. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.39 GlassFish Server 4.x 2013 2014 GlassFish Server 4.0 • Java EE 7 • Open Source Edition • Clustering (early access) GlassFish Server 4.0.1 • Bug Fixes GlassFish Server 4.1 • Clustering • Improve modularization • GlassFish Server Control • Oracle GlassFish Server • Bug fixes Major Minor
  40. 40. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.40 Future of Java EE JCACHE State Management Configuration HTML5 ++Cloud / PaaS JSON Binding Java EE 8 and Beyond NoSQL
  41. 41. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.41

×