Google App Engine - Is this just a fluke, or could changing the version of an app improve cold-start time?
Here is the situation: I had an app with a cold start time of about 4 seconds. I was trying to improve the cold start time 开发者_运维技巧by removing a bunch of libraries and code I didn't really need. After doing that the cold start time was about 3 seconds latency, and 3 seconds CPU time used.
I changed the version number in appengine-web.xml, and nothing else. And now I have two versions of my app that have the exact same code, up and running.
For cold starts, the newer version uses 1800ms to 1900ms in CPU time.
For cold starts, the older version uses 2400ms to 3000ms in CPU time.
The exact same jsp page from each version is requested to test the cold start time. So far I have sampled 7 cold starts for each version.
hmmm, I think it is possible that there is some kind of caching of the look of your application, since gae upload is basically differential update (you send only changed files).
If you posted many changes on one version id, it is possible that GAE has many snapshots of your code.
Thus, if you do big changes (this is my rule of thumb) you should always change the version of your application, just to be sure. Additional commits I use only for bug fixes, never for big refactorings/adding or removing JARs. I think you also at that point you have new logs and simply "refreshing installation" of your application so GAE can do some optimizations...
Agree?
Sounds like a fluke, I don't see how changing the version number of your program could generate a change in speed. Unless there was a coincidental library update or some such.
Could the version number be changing an execution path somewhere? Perhaps in the XML parser or data binding that happens before your app is running?
精彩评论