There's now an issue proposing some changes to the documentation for Java
warm-up
requests<http://code.google.com/p/googleappengine/issues/detail?id=4288>.
The last section of the current document is quite misleading. I can't say
whether there's a dependency on defining a servlet named _ah_warmup. On the
other hand, if the web.xml doesn't include a servlet-mapping with an
explicit url-pattern of /_ah/warmup, I haven't seen any of the warm-up
behavior, at all. Of course, it's pretty difficult to examine the GAE
behavior for wamups, particularly without knowing what its heuristics are.
In other words, the app needs to provide a servlet that can be called in the
warmup context. That means web.xml should include something like
<servlet>
<servlet-name>_ah_warmup</servlet-name>
<servlet-class>com.example.warming_test.WarmingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>_ah_warmup</servlet-name>
<url-pattern>/_ah/warmup</url-pattern>
</servlet-mapping>
The servlet class needn't do anything:
package com.example.warming_test;
import java.io.IOException;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
@SuppressWarnings("serial")
public class WarmingServlet extends HttpServlet {
private static Logger log =
Logger.getLogger("com.example.warming_test");
@Override
public void log(String msg) {
log.finest(msg);
}
@Override
public void init() throws ServletException {
log("Warming init ");
}
@Override
public void service(ServletRequest arg0, ServletResponse arg1)
throws ServletException, IOException {
log("Warming service");
}
}
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.