views:

416

answers:

5

It is the first time I have ever launched live a website (with Grails web framework under Amazon EC2 platform and Cloud Foundry) and I realized quickly that I am not ready for monitoring and maintening correctly my application in production mode (fortunately the website is accessible to a very limited number of users) .

The issues I have faced so far are:

  • Cannot change my views. I need to redeploy my application
  • I have no monitoring. I don't know who is connected, when do they sign in / sign out...
  • Redploying my application (upload WAR + deploy) takes at least 30 minutes.
  • I don't know how to restart my Tomcat server without a redeploy through Cloud Foundry !
  • ...

So, my question is very simple:

What tools (including grails plugins) and methods can you recommend me for taking me out from my current blindness?

+1  A: 

I tried Cloud Foundry in it's early days and found it a little rough. Sounds like that's still the case with 30+ minute deploys and the inability to restart your tomcat server. Half of your problems could be solved if you just created your own EC2 instance, installed tomcat and managed your own deployments. That'll let you bounce tomcat through shell access:

sudo /etc/init.d/tomcat6 restart

and redeploy your app

sudo /etc/init.d/tomcat6/stop
cp my.war /to/tomcat/dir 
sudo /etc/init.d/tomcat6 start

or else you could do it through the tomcat admin console, but I find it to be flaky.

Regarding monitoring, there are a couple of ways you can do that. The easiest is to add CloudWatch monitoring to your system. That'll give you more insight into the performance of the application.

For more detailed monitoring regarding who's connecting to your app, I'd suggest looking at Google Analytics or Mint. If you need to get beyond that (with per user monitoring), you'll likely have to roll your own logging/tracking for what meets your needs. There are also other paid packages out there along the lines of Google Analytics and Mint that you can integrate with, but what fits your needs best, I can't say.

Ted Naleid
+1  A: 

For actual monitoring of deployed system you can also use Hiperic HQ. It's a monitoring solution from Spring Source, who also are owners of Grails Framework.

It can manage, at your case:

  1. tomcat server
  2. database
  3. linux
  4. network
  5. etc

btw redeploying app with changes is ok. it's a very bad practice to modify running app, on the production server.

splix
+2  A: 

I am not sure how much this will help, however I use the JavaMelody Grails Plugin(http://www.grails.org/plugin/grails-melody) I use it to see if the site is being used before I pull down the service.

Hope that helps.

Scott Warren
+1  A: 

I don't know if JMX and JConsole can help, but that might be a good way to see what the status of JMX-enabled POJOs is. Spring makes this easy to do.

duffymo
+1  A: 
  1. Yes, you need to re-deploy your app when you change stuff in it, there's no way around that.
  2. Deploy/re-deploy time has been cut significantly recently if using the grails plugin (btw, what version of the plugin do you use?) In some cases the upload time is as short as 15 seconds. Add 2-3 minutes for Amazon to spin up the instances and the deploy time is still pretty manageable. For re-deploy the instances don't have to be started, so it's even less than that.
  3. To restart Tomcat login into your CloudFoundry account, click on the Deployment details, click on the instance that's running your Tomcat, and there will be a button "Restart service" that will do just that - restart Tomcat service.
  4. You don't have to start your own EC2 instances in order to get a shell access. Copy the public DNS name of the instance from DeploymentDetails, and SSH into it using the private key you entered when registering for Cloudfoundry. Example:

    ssh -i /path/to/gsg-keypair.pem root@your_instance_DNS_name

Dmitriy