Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 761139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:48:09+00:00 2026-05-14T15:48:09+00:00

One of the more common complaints I have read about the AppEngine database (for

  • 0

One of the more common complaints I have read about the AppEngine database (for Java) is that it is extremely slow when it come to “cold start time”. What does this mean? And is it something I should be worried about?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:48:10+00:00Added an answer on May 14, 2026 at 3:48 pm

    It is something you should be worried about.

    Google App Engine spins up a new JVM to service requests when your app has not had any requests for a certain time period. Getting a handle on the datastore from “cold” – i.e. for the first time in a JVM – can take a considerable amount of time, as much as 5+ seconds.

    After you have a handle on the datastore (normally an instance of PersistenceManager), everything is fine (for the life of the JVM!).

    EDIT:

    Spinning up a fresh JVM in GAE-Java is also slow. Read http://code.google.com/appengine/docs/java/datastore/overview.html and you will see that they use a Singleton class for the availability of a PersistenceManagerFactory, as they describe the operation of instantiating one as “expensive”.

    You could test it out for yourself. Create a brand new application on GAE-Java that merely returns “Hello World!” and you will find that the first request to the application takes a number of seconds.

    Add a request for the PersistenceManagerFactory and you will find that the first request takes a few seconds more.

    EDIT EDIT:

    I have now created this test for your viewing pleasure:

    http://stackoverflowanswers.appspot.com/helloworld

    You will either instantly see “Hello, world 0” or “Hello, world xxxx” where xxxx is a count in MS of how long it took to get a handle on the datastore. I think that the complexity and number of indexes in the datastore may have an impact on how long it takes to get a handle on the datastore, as it is quicker in this app than in some of my other apps.

    PMF is an exact copy of the one provided in the app engine docs.

    @SuppressWarnings("serial")
    public class HelloWorldServlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse resp)
                throws IOException {
            long a = System.currentTimeMillis();
            PersistenceManager p = PMF.get().getPersistenceManager();
            long b = System.currentTimeMillis() - a;
            resp.setContentType("text/plain");
            resp.getWriter().println("Hello, world "+b);
        }
    }
    

    EDIT EDIT EDIT:

    I changed my code so that it instantiates a PersistenceManagerFactory with each request and now it throws 500 server errors, and in the logs:

    javax.jdo.JDOFatalUserException:
    Application code attempted to create a
    PersistenceManagerFactory named
    transactions-optional, but one with
    this name already exists! Instances
    of PersistenceManagerFactory are
    extremely slow to create and it is
    usually not necessary to create one
    with a given name more than once.
    Instead, create a singleton and share
    it throughout your code. If you
    really do need to create a duplicate
    PersistenceManagerFactory (such as for
    a unittest suite), set the
    appengine.orm.disable.duplicate.pmf.exception
    system property to avoid this error.

    I don’t think I need to provide any more proof that getting a handle on the datastore in app engine is SLOW.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I have one more question lol. I am using a script that
One more question about most elegant and simple implementation of element combinations in F#.
I have added eth0:1 with one more ip to the interface file of my
In relation to this question ( Efficient hashCode() implementation ) I have one more
I have a simple java maven project. One of my classes when executing needs
In Common-Lisp CLOS Is it possible to dynamically add one more super class in
It becomes more and more common where in my app I have to maintain
I have a JAX-RS based ( RESTEasy ) REST server that uses Java annotations
I have some methods that are common across a few of my domain classes.
Here one more basic question asked in MS interview recently class A { public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.