Starting the GAE development server instance of Google Compute Engine <phew>

I am trying to run a local dev server (java) for Google AppEngine on a Google instance for calculation. (we use instances of the computational core as test servers).

When we try to start the dev server using appcfg.sh, we notice that in 90% of cases the server does not start and freezes for 10 minutes before finnaly starts.

I know that the server is not running because this line is never printed on the console when it hangs:

Server default is running at http://localhost:8080/ 

Has anyone seen anything like this?

+6
source share
1 answer

In a nutshell:

- Engine java application SDK uses a pier as a servlet container for a development application server

-Jetty relies on java.security.SecureRandom

-SecureRandom consumes entropy from / dev / random by default

- / dev / random will block when available insufficient entropy is readable

A GCE instance, when used easily (for example, only as a test application server), does not generate entropy quickly. Thus, restarting the Java application server consumes the entropy from / dev / random faster than it replenishes, which leads to a lock behavior at startup, which you see as hanging at startup.

You can confirm that the hang is related to the SecureRandom problem by increasing the logging levels on the application server. You should see a message like "init SecureRandom" and then the locking behavior.

Some possible solutions to this problem are:

1) Adding the following to the call to dev_appserver.sh will cause SecureRandom to consume the source of entropy / dev / urandom, and not / dev / random:

- jvm_flag = "- Djava.security.egd = file: / DEV /./ urandom"

2) The presence of a GCE instance, which is used more intensively, should lead to the collection of entropy data, which in turn will make / dev / random less susceptible to blocking during subsequent restarts of the development application server.

+7
source

Source: https://habr.com/ru/post/946050/


All Articles