开发者

If I build a Spring app on App Engine, will it use multithreading by default or can it be configured to?

开发者 https://www.devze.com 2023-03-05 07:12 出处:网络
According to the latest App Engine news, Java apps can minimize the number of instance hours they use by enabling multi-threading - which will allow them to use more resources per instance-hour.

According to the latest App Engine news, Java apps can minimize the number of instance hours they use by enabling multi-threading - which will allow them to use more resources per instance-hour.

If I build a Spring app on App Engine, will it use multithreading by default to optimize its resource use?

Or is there so开发者_运维技巧mething I need to do to configure it to take advantage of this App Engine feature?


Servlet multithreading on AppEngine is off by default. You can simply enable it by adding a <threadsafe>true</threadsafe> element to appengine-web.xml.

In this case your servlets must be thread safe: basically this means that they should not have internal state (fields) or access to the state data must be synchronized.

About Spring: I'm not familiar with Spring internals, so I could not say if it's thread safe.

0

精彩评论

暂无评论...
验证码 换一张
取 消