I have an application built as a spring boot fat jar. I host it in azure websites according to "official" documentation with a web.config similar too:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe" arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar "%HOME%\site\wwwroot\my-web-project.jar"">
</httpPlatform>
</system.webServer>
</configuration>
The application is monolithic in structure, not too large but does some mapping and has some layers to initialize so startup time is about 12 seconds locally. It runs an H2 in memory database just for testing purposes.
Actual deployment and getting it running on azure websites were never really a problem, but there's some real performance issues, at least with the settings I have.
Some settings of interest:
- Standard S1 instance (at the time of writing costing about ~$40USD/month).
- Webapp configured with:
- Tomcat8 (shouldn't really matter as the fat jar runs embedded tomcat)
- JDK 8
- Always on enabled
To be able to compare the numbers to something I ran the application on an Azure VM I have with similar (but not the same) specs and price range and ran the application on that one.
Here are some of the results:
Startup time of the application:
- Azure websites: ~2 minutes
- VM: 30 sek
Cold call:
Deployed/started the application and left it to make a call the day after.
- Azure websites: 31119 ms
- VM: 219 ms
Consequent call:
A call directly after the cold call, but to another endpoint.
- Azure websites: 2685 ms
- VM: 223 ms
My question here is: Do any one know if it is viable to run spring boot fat jars hosted on azure websites? As there is official documentation from Microsoft one would think that it is, and of course technically it is, but is it viable in production?
I'm not really after any debating about AWS vs Azure vs Google App Engine ....., or to write wars/jars or how to host it.
I have reasons to want it this way. If it's not possible I have other options but would like to explore the idea first and see if any one else has better experiences?
Edit: Just to add to the information. The database was empty for all calls. So that shouldn't add any overhead to speak off. No data was actually fetched only empty lists.