localhost is mostly wrong (btw that’s why it’s called Distributed System)

According to a post of Oracle’s A-Team, you can accelerate the startup of WebLogic when configuring “localhost” as ListenAddress. My comment on their posting isn’t enabled yet, so I will share some details here: Actually, that’s a good point, but only half of the picture (especially when looking at all the non-integrated WLS). Here is my response.

Don’t forget to mention that configuring “localhost” causes WebLogic stop doing what you bought it for: accepting requests from any client. Makes sense, doesn’t it?, but some developers don’t get this at first (no offence, it’s typically not their business). Using “localhost” for the JDBC URL is another common mistake in the first version of quite a few configurations I have seen.

As a rule of thumb:

Using “localhost” is almost always wrong in a distributed system configuration.

You are correct, it’s important to put a fixed entry for the listen address (for all manged servers and the admin server as well, and better don’t forget the node manager ). Unlike your private Mac or PC,  multi-project, multi-domain machines may have dozens of  IP addresses. WLS shouldn’t listen to all available addresses on the machine. So use the IP of your machine. If you are using DHCP you can also put your (qualified) hostname if it can be resolved. This will even work for JDeveloper “integrated” development WLS .

 

WebLogic Deployment: Answers to Frequently Asked Questions

Here is a number of answers to many question that typically pop up when explaining WebLogic deployment concepts

 

What is the difference between staged deployment and non-staged deployment?

You maybe want to read the official Oracle documentation regarding staged deployment first which gives a great overview. This Q&A cannot replace reading the manuals.

Anyway, here is short answer: Staged deployment will copy your deployment units onto the deployment servers, place them into the $WL_HOME/servers/SERVER_NAME/stage directory and deploy them from there.

Good, so when does staged deployment make sense?

In short: When the target servers cannot access the source file of your deployment unit use staged deployment, e.g. because there is no shared file system.

 

What happens if I use staged deployment although I have shared domain directory for every server?

You will unnecessarily multiply the deployment units in every servers stage directory. The more servers you have, the more time and space it will cost you.

 

So if I use staged deployment and then delete the deployment, will the be deleted from the stage directory?

I just tried this with WebLogic 12c because I heard complaints about this not working in previous version. So far I could only reproduce it on one machine, but then it is working.

 

I don’t get it. When I look at the deployment wizzard in WebLogic 12c it doesn’t make sense?!

That’s correct. It doesn’t make sense. The deployment screen is very confusing (you might say “incorrect”) since the horizontal separators are wrong. See the screenshot below for how they are (in red) and how they should be to make sense (in green). However, this glitch is not new. You can observe the same for at least for WebLogic 10 and 11. Sometimes I wonder if anybody at all wonders…

 

Production Redeployment

 

First of all I recommend to browse the official Oracle documentation about production redeployment. For short step-by-step instructions have a look at Jay’s article in Middleware Magic.

 

Can I add the version number for production redeployment in the admin server console?

To the best of knowledge, no. For some reason you can only see the version number during deployment, but you cannot set it. You can set it in the MANIFEST.MF file (recommended by Oracle) file or during deployment with weblogic.Deployer:

 

[code]

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic

-deploy -name purchaseSurfWear.war -source /apps -targets surfCluster

-stage -appversion 2b

[/code]
or

use the WebLogic Scripting Tool WLST deploy() command and add the -archiveVersion under [options]

[java]deploy( appName , path , [ targets ], [ stageMode], [planPath], [options])
[/java]

 

 

Should I deploy to a cluster or to all servers in the cluster? What is the difference?

If you deploy to a cluster and later extend the cluster by adding another server, then the deployment will be available automatically to the new server (without redeploying or changing the target settings of the deployment).

 

Can I delete the source file of an application after deploying, since staged deployment should copy the deployment unit onto the target server?

In short: no, you cannot. One obvious reason is the functionality described above.

Here is a quote from the Oracle documentation: “After you have deployed your application, do not change or remove the original source files for the application. The WebLogic Server deployment framework uses the files to manage deployed applications. Changing or removing the original source files may result in unexpected application behavior.”

 

Homework for Oracle / My wishlist for deployment features in WebLogic 13f:

- Change the admin console so that a version number can be added during deployment.

- To confuse people less, get the horizontal lines in the deployment wizzard of the WebLogic 12c admin console right as described above.


WebLogic 12c: Node Manager Best Practices

During the last couple of years (and the last couple of WebLogic versions) I collected a number of best practices  regarding WebLogic nodemanager. All of them hold true for WebLogic 12c as well. This posting is not a step-by-step beginners guide and it will not save you from attending some training or studying the Oracle documentation regarding node manager yourself. Anyway, here are some suggestions, check if the apply for your environments:

Node Manager Best Practices

 

  • At first, take a decision to start servers with or without NM. Note, that  is not absolutely necessary. You can always start your servers with the scripts generated by the config wizzard. I personally know rather big companies building lovely cars who took the decsicion not to use node manager.
  • Would I use nodemanger myself? For an “average” project: yes! Only after configuring node manager you can use the WebLogic admin console to start and stop managed servers and node manager will restart you failed servers as well. However, if you consider restarting you servers automatically because of out-of-memory problems, better read this article about “surviving generations”  to understand how to track down memory leaks and fix them. Anyway, you still want to use node manager.
  • Make sure you understand that nodemanger will use default values to start your servers unless you specify them yourself in the admin console under server startup parameters.
  • Make sure you always start your servers with same startup parameters! This is really important. You end up in deep trouble if you don’t. Believe me.
    Imagine somebody is starting a managed server using the admin console and the provided values there. Next day somebody else starts a server using the provided scripts (which – at least in real life – will never be identical to the startup values configured in the admin console). Now depending on the way the server was started it will behave differently and show erratic behaviour or not.
  • Document and communicate the usage of node manager. Write it down in the operations manual. If you ever hire me as a consultant for some performance tuning it helps to know if you are actually using node manager or not.
  • Don’t forget to enroll new machines for NM usingnmEnroll()
  • A good way to overcome the potential problem with  startup parameters configured in admin console is to use:
    [java][file: nodemanger.properties]startScriptEnabled=true
    stopScriptEnabled=true
    [/java]Then node manager will use the generated start script and you do not need to configure startup values in the admin server console.
  • If you are not using SSL for your domain the default option for node manager to use encrypted communication does not make that much sense for you. Disable it. On the admin server site switcht to “plain text” for node manager communication and in the node manager.properties located in WL_HOME/common/nodemanager set
    [java]
    secureListener=false
    [/java]
  • If you decide to use SSL for the node manager communication, get correct certificates! The demo certificate will not work in a distributed system. Make sure the hostnames in the certificates are correct. If they are not correct, you may want to consider disabling host name verification on the admin server (which is the client for the node manager).
  • Remember that node manager is not part of the domain. Still you can check the node manager status and and see the logs directly from the WebLogic admin console.

Some homework for Oracle ;) Here is my personal wishlist for WebLogic Server 13f:

  1. Enable plain text communication for node manager as default. Why should it be SSL?
  2. Set start/stopScriptEnabled as default. This will cause less confusion.

Any settings you would like to share? Something to argue? Let me know.

 

WebLogic 12c Proxy Plugin for Web Servers is missing

According to the documentation for the brand new WebLogic 12c the WLS mod_wl proxy plugin for web servers should be located under the following location:

$WL_SERVER/server/plugin

and this is where the trouble starts:

  • This directory does not exists for WebLogic 12c.
  • You can download the plugins seperately from here. Yet there is no version for WebLogic 12c either.
  • You must not simply use an lower plugin version (e.g. the one that comes with WebLogic 11g) because lower versions of the plugin e.g. 10.3.5 are not guaranteed to work (only higher versions). Now, this is between you me: yes they do work typically.  Yet I remember at least one situation when I spent over a day debugging an issue because an older plugin version was used. I am pretty sure you can imagine serveral way to spend your time better.
  • The behavior for the Apache mod_wl 10.x plugins is known to be rather strange after a a managed server drops out of the dynamic server list (clustered or not).

 

Here are some possible solutions:

I briefly checked the 10.3.5 plugin for Apache 2.2 with a WebLogic 12c cluster and it seems to work okay so far. Actually even the glitch with the failing load balancing after a server drops out of a cluster has improved. Probably that’s the best solution currently, but remember it’s at your own risk.

Follow up with my OTN thread and some valuable input from René and Sandeep.

For a more critical production environment I recommend to open a support ticket with Oracle. If you do so, please post an update here and share your findings.

 

So how are you using WebLogic 12 in production? If you do, how is your clustering set up?

 

 

Cloud Computing Workshop 2011: Oracle, Rackspace and Amazon

This year I really kept the best until the end! Last week I was running a 2-day cloud computing workshop with a 2-hour hands-on management presentation the night before the workshop for Contribute in Belgium. Contribute is an Oracle Platinum partner and being surrounded by Oracle Fusion Middleware experts, DBAs, application architects and senior level management the technical level of the workshop was very high with many interesting discussions.

We covered Oracle Public Cloud (OPC), Amazon Web Services (AWS) and Rackspace (RS). OPC is not available yet, but the overall functionality including its limitations for the first release is more or less known and quite interesting compared to let’s say running WebLogic on AWS.

To prove the point I was running WebLogic 12c on AWS cloud with 30GB of heap on a high-mem 4xl instance with 8 cores. Proving the point cost me a bit more than US$2.

Typically I expected that the more tech savvy audience prefers AWS over Rackspace, yet this time people were impressed by the easy setup of Rackspace and the way they handled a minor problem with their web console file-upload feature during a live chat session.

Among hundreds of other details we looked at the I/O performance. The performance of Amazon’s EBS is known to be interesting (you may want to read this as ‘difficult’). See Adrian’s posting for a thorough explanation, some benchmarks here, and some more details there.

The out-of-the-box performance looking at Rackspace Cloud is more consistent and there is a surprisingly high throughput which is almost independent of the data size. Here is some data comparing a local laptop disk, to the disks attached to the Rackspace Cloud servers to my brand new consumer SSD (not sure if a 512 GB SSD still qualifies as ‘consumer’). All numbers refer to a READ-benchmark with increasing data size.

Laptop HD (500GB SATA): 80 MB/s

Laptop SSD (Crucial m4): 281 MB/s

Rackspace (SAN): 302 MB/s

 

I am only posting the screenshot for one of the Rackspace I/O measurements since quality isn’t perfect. There is some older data with graphs available in a previous post of mine.

 

 

 

 

 

 

 

 

 

Now I am still curious about the dip on the left part of the graph which is consistent over several instances and measurements. Any comments?

Oracle Technologist of the Year 2011 Award for Frank Munz

Last week I received the Oracle Technologist of the Year Award 2011, Cloud Architect.

It makes me feel flattered and it’s of course a great honor for me being on this list of fame together with companies such as Dell, TurkCell and others! The award is part of Oracle’s Excellence Awards program. The winners were selected by a panel of judges that scored each entry across multiple categories.

I know there was a tremendous amount of support for the nomination of my Oracle Middleware and Cloud Computing book by my customers, workshop participants, individual book reviewers, Oracle user groups, middleware experts and even some people at Oracle HQ – many thanks to all of you!

Read the full story in the Oracle Magazine:

 

 

 

Make VirtualBox shared folder directory read / write for a non root user

This is just a note to myself. The command adds user oracle to the vboxsf  group. Don’t even try chmod or chown, it won’t help. Replace oracle with your own uid.

sudo usermod -a -G vboxsf oracle

WebLogic 12c is announced!

WebLogic 12c will be out soon. Launch event is Dec 1st 2011. http://bit.ly/uge9cu .
Certainly you can expect a “WebLogic 12c unboxed” report here once it will be out.
My current estimate is that I will be able to provide custom WebLogic 12c training courses around January 2012.

Oracle Cloud Computing Buch zu gewinnen!

(Posting in GERMAN ONLY)

Während der DOAG2011 Konferenz können Sie ein Examplar des Oracle Cloud Computing Buches gewinnen:

✘✘✘ Unterstützen Sie die Oracle Cloud Computing Buch Seite und klicken Sie auf “gefällt mir”.

✘✘✘ Oder melden Sie sich bei der munz & more Info-Newsletter an. Es erscheinen ca. 4 Ausgaben pro Jahr mit Informationen über Vorträge und Workshops zu Cloud Computing, Oracle WebLogic, Service Bus und SOA Suite.

Die Gewinner werden Ende November benachrichtigt. Der Rechtsweg ist ausgeschlossen. Link zur Amazon-Seite mit Kritiken zu “Middleware and Cloud Computing”.

Review: WebLogic Server 11g Administration Handbook by S. Alapati and an Overview of other WLS 11g books

“So which WebLogic book do you recommend?

During the last couple of years I must have been delivering more than a dozen WebLogic server workshops for all kind of audience. Naturally the question that comes up at the end is: “So which WebLogic book do you recommend?”.

Only a few years ago…

To be honest, for a long time there wasn’t anything that I could recommend at all. This situation changed when Patrick and Nyberg published Professional Oracle WebLogic Server. And their book certainly doesn’t deserves the not so good reviews on Amazon. For quite a while it was the best book available about WebLogic server – certainly not because it was the only one. Written by Patrick, who was (or still is?) VP in Oracle’s Fusion Middleware Development, there is a least some additional content to be found beyond of what is covered in the offical Oracle documentation (the first technical description of cluster unicast, how to build singleton services in a cluster for developers). The book targets developers as well as admins and it’s useful for architects. But then, it was written when WebLogic 9/10 was hot.

… now

Nowadays, while all the world seems to be chit-chatting about clouds only (and I personally can’t wait for WebLogic 12c to be released) there are 2 new WebLogic 11g books out.

I have to admit that I only browsed Michel Schildmeijer’s book Oracle Weblogic Server 11gR1 PS2: Administration Essentials. Yet it seems an interesting book for those who are getting started with WebLogic server and those who are looking for a gentle step-by-step instruction to get most important aspects configured. On a first glance it does exactly what it says on the tin: administration essentials. Markus Eisele has written an insightful and detailed review about the book that I pretty much agree with.

 

WebLogic Server 11g Administration Handbook

However, there is a another book out now which caught my attention. Oracle WebLogic Server 11g Administration Handbook written by Sam Alapati and published in Sept 2011.

Content:

Myself I don’t like reviews that repeat the content of a book over and over again but for your convinience there is a TOC available at Amazon. Interesting enough, the book covers roughly the topics that you could learn about in a 5 day WebLogic admin training course. Actually it reads as if somebody knowlegeable enough took the content of the official Oracle WebLogic training course and converted it into a book. The book is up to date and mentions the unique features of WebLogic 11g such as the new dashboard that replaces the old console extension of WebLogic diagnostic framework.

Style:

From the way the book is written you can tell that Alapati has a deep understanding of the topics covered. There is no fluff, everything is technically sound. Still it is easy enough to read.

Recommendation:

Do I recommend it? Yes, absolutely.

 

Summary

 

what I liked:

+ covers all the content of a 5 day WebLogic admin training in enough detail.

+ it makes a great companion book for tje WebLogic administration certification or for somebody with a Fusion Application background.

+ precise writing style yet still easy to read. You can tell the author knows very well what he is writing about.

minor things I did not like:

- it only covers the content of a 5 day WebLogic admin training, there is not much advanced content beyond that.

- it explains how to configure stuff but it does not deal with best practices if you are running hundreds or thousands of WebLogic servers (no, just scripting is not enough then).

- reading a book written by an Oracle ACE I was expecting to learn about limitations and showstoppers as well. But maybe I am personally expecting too much here.

- there seems to be no Kindle ebook available. Make it $9.99 when you publish it.

My summary summary condensed: 5* (on an Amazon scale from 1 to 5*)

 

 

WebLogic in the Cloud

I saved the shameless plug for the end. So feel free to stop reading here. However, if you believe that cloud computing is purely a marketing hype you may want to check out the Oracle Middleware and Cloud Computing book for a critical review of what is possible today without vaporware. The book explains why the cloud is like a fully programmable data center at your finger tips and how to build up highly available, globally distributed, load balanced instances and deploy your applications. All this just for a few cents.

 

Artikel: Oracle WebLogic Server und Fusion Middleware in der Cloud

German only. Heute exklusiv auf deutsch ein Artikel den ich für das DOAG Magazin im Früjahr 2011 geschrieben habe:
Download: Oracle Fusion Middleware und WebLogic Server in der Cloud (PDF)

  • Cloud Dienste oder Fusion Middleware Features?
  • Was zeichnet eine echte Cloud aus?
  • Architektur Blueprint für die AWS Cloud und Java EE Anwendungen.

Teile des Artikels sowie zahlreiche Grafiken sind aus meinem “Middleware and Cloud Computing” entommen. Viel Spaß beim Lesen!

Usage of Oracle Exadata, Exalogic, Oracle Fusion Middleware and Enterprise Manager within Oracle

Oracle is eating its own dog food.

Here is an interesting slide set from OOW11 about how Oracle is using it’s own hardware and software.

Still a lot of Oracle appserver to see instead of WebLogic..

Oracle announcing Oracle Public Cloud – First comments.

I am at S.F. at the Oracle Open World conference right now where Larry Ellison announced the Oracle Public Cloud in an entertaining and rather fun presentation just an hour ago. To see some more photos of the event and my paparazzi shot of Sting who already showed up for some 30 seconds: check out the Facebook site of my Oracle Cloud Computing book.

Larry picked up many ideas that I published earlier this year in my cloud computing book:

He was talking a lot about migrating from one cloud to another (mostly using AWS as an example, so they seem to be on the friend list). Also he emphasized that simple multi-tenant SaaS offers such as Salesforce.com with a shared DB are not real clouds and risky (because of the shared DB :) ).

When Oracle’s position about clouds was rather fluffy (should I say cloudy?) even one year ago, I now hear them talking more about elasticity, self-service, chargeback etc.

What I didn’t like: So far this does not include pay-per use yet (one of my 4 criteria of cloud computing). Larry mentioned a monthly subscription during his keynote which was confirmed in the Thu morning keynote. Yet Oracle Enterprise Manger 12c is announced to provide metering at various levels.

I will post an update here as soon as there will be more details out tomorrow.

Apart from announcing the Oracle Public Cloud also Oracle Social Media (a part of Fusion Applications) was announced. See fotos on Facebook.

Oracle / Amazon Cloud Computing Workshop in the Netherlands

Did you miss the Sydney event? I will offer an even better Oracle / Amazon Cloud Computing workshop with Transfer Solutions (together with René van Wijk) in the Netherlands.

Enjoy two and a half days filled with real Cloud Computing, hands-on labs, and a 2h management overview live demos on the Amazon cloud.

Learn about features and showstoppers – all in plain English!
See here for an updated version of this workshop.

Complete Silence. WebLogic on fanless, ultra-small, low energy hardware.

Imagine you are trying out some Oracle stuff at home: No humming sound, no high pitch fan noise, no distraction (assuming your kids are somewhere else and your SO is walking out the dog). Nothing. Complete silence while you are reading manuals and working with WebLogic Server 11g.

Since a long time ago I wanted to build that system. A fanless, eco-friendly and incredibly cheap computer running WebLogic. A real computer that makes no noise at all.

I started with a Shuttle XS35GTV2 barebone. It’s preassembled, based on an Intel Atom 525, but it comes without HD and RAM. I added a max of 4 GB SDDO 1333 RAM (204 pin) and a HD that was lying around from an old laptop.Total hardware cost including HD and RAM was about 250€ which should roughly translate to a bit more than 250 US$ (not if you calculate the exchange rate but when buying it overseas). Replace the HD with an SSD to avoid the remaining noise.

Fig1: Shuttle with 2,5 SATA HD and RAM added.

Fig 2: Shuttle assembled.

The Shuttle is running a dual core processor with hyperthreading enabled so UNIX top displays 4 cores.I installed Ubuntu 11.04 on it, booting from an USB-stick, without any problems at all. One reason why I selected the Shuttle in favor of others is that it comes with 5x USB, a WLAN, gigabit Ethernet, card reader and a discrete ION2 graphics card with HDMI output. You can guess I will use it as a media player as well.

WebLogic performance is alright (don’t expect miracles though). It’s certainly not blasting fast but it does keep up with most training environments or virtualized systems.

It’s lovely to have a fanless UNIX server at home.

 

Oracle Fusion Middleware and AWS Cloud Services

Sydney Conference Center

I yesterday gave a presentation at InSync2011 about Oracle’s cloud computing strategy, AWS cloud services and it’s current limitations. Amazon reacted quickly and updated their offering. We have been waiting for that. Keep going!

AWS outage destroys EBS-based AMIs in Europe region

I always recommend to create your own EBS-based AMIs (e.g. for running complex software such as Oracle Fusion Middleware). This hold true for the classic AMIs as well as for the converted Oracle VM templates. Never rely on the existence of AMIs provided by Oracle because:

- Oracle can change or update (or remove) them any time.

- They often don’t exist for certain AWS regions, they are S3-based or only exist based on 32-bit OEL instead of 64-bit.

- Also, the AMIs provided often don’t exist for a specific version of Oracle products.

So always create your own copy! Yet here is something to consider:

AWS broke an EBS-based AMI of mine by deleting arbitrary block in the image. This is particularly annoying since there is no easy way to create an offline copy an EBS-based AMI. You could rsync the running image to local computer but there is absolutely no support to get this done in a user-friendly way from the AWS console.

The good: They informed me in time (being in Sydney if something happens in the EU regions gives you an advantage) and sent an apology. They also replaced the deleted blocks with empty blocks.

The bad: It cost me several days to create this AMI which was an OEL EBS-based, full-blown installation of Oracle SOA Suite 11.1.1.5 (I still have to check if it will be usable after a file system check).

For a more detailed explanation of what happened take a look at Amazon’s summary of the events. It summarizes to an error in the EBS software that was overlayed with a power outage in Dublin.

Hello Amazon: Why don’t you provide an easy way to have an offline backup of EBS-based AMIs for disaster recovery?

DOAG 2011 Konferenz Presentation

Looking forward to meet you all at DOAG2011. I’ll be giving a presentation as usual which was just accepted by the program committee. So don’t miss the lovely city, Nürnberger sausages, the Sauerkraut and of course my talk.

WebLogic JMS with SAF and JMS bridges or SQS : Legacy Integration in the Cloud with Oracle WebLogic, WebSphere and OSB / Apache Camel

An interesting question popped up on my Oracle Middleware and Cloud Computing book site which I like to answer here for the benefits of all the others puzzling at similar integration questions. In the context of using JMS as an integration technology I’d like to summarize the usage scenarios for Oracle WebLogic JMS Store-and-Forward and JMS-bridges (both are included in WebLogic server).

Hi Frank – [ ...] We have a requirement to build 2-way asynchronous integration between an application running on WLS in AWS and a legacy J2EE app running on IBM WebSphere in our Data Centre. From your excepts my understanding is that SQS is intended for use only between AWS apps – is this correct ? I think we need to be looking at a full JMS solution for our integration – perhaps using WLS JMS Store-And-Forward – Thanks, Peter D

Hi Peter,

Based on your comment I cannot go into great detail or even provide a solid architecture that anwsers you question (one that will save you from more reading) but here are some important points to consider:

- Amazon’s SQS is not restricted to be only used from AWS instances. SQS is purely based on web services (or language bindings that encapsulate those WS calls) so you can use it from any computer. E.g. you can read or write to SQS queues from remote.

- WLS Store-and-Forward (SAF) can only couple WLS instances of the same version and does not bridge to other JMS providers. You cannot use SAF to transfer from WLS JMS to IBM MQSeries (or whatever Websphere might use). JMS is a pretty bad integration technology which requires to have the right messaging classes in your classpath. E.g. when writing messages from Websphere to a WebLogic JMS queue you are required to have the WLS JMS classes in Websphere classpath.

-  You can use the WebLogic’s JMS bridge to solve the somehow messy classpath issues. WLS JMS bridge has to be deployed as JCA adapter (still the jar file from the other provider is required but it is not used in custom code). The bridge will automatically forward from e.g. WLS JMS to MQSeries and even supports transcations. However there is no support to bridge between WLS JMS and AWS SQS.

- Unlike let’s say Oracle Service Bus, if you are looking at Apache Camel there is support to convert incoming JMS messages to outgoing SQS. Note to Oracle’s product manager of OSB: we would appreciate to have SQS as a supported transport protocol or possibly as an SOA Suite JCA adapter. Thanks for considering it :)

regards,

Frank

Detect your Memory Leaks by counting Surviving Generations: Size matters!

The sunshine motivates me to run more these days. Just back from a beautiful run in Englischer Garten I am still sweating but I am also inspired by Rene’s article about JRockit that I read last night. It’s a very detailed article and well done – I tempted to write ‘as good as usual’ but I do understand how much work it is!

Java Memory Leaks

Most likely there is no training I do on behalf of Oracle without the subject “memory leaks”. So while still cooling down from my run, let me add a few points about memory leaks.

- Size matters. At the end it is all about size! Wasting 20 bytes due to a mem leak is bad. Yet 20 bytes don’t affect your system. I bet you will neither notice nor detect it.

Wasting 20 bytes in a loop that runs a million times makes you probably notice the leak. Running the same loop with the leak 10 million times might crash your appserver.

- Fast growth is not the issue. Slow growth is bad enough. Imagine you lose 20 bytes every minute. It’s a bit like a slow puncture tyre which constantly loses a bit of air. At the very end you sitting there with a flat tyre (Let me assume you life in a country with a mild climate and friendly people how will assist you to get the tyre changed quickly) . The same happens with your WebLogic heap. It’s not a lot of memory that you lose per time but it is the total size of the memory that is wasted over time. At the end your server will fail after three weeks (and WebLogic nodemanager restarts it for you :) ).

 

Don’t get me wrong. I am a big fan of JRockit, the team behind JRockit and its superb tools. Yet for a long time I wondered why JRockit’s memory leak tools still tries to detect “growth”.

Often I like to demo a 20 line Java program with 2 methods (mine is derived from the IBM page here, so you can get an idea). One method is consuming a lot of memory. The other one is losing 20 bytes every now and then. Of course the memory leak is within the second method, but JRockit tools detects the first method (which just happens to be mem intensive but correct).

Good news is: there is a better approach! It’s the kind of tools I love to explain in my workshops. Now it’s within the Oracle eco-system anyway but I used to spread the word long before.

Visual VM / Netbeans

VisualVM comes with your Sun JDK6 for free, originates from Netbeans, look for jvisualvm in JAVA_HOME/bin. It incorporates a memory profiler that uses a metric called “surviving generations” (or short “generations”). So what is a surviving generation?

Surviving generations:

The number of different ages for all objects allocated on the JVM heap since the profiling session started.

Age of object:

The age of the object is the number of garbage collections the object has survived.

 

Now the surviving generation metric is as good as it gets IMHO. A high number of SG tells that there is  a high number of objects created which are never garbage collected (which is the definition of a memory leak, isn’t it?).

VisualVM displays the surviving generations metric, so it is easy to hunt them down.

 

 

To conclude:

  • Does it detect the slowly growing memory leak in the example above? Yes, it does!
  • VisualVM is only part of the Sun JDK, not of JRockit. Since we are all one happy family now I expect it survives the merging of both JDKs (Oracle is doing pretty well with these descisions usually. Hello Oracle …). Just in case it doesn’t survive I will keep posting references to this blog entry :) .
  • Read more about JDK, WebLogic and monitoring (also the most important non-Oracle monitoring solutions) in my Oracle Middleware book.
  • I am running a customized high-end Tuning, Sizing and Monitoring WebLogic workshop myself (preferably in Munich or Sydney). Drop me an email if you are interested.
  • I am off for a shower and the second coffee of the day. Enjoy the sunshine!

A live update on this from Oracle Open World 2011 as of Oct 3rd 2011. I just spoke to the tech lead of JRockit, Marcus Hirt, asked him about the support of surviving generations in the Jrockit Mission Control tooling for the merged JDK 7. His answer (with a very sympathic grin in his face) was: “Stay tuned…”.

 

Oracle InSync2011 Conference in Sydney

 

  • It’s confirmed now. I will give a presentation at AUSOUG’s InSync2011 conference 16th / 17th August 2011. My talk is about cloud services. Really looking forward to be in Sydney again.
  • Right after the conference I will be offering an Amazon Cloud workshop/training centred around Oracle Fusion Middleware. Learn how to do real cloud computing with WebLogic right now (including elasticity, load balancing and database as a service). Bring your laptop – no need to bring your Exalogic machine for this…

 

 

RDS: Real Cloud Computing with Oracle Databases

When designing your cloud architecture sooner or later the question about the database will arise. Today Amazon Web Services announced the availability of Oracle database instances provisioned with the AWS Relational Database Service (RDS). However, there are many other options available, and in order to make an informed decision as to which will best suit your architecture, you should know the pros and cons of at least four:

  • You can start installing your database on an AMI with the operating system of your choice, or even select an AMI provided by Oracle and set up the included Standard or Enterprise Edition.
  • SimpleDB is an option if you prefer the scalability and availability of a non-relational database.
  • The relational database service from AWS offers a convenient and easy way to create and manage an Oracle MySQL database as a cloud service.
  • Starting today you can use RDS to create an Oracle database. So for the first time in the short history of cloud computing a licensed Oracle database can be used in the cloud with a pay per use model! You pay the database instance per hour used (or bring your own license)- and only this is real cloud computing.

I summarized my view in a detailed 12 page whitepaper (the weather here is too nice and I can’t bother myself putting all the screen shots into this blog posting).

The PDF describes all the details of RDS and compares them to the other options available. Also learn how to use WebLogic with RDS:

Cloud Databases and Oracle Whitepaper.

If you like to know more after reading the whitepaper have a look at my Oracle Cloud Computing book at Amazon and join the book’s Facebook site!

Ebook Released: Middleware and Cloud Computing

 

 

 

 

 

 

 

 

 

 

After a couple of fun days playing with (mostly disastrous) tools, converters and the Kindle itself I published the first Kindle edition of “Middleware and Cloud Computing”. It contains more than 100 coloured graphics (well, of course they are not coloured on your b/w Kindle, but on the Kindle reader for your Mac, PC, Android, iPad etc) and more than 100 clickable links to additional resources, publications and tools.

Please spread the word, twitter it to the networked part of the known universe and don’t forget to LIKE its Amazon and Facebook site. Do you you really, really want to support it? Sincerely? The best you could do is writing a review once you have read it.

 

thanks and best wishes,

Frank

WebLogic JMS Topics, Oracle Service Bus, and AWS Simple Notification Service (SNS)

AWS Cloud Service: Simple Notification

This is a shortened extract of my my book Middleware and Cloud Computing

If you like it, you can get it from Amazon or subscribe to its Facebok site!

 

 

AWS Simple Notification Service (SNS) is a publish/subscribe service for notifications in the cloud. The scope of SNS is much broader than that of monitoring and it’s a good starting point used in combination with the CloudWatch to implement custom monitoring and notification. To use SNS, create a topic with the AWS management console or the SNS API. Clients interested in this topic subscribe to it, and whenever a notification is published to the topic, SNS will push it to all subscribers.

SNS supports a variety of transport protocols for the subscriptions:

  • HTTP(S) using POST
  • Email
  • Email with JSON format
  • SQS

Different subscribers can subscribe to a single topic using any of the listed transport protocols.

Topic names must be unique within an AWS account and their length is limited to 256 alphanumeric characters and hyphens. Within the AWS infrastructure there is no single point of failure for SNS: messages are stored redundantly across multiple availability zones. SNS attempts to deliver the notifications in order, however, due to network issues this cannot be guaranteed. The maximum message size is 8KB.

Examples for using SNS

SNS is an attractive cloud service that delivers all the functionality necessary to develop a monitoring solution similar to the notifications of WebLogic Diagnostic Framework. Unfortunately, the AWS management console doesn’t integrate SNS with CloudWatch yet. You have to use the CloudWatch command-line (or write your own code) to trigger an SNS notification if a CloudWatch metric is above a configured threshold.

SNS is more general and can be used for tasks other than sending notifications based on monitoring data. Thanks to the email transport protocol for subscriptions it is rather easy to build your own newsletter system based on SNS. Would you feel more relaxed if you knew that you would receive an email if your AWS fee has exceeded a certain amount? You can easily implement a process that retrieves your account usage and then triggers an SNS notification to an email subscriber if things get too expensive.

In general, you should regard SNS as a generic notification service that can be used by all kinds of applications in the AWS cloud so the applications can interact with each other.

Best effort

Protocols such as email or HTTP are inherently unreliable, and there is no retry count for notifications that SNS couldn’t push to the subscriber. The notification delivery semantics of SNS is best-effort: There is no guarantee that your notification will ever be delivered. Don’t use SNS to build systems where the delivery of notifications is essential.

SNS is integrated with the AWS management console, but usually  you won’t be using SNS from the console, but from your applications or within custom tools.

SNS Topic

SNS APIs

There are SNS software development kits for Java, .NET, and PHP available for downloading at the following Amazon site:

http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=314

SNS is also supported by the popular open source library Typica. For an example about how easy it is to SNS with Typica have a look at the following Java class:

http://typica.googlecode.com/svn/trunk/test/java/TestSNS.java

 

SNS versus SQS

Simple Notification Service and Simple Queue Service are both messaging systems. SQS implements a one to one message pattern with at least once semantics and polling for the receivers. In contrast to SQS, SNS sends a notification to many receivers with best effort semantics for the message delivery. SQS is not integrated into the AWS management console. In contrast to SNS, where messages get lost if the receiver is not available, you can use SQS to decouple systems because the messages are stored persistently until they are retrieved.

Table 12: SNS with SQS Comparison

SNS SQS
Message pattern 1 to many 1 to one
Purpose Notifications Reliable Messaging
Message semantics Best effort At least once
Similar to JMS topics JMS queues
Message delivery Pushed to receiver Receiver poll
Maximum message 8 KB 64 KB

Integration with SQS

You can forward an SNS notification to an SQS queue. The publish method of SNS is synchronous, meaning that it only returns after the notification is pushed to the subscriber -which in this case means the message is stored in the SQS queue. Once the notification is placed in the queue you will benefit from the at-least once delivery semantics of SQS.

SQS is only used programmatically. To create an SQS subscription you have to subscribe to the SQS queue with the Amazon resource name of the queue. In addition, you have to set the access control policy of the queue to allow SNS to send notifications to the queue.

Integration with Oracle Service Bus

Did you ever wonder about how to bridge information from AWS to OFM? Connecting Oracle Service Bus with SNS directly, is possible with HTTP, or can be done indirectly over email. For a direct connection, create an OSB proxy service with the transport protocol HTTP, and register it as an SNS subscriber.

Pricing

There is a free usage tier for 100,000 SNS requests, 100,000 SNS HTTP(S) notifications, and 1000 email notifications.

Beyond the free tier Amazon will charge you for the API requests and notifications.

Oracle WebLogic JMS Queues or AWS Cloud Simple Queue Service (SQS)

This is a shortened extract of my my book Middleware and Cloud Computing.


AWS Simple Queue Service

Amazon’s Simple Queue Service (SQS) is a cloud service for reliable messaging. The SQS service with its queues is located off-host. So, similar to the elastic load balancing service, or the relational database service, you can use the service without having to start an EC2 instance.

Features

SQS is available in all four AWS regions with the same pricing. All regions are independent of each other so messages can never be in-between regions. Queue names have to be unique per region.

Highly available

Queues are highly available: Messages waiting in queues for their delivery are stored redundantly on multiple servers and in multiple data centers.

Unlimited
queue size

There is no limit for the number of messages or the size of a particular queue. One message body can be up to 64 KB of text in any format (default is 8KB). For larger messages you have to store the message somewhere else reliably, e.g. in S3, SimpleDB or RDS, and pass around a reference to the storage location instead of passing the message itself.

Message expiry

When a message remains in a queue (because there is no receiver removing the message from the queue), the message expires after a default of four days (or a configurable maximum of 14 days).

After receiving a message from a queue, the message is locked for a configurable timeout. While the message is locked it is invisible to other receivers. SQS uses this mechanism to ensure that messages are delivered once.

It’s the receiver’s responsibility to explicitly delete the message when it is processed successfully. If the receiver fails before it is able to delete the message, then the message becomes visible again after the timeout, and another receiver can receive it.

Access to queues is restricted to the AWS account owners, but you can specify in an access policy statement that a queue will be shared.

No
compression
or encryption

Encryption is not a built-in SQS feature, but depending on your privacy requirements you can consider encrypting the content of your message at an application level. Also, there is no built-in compression feature, but you can compress large messages at an application level before sending them.

At least once
semantics

The message delivery semantic is engineered to be “at least once”. This means your applications have to cope with message duplicates.

 

Usage

Access to SQS is purely programmatic. Currently, there are no command-line tools from AWS, and there is no integration for SQS into the AWS management console yet.

There are language bindings for Java, PHP, Perl and C#. Also, the Java Typica library supports SQS.

SQS is ideal for decoupling systems or applications running on EC2. From a design perspective, SQS has many features in common with JMS queues. The most important differences between SQS and JMS queues are listed in Table 1.

Table 1: SQS Comparison with WLS Queues

SQS Queues WebLogic JMS Queues
Max queue size Unlimited Limit depends on JVM heap and persistent store
Best Quality of Service At least once Exactly-once
with transactions
Configurable retries No Yes
Persistence Always Optional
Scalability Inherent With distributed queues
Availability Inherent Whole-server migration 

or JMS service migration

Message Order Not guaranteed Can be enforced even for distributed queues
Configurable quotas No Yes
Configurable flow control No Yes
Auto acknowledge No Yes
Time To Live configuration 1h to 14d 1 ms to ca. 2 mio years
Max message size 64 KB Unlimited,
default is 10,000 KB
Compression No Yes
Billing Free usage tier, then charged per request and data transfer amount Included with WLS

Conclusion

To conclude, SQS is an AWS cloud service that could replace WebLogic JMS queues.

Compared to JMS queues, SQS has fewer features, no auto acknowledgement of messages and no support for exactly-once message delivery. The advantage of SQS over JMS queues is SQS’ inherent availability, the virtually unlimited storage for messages and the zero configuration.

The inherent availability is an especially important factor to consider when deciding between SQS or JMS queues, because the built-in features offered by WebLogic for achieving availability of JMS are restricted in today’s clouds.

SQS is implemented off-instance; therefore, its availability is not affected if a particular EC2 instance becomes unavailable.

SNS

Interestingly, there is a cloud service for the counterpart to JMS topics as well. The AWS Simple Notification Service allows you to send messages to more than one receiver using transport protocols such as HTTP, email and even SQS.

SQS vs. OSB

In case you are wondering how this relates to Oracle Service Bus: Comparing SQS with Oracle Service Bus is like comparing apples with oranges, because in addition to the built-in JMS, service bus also supports protocol adaption, message flows with content-based routing, and most importantly, it is configuration driven.

In a nutshell: SQS is a queue service for the AWS cloud to decouple systems with message passing. As a cloud service it abstracts the Java EE specific details of JMS – nevertheless SQS is specific to AWS. Currently there is no cloud messaging service offered for the Rackspace cloud. Using an AWS specific service like SQS increases the effort to migrate to another cloud provider (and limits your possibilities to quickly switch to another cloud provider as a part of a contingency plan).

Pricing

There is a free usage tier for up to 100,000 requests per month. Beyond that, Amazon adds $0.01 per 10,000 SQS requests to your bill.

In addition, you have to pay for the data transfer as shown the figure below. Only data transferred between SQS and EC2 within a single region is free. Data transferred between different regions will be charged at Internet data transfer rates on both ends.

 

 

More details on my Middleware and Cloud Computing book.