Run/deploy slow under Tomcat8

I am licensed to use Aspose total for JAVA and am currently using Aspose.PDF v23.1 and Aspose.Words v23.1 and Aspose.Html v23.1 running on Tomcat 8.0.14 using JDK 1.8.0_31,below is my Maven dependency:

com.aspose
aspose-html
23.1
jdk1.8


com.aspose
aspose-pdf
23.1


com.aspose
aspose-words
23.1
jdk17

I create a servlet which only contains few code, such as create a new document with pdf,html or word and pack it as a war.

Run it on My develop machine with the following:
OS: Win7 SP1 64bit 202110
Tomcat: v8.0.14
JDK: v1.8.0_31
The issue is It will cost even ten more minutes to complete the code.
I also test the war under Tomcat7 on this machine, it seems no problem, and I also test the code under JDK1.8.0_31 as an application, still no problem.

Attachment is the web applcation source, also attached the response with time I got on my development win7 machine.
src.zip (3.9 KB)

tomcat8 response.zip (544 Bytes)

Then, I run it on server for production env with the following:
OS: Linux 3.10.0-1062.4.3.el7.x86_64
Tomcat: V8.0.53.0
JDK: v1.8.0_71-b15
There is another kinds of issue, Tomcat will start the server with a very very long time(30 more minutes) .

Our production env is Tomcat8, we need ASPOSE work on this env, can you investigate and resolved this? Thanks.

Best Regards

@marksmancl

Please note that the performance of the APIs are measured on subsequent runs of the code snippet as on the first run, API loads necessary resources into the memory. Furthermore, have you tried with the latest available versions of the APIs i.e. 23.7? We request you please try using the latest versions of the APIs and let us know in case you still notice performance issues. We will log an investigation ticket and share the ID with you.

Thanks for the reply.
I use the newest version (html v23.8, pdf v23.7, words v23.7), the problem still exists.

@marksmancl

Please let us perform some initial investigation and we will get back to you shortly.

@marksmancl

We have researched different versions of tomcat on Windows 10 OS, and got the following result:
Tomcat 8.0.14 [local]
org.apache.catalina.startup.Catalina.start Server startup in 971510 ms
PDF
Thu Aug 31 12:56:08 EEST 2023 request received …
Thu Aug 31 12:56:08 EEST 2023 start to handle license…
Thu Aug 31 13:01:38 EEST 2023 apply license successful.
Thu Aug 31 13:01:38 EEST 2023 start to create a document…
Thu Aug 31 13:02:40 EEST 2023 create document success. 1.7
Thu Aug 31 13:02:46 EEST 2023 test completed.
Word
Thu Aug 31 13:19:47 EEST 2023 request received …
Thu Aug 31 13:19:47 EEST 2023 start to handle license…
Thu Aug 31 13:20:31 EEST 2023 apply license successful.
Thu Aug 31 13:20:31 EEST 2023 start to create a document…
Thu Aug 31 13:20:46 EEST 2023 create document success. content is:
Thu Aug 31 13:20:46 EEST 2023 test completed.

Tomcat 8.0.53 [local]
org.apache.catalina.startup.Catalina.start Server startup in 958789 ms
PDF
Thu Aug 31 14:54:18 EEST 2023 request received …
Thu Aug 31 14:54:18 EEST 2023 start to handle license…
Thu Aug 31 14:54:23 EEST 2023 apply license successful.
Thu Aug 31 14:54:23 EEST 2023 start to create a document…
Thu Aug 31 14:54:23 EEST 2023 create document success. 1.7
Thu Aug 31 14:54:23 EEST 2023 test completed.
Word
Thu Aug 31 14:54:45 EEST 2023 request received …
Thu Aug 31 14:54:45 EEST 2023 start to handle license…
Thu Aug 31 14:54:47 EEST 2023 apply license successful.
Thu Aug 31 14:54:47 EEST 2023 start to create a document…
Thu Aug 31 14:54:47 EEST 2023 create document success. content is:
Thu Aug 31 14:54:47 EEST 2023 test completed.

Tomcat 8.5.93 [local]
org.apache.catalina.startup.Catalina.start Server startup in 11053 ms
PDF
Thu Aug 31 15:05:59 EEST 2023 request received …
Thu Aug 31 15:05:59 EEST 2023 start to handle license…
Thu Aug 31 15:06:00 EEST 2023 apply license successful.
Thu Aug 31 15:06:00 EEST 2023 start to create a document…
Thu Aug 31 15:06:01 EEST 2023 create document success. 1.7
Thu Aug 31 15:06:01 EEST 2023 test completed.
Word
Thu Aug 31 15:06:16 EEST 2023 request received …
Thu Aug 31 15:06:16 EEST 2023 start to handle license…
Thu Aug 31 15:06:17 EEST 2023 apply license successful.
Thu Aug 31 15:06:17 EEST 2023 start to create a document…
Thu Aug 31 15:06:17 EEST 2023 create document success. content is:
Thu Aug 31 15:06:17 EEST 2023 test completed.

HTML library throw exception: The given key was not present in the dictionary.
Tomcat 8.5.93 start time with aspose-web.war is 11 seconds.
Aspose Word and PDF libraries code runs are 1-2 seconds.

Also, we have researched different versions of Tomcat on Debian OS (in docker), and got the following result:
Tomcat 8.0.53 [docker]
org.apache.catalina.startup.Catalina.start Server startup in 1074014 ms
PDF
Thu Aug 31 13:41:20 UTC 2023 request received …
Thu Aug 31 13:41:20 UTC 2023 start to handle license…
Thu Aug 31 13:41:24 UTC 2023 apply license successful.
Thu Aug 31 13:41:24 UTC 2023 start to create a document…
Thu Aug 31 13:41:25 UTC 2023 create document success. 1.7
Thu Aug 31 13:41:25 UTC 2023 test completed.
Word
Thu Aug 31 13:41:43 UTC 2023 request received …
Thu Aug 31 13:41:43 UTC 2023 start to handle license…
Thu Aug 31 13:41:44 UTC 2023 apply license successful.
Thu Aug 31 13:41:44 UTC 2023 start to create a document…
Thu Aug 31 13:41:45 UTC 2023 create document success. content is:
Thu Aug 31 13:41:45 UTC 2023 test completed.

Tomcat 8.5.93 [docker]
org.apache.catalina.startup.Catalina.start Server startup in 8166 ms
PDF
Thu Aug 31 13:15:46 UTC 2023 request received …
Thu Aug 31 13:15:46 UTC 2023 start to handle license…
Thu Aug 31 13:15:47 UTC 2023 apply license successful.
Thu Aug 31 13:15:47 UTC 2023 start to create a document…
Thu Aug 31 13:15:47 UTC 2023 create document success. 1.7
Thu Aug 31 13:15:47 UTC 2023 test completed.
Word
Thu Aug 31 13:15:28 UTC 2023 request received …
Thu Aug 31 13:15:28 UTC 2023 start to handle license…
Thu Aug 31 13:15:29 UTC 2023 apply license successful.
Thu Aug 31 13:15:29 UTC 2023 start to create a document…
Thu Aug 31 13:15:30 UTC 2023 create document success. content is:
Thu Aug 31 13:15:30 UTC 2023 test completed.

HTML library throw exception: The given key was not present in the dictionary.
Tomcat 8.5.93 start time with aspose-web.war is 8 seconds.
Aspose Word and PDF libraries code runs are 1-2 seconds.

We attached our research project.
Commands for reproduction:

mvn clean install
docker build -t aspose-tomcat-8593 .
docker run -p 8593:8080 aspose-tomcat-8593
open: http://localhost:8593/aspose-web

aspose-web.zip (63.9 KB)

Based on the investigation described above, we can conclude that this is not a bug. Please upgrade Tomcat 8 to the latest version (now it is 8.5.93)

About Aspose.HTML for Java HTMLJAVA-1580 ticket has been logged in our issue tracking system about which we will keep you informed in this forum thread. Please spare us some time.

Thanks. This is very helpful.

@marksmancl,

You are welcome. If you have any further queries or comments, please feel free to write back to us.