Re: Wicket And GAE
Per #1, the GAE people highly discourage pinging to keep the instance alive. Also, I tried it for a bit anyways, and it didn't help. I get instance restarts in the MIDDLE of page loads (hint hint: I could use help on my other post!). The thing to realize with GAE is that you need to keep everything out of your Application init(). It works perfectly for me. It's not so much pinging since you're not pinging a port. It's actually getting the servlets to stay loaded and the trick is to generate *enough cpu usage* not just *enough traffic* (my JVM stays hot for about 2% of the cpu daily quota). For example, loading a very simple page once every 10 seconds may not keep your JVM hot. Loading a more complex page once every 10 seconds will keep it hot. Also, you need to give the GAE some time to adjust to the new cpu load before it stops unloading your servlets. I've got the graphs to prove it :) Anyway, I don't really care what the GAE people say. They have a problem to solve, especially for the heavier frameworks like Grails. On Wed, Apr 14, 2010 at 6:07 AM, jbrookover jbrooko...@cast.org wrote: Per #1, the GAE people highly discourage pinging to keep the instance alive. Also, I tried it for a bit anyways, and it didn't help. I get instance restarts in the MIDDLE of page loads (hint hint: I could use help on my other post!). The thing to realize with GAE is that you need to keep everything out of your Application init(). It takes some effort, but you can get pretty good Wicket apps running on GAE. It's certainly a lot harder, though, than running it on your own. Jake marc fawzi wrote: Hey guys I'm new to Wicket I've made two discoveries with respect to GAE and Wicket: 1. I figured out how to keep my GAE app instance hot at all times (well, at least for 99.9% of the time.. the GAE still produces transient errors every now and then) -- It's really simple: just have a script that launches a new task every 12 seconds and set the task url to a url that is routed to/handled by the script itself then when the script runs again (in this way) it will do two things: 1) urlfetch a url that is handled by the app you wish to keep hot (which is on another *.appspot.com url) and 2) starts schedule another task in 12 seconds. Infinite task loop. Google does kill the task loop eventually so then you need a cron job to run every 1 hour to restart the script :) and that's it. 2. Someone (srfarley) is working on a version of Wicket for GAE: This project provides a template to help you get started with building a Wicket http://wicket.apache.org/ application for Google App Enginehttp://code.google.com/appengine/. It is a re-implementation of the Guestbook application described by the App Engine tutorial http://code.google.com/appengine/docs/java/gettingstarted/. Whereas the tutorial uses raw servlets and JSP to demonstrate a some of the basic features of App Engine, this project uses Wicket as the web framework. In addition, the project defines classes for handing persistence using JDOhttp://code.google.com/appengine/docs/java/datastore/, and uses Google Guice http://code.google.com/p/google-guice/ to inject instances of these classes into the Wicket pages for interacting with the App Engine datastore. For unit testing, the project contains base classes that set up the App Engine development environment so you can write tests against the full stack, including those that interact directly with the Wicket pages. The testing framework is TestNG http://testng.org/doc/index.html, but it is possible to convert them to JUnit tests with some work. http://code.google.com/p/wicket-gae-template/ Given that I've never used Wicket (I looked at a couple examples so far) I'm hoping that we can help each other as we attempt to get good outcome for our Wicket+GAE implementations To make things more challenging, I'm using Scala, which I've never run on GAE before and I'm also new to it :) Is there an IRC channel for Wicket users or is this the best place for newbies like me to post questions and get help? Thanks, Marc On Tue, Apr 13, 2010 at 6:20 AM, jbrookover jbrooko...@cast.org wrote: I'm pretty committed to a project using Wicket on GAE. I haven't encountered any deserialization issues that people have been bringing up, which makes me worry a bit since I've encountered (and dealt with) a slew of other issues :) Regarding the HttpSessionStore, I discovered a bad coding practice of mine when every single session entry in the datastore was 500KB+. Once I resolved that issue, using more transient fields and detachable models, I'm relatively happy with the results. GAE, by default, uses the MemCache to implement this feature so it should be relatively speedy. It's no different from any other application storing data
Re: Wicket And GAE
Hey guys I'm new to Wicket I've made two discoveries with respect to GAE and Wicket: 1. I figured out how to keep my GAE app instance hot at all times (well, at least for 99.9% of the time.. the GAE still produces transient errors every now and then) -- It's really simple: just have a script that launches a new task every 12 seconds and set the task url to a url that is routed to/handled by the script itself then when the script runs again (in this way) it will do two things: 1) urlfetch a url that is handled by the app you wish to keep hot (which is on another *.appspot.com url) and 2) starts schedule another task in 12 seconds. Infinite task loop. Google does kill the task loop eventually so then you need a cron job to run every 1 hour to restart the script :) and that's it. 2. Someone (srfarley) is working on a version of Wicket for GAE: This project provides a template to help you get started with building a Wicket http://wicket.apache.org/ application for Google App Enginehttp://code.google.com/appengine/. It is a re-implementation of the Guestbook application described by the App Engine tutorial http://code.google.com/appengine/docs/java/gettingstarted/. Whereas the tutorial uses raw servlets and JSP to demonstrate a some of the basic features of App Engine, this project uses Wicket as the web framework. In addition, the project defines classes for handing persistence using JDOhttp://code.google.com/appengine/docs/java/datastore/, and uses Google Guice http://code.google.com/p/google-guice/ to inject instances of these classes into the Wicket pages for interacting with the App Engine datastore. For unit testing, the project contains base classes that set up the App Engine development environment so you can write tests against the full stack, including those that interact directly with the Wicket pages. The testing framework is TestNG http://testng.org/doc/index.html, but it is possible to convert them to JUnit tests with some work. http://code.google.com/p/wicket-gae-template/ Given that I've never used Wicket (I looked at a couple examples so far) I'm hoping that we can help each other as we attempt to get good outcome for our Wicket+GAE implementations To make things more challenging, I'm using Scala, which I've never run on GAE before and I'm also new to it :) Is there an IRC channel for Wicket users or is this the best place for newbies like me to post questions and get help? Thanks, Marc On Tue, Apr 13, 2010 at 6:20 AM, jbrookover jbrooko...@cast.org wrote: I'm pretty committed to a project using Wicket on GAE. I haven't encountered any deserialization issues that people have been bringing up, which makes me worry a bit since I've encountered (and dealt with) a slew of other issues :) Regarding the HttpSessionStore, I discovered a bad coding practice of mine when every single session entry in the datastore was 500KB+. Once I resolved that issue, using more transient fields and detachable models, I'm relatively happy with the results. GAE, by default, uses the MemCache to implement this feature so it should be relatively speedy. It's no different from any other application storing data in the javax.servlet.http.HttpSession. My only lingering problem (another thread here) is that GAE can trash your application instance at any point. If you are relying on SharedResources, those can go away - even in the middle of an active page load, potentially breaking some links. Currently looking for a way around that :) Jake Richard Nichols-3 wrote: Biggest problem, and IMO a show stopper, is the Serialization issues. Since Wicket serializes session data (pagemap etc) you have to enable the GAE session-store to get wicket working correctly on GAE. GAE clusters sessions by writing them to the GAE data store to spread the session across the cluster - and writes are *slow*. Worse though, if you create an incompatible change to a serialized page/component/model, when that user returns to your application, GAE will quietly fail and the user will get a blank page. Checking the GAE error log reveals a deserialization error in the core GAE engine. This is because the session reserialization in GAE is handled at the GAE/Jetty level and any error in reconsitution of the error currently breaks GAE completely. Google has acknowledged this problem, but for most frameworks it's not a big deal as you don't store large Objects in the HttpSession. I had planned to deploy the site I'm currently working on http://www.onmydoorstep.com.au/ on GAE but after a few weeks of running the prototypes on GAE, I found the performance to be too poor and the infrastructure too flakey for a production site. NB - It's certainly possible to create high-performance/reliable sites using GAE/J, but Wicket is not a suitable framework due to the Serialization data store write problem. Even if the performance were better and the