Tales from the WebLogic Frontline


Published on

Slides from my talk to the Oracle User Group conference in Birmingham in the UK.

10 things not to do with WebLogic.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • This is the problem solving philosophy I tell our consultantsConfiguration over Coding: Out of the box WLS is not setup for production needs many changes for production not usually done by developers“Out of the Box” set up for developersWLS is likely to have fewer bugs than custom code. Proven throughout my career. YES there are bugs but I’ve probably only reported a handful compared to customer bugsWLS if fundamentally quick a few ms for a simple JSP page to render. Everything else is your overhead!If you do something once and get a certain result do it again you should get the same resultScientific Method!!
  • These are things we’ve seen people do a lot which you shouldn’t do.
  • We see many examples of lots and lots of datasourcesShow a real example
  • Developer writes a bunch of components in separate EARSEach EAR has it’s own DatasourceAll going to the same databaseC1 calls C2 call C3 all in the same TransactionSimilar antipattern with JMS Connection Factories
  • Strange XA exceptions are seen by developers relating to LLR optimisationUntick Honour Global Transactions to make Exception “Go Away”Some Datasources then in “autocommit” mode as they are not enlisted in the Global TXRequires full XA configuration for Oracle!Avoid XA especially when you only have 1 database!!!!!
  • This picture of sexual activityCover a scenario we see in quite complex EJB environments with a number of EJB applications
  • WE HAVE two APPLICATIONS developedindependantlyLater application 1 needs to retrieve data from 2Initially possibly get a security issueSet Domain credential to be the sameReceive XA Exception again related to LLTX’s inadvertently coupled as WLS will enlist second app in first TX
  • Exception will be failure on client side to lookup JDBC Datasource on server side when it is actually there!Often also get security errors relating to anonymous user trying to commit TX depending on WLS versionCan also get difficulties with NATREQUIRES NEW ON SIDE 2Seen a developer try to fix by placing a wrapper bean on side 1 still couples at least removes Oracle 1.
  • Typical Architect commentAsk question anyone here think clustering too heavyweight!!!Fallacy why is clustering heavyPerhaps your Session is way too heavySo you don’t need failover???Your customers probably do!!
  • Explain Primary SecondaryReplication on attribute changeFailure causes a new primary Seen customers with Mbs of data in the cache including complete XML documentInternet facing watch out for googlebot et al, don’t use cookies so don’t do massive session initialisation or detect bots.20000 sessions created on average by BOTS on large ecommerce site.
  • Logging is VERY Heavily SynchronisedGotta Fit all those messages from Multiple Threads into a single FileIn Memory Buffer Logging can Kill youExample next slide
  • Tell story 1 about Matt’s case studyTell Story 2 Atos case studySystem Crash every day near 4pm – slow down to unrepsonsiveObserved 100% cpu utilisationTypical of constant GCConsole run out of memoryUse JMS for Logging is more performant
  • Things that cause problems but server is doing the right thing as per spec or configuration
  • See a couple of other typical session issues a lotSerialization -> Write code to Serialize to a file all your session attributesWATCH OUT FOR 3rd Party web frameworks know what they put in the session (Form Beans)
  • System Exception is runtime or RemoteExceptionWe see this in many applications where the behaviour is not what people are expectingInsufficient knowledge of the details of the EJB spec.One company policy wrap all Exceptions into their applications so as not to expose 3rd party apis.Wrapped remotes with application exception -> CAUSING COMMITS
  • A couple of typical JMS issues
  • Poisoned Message on JMS -> constant spinning CPU (100%)Other messages can never be deliveredSeen this on customer killing all order processingThis slide buildsTalk through the BuildExplain each PointRedeliver Delay allows other messages through watch out if require strict ordering
  • Not such a big issue since later versions of WLS 9.2 onwards – still requires tuningMessage headers still in memoryConsider setting quotas and messages can arrive quicker than they are pagedAlso will use 1/3 JVM memory
  • 3 issues we have seen take out servers and cause system outages
  • Especially on Sun JDKNot as common on JrockitOnly for 32bit platformsSeen one production system unable to restart because of this and numerous system hot spot dump.Large number of JMS messages (see paging from before). Hot Spot crashed couldn’t restart.Reducing JVM heap size fixed the problem
  • Node Manager should be set up correctly.Powerful and important – Amazingly some customers don’t use it - NEVER been to a customer where this has been properly configuredBy default will attempt a number of quick restarts and then give up.Configure to try a number of times with a delay for a long period.In 9 and 10 Set Panic action to exit
  • Major Government WLI System taken out by this.Regular restart of WLS carried out same time upgrade of Oracle. Oracle outage happened before but never seen a problem (Connection Testing etc. all enabled).WLS restarted while Oracle outSupport team Arrived morning to see that Name Not Found JNDI Exceptions in the log files.ALL ORDER PROCESSING FAILEDDefault setting is to switch this off!! Again suitable for development as quick errors!!
  • “Out of the Box” WLS supports Ease of development.Last preproduction domain review I did for a large dual cluster WLS and WLI domain had 80+ recommendations with over 10 Classified as HIGH which means could cause a system outage, significant down time or major security breach.
  • Tales from the WebLogic Frontline

    1. 1. Tales from the WebLogic Front Line(What NOT to do with WebLogic)<br />Steve Millidge<br />C2B2 Consulting Limited<br />
    2. 2. Agenda<br />Health Warning<br />Setting the Scene<br />Common Anti-patterns<br />Ain’t misbehaving<br />This could kill<br />
    3. 3. C2B2 Consulting<br />Fast<br />Performance and Scalability<br />Reliable<br />High Availability and Recoverability<br />Manageable<br />Monitoring and Supporting<br />Secure<br />Security<br />
    4. 4. First Day At Work<br />
    5. 5. It’s All Gone to *#*@!<br />
    6. 6.
    7. 7.
    8. 8. Meet the Project Manager<br />
    9. 9.
    10. 10.
    11. 11. Philosophy<br />Don’t Panic you didn’t #@#@ it up.<br />Suspect Configuration over Coding<br />Suspect bespoke code over WebLogic code<br />WebLogic is FAST<br />Computers are Logical and Rational<br />
    12. 12. Common Anti-patterns<br />
    13. 13. Too Many Datasources<br />
    14. 14. Too Many Datasources<br />Data Source per Component<br />All to the Same Database<br />JNDI Name per Component<br />C1<br />C1<br />C1<br />DS1<br />DS1<br />DS1<br />Oracle<br />
    15. 15. Why It’s Bad<br />Requires XA for all Datasources<br />Developers receive strange “XA” exception<br />Untick Honour Global Transactions<br />Makes Exception “go away”<br />Datasources now in autocommit<br />DATA CORRUPTION!!<br />Requires more DB connections<br />BIND same Datasource to multiple JNDI locations<br />
    16. 16. Inadvertent TX Coupling<br />
    17. 17. Inadvertent TX Coupling<br />WLS 1<br />WLS 2<br />EJB 1<br />REQUIRED<br />Invoke<br />EJB 2 REQUIRED<br />Oracle<br />1<br />Oracle<br />2<br />
    18. 18. Why It’s BAD<br />Results in “Strange Exceptions” if not All XA<br />Is the REALLY what you want<br />XA is very heavyweight<br />And not guaranteed<br />XA requires particular database configuration<br />You have 4 minimum XA resources to coordinate<br />Fix using REQUIRES NEW<br />
    19. 19. Clustering is TOO Heavy<br />
    20. 20. WLS Cluster<br />WLS Session Clustering<br />WLS 1<br />WLS 2<br />WLS 3<br />WLS 4<br />1<br />2<br />Don’t Use the Session as a Cache<br />USE A CACHE<br />
    21. 21. Too Much logging<br />
    22. 22. Too Much Logging<br />Too Synchronized<br />New Application 30% Slower<br />Tx Timeouts<br />High CPU<br />Many Threads waiting on Logging Monitor<br />Debug turned on, on one node<br />In Memory Buffer<br />Each Thread Logged to in memory queue<br />Writer thread writes messages to file<br />Under heavy load memory queues grew unbounded<br />1.5Gb heap in log messages<br />
    23. 23. Ain’tMisbehavin’<br />
    24. 24. Session Shenanigans<br />Serialization<br />Session Attributes must be Serializable<br />See this one all the time<br />No Failover!!!<br />Working as per Spec<br />No Put<br />You must Put dirtied objects back in the Session<br />Don’t Get modify then no Put<br />No Failover!!!<br />Working as per Spec<br />
    25. 25. Exceptions and TX<br />What happens to the TX when you throw an Exception from an EJB method?<br />Application ExceptionCommit<br />System ExceptionRollback<br />
    26. 26. Poisoned JMS<br />
    27. 27. Poisoned JMS<br />Eats CPU<br />Prevents Delivery<br />Kills Server Performance<br />JMS<br />Q<br />RepeatForever<br />Set Redeliver Delay<br />Set Redelivery Limit<br />Set Error Destination<br />Exception<br />
    28. 28. Poisoned JMS (Paging)<br />WLS Keeps Messages in Memory<br />Causes OutOfMemory Exceptions<br />Configure Paging Thresholds <br />Configure at JMS Server level<br />
    29. 29. This Can Kill You<br />
    30. 30. Too Much RAM<br />-XMS2G –XMX2G<br />32 bit Can be Too Much<br />O/S Reserves RAM<br />VM Starts up<br />When you need it!<br />HOTSPOT DUMP<br />
    31. 31. Node Manager Configuration<br />Not Good Out of the Box<br />Auto Kill If Failed = TRUE<br />Auto Restart = TRUE<br />Restart Delay should be set<br />Restart Max should be set<br />Set Panic Action to System.exit<br />
    32. 32. Disappearing Datasource<br />Start WebLogic when DB not Available<br />Datasource is not created<br />Connection Creation Retry Frequency Seconds should be non-zero<br />
    33. 33. Summary<br />Production Configuration is Complex<br />Call in the Professionals<br />
    34. 34. Example Bullet Slide<br />Bullet 1<br />