Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tomcat is serving web page response content extremely slow #23231

Closed
sisqo opened this issue Sep 8, 2020 · 18 comments
Closed

Tomcat is serving web page response content extremely slow #23231

sisqo opened this issue Sep 8, 2020 · 18 comments
Labels
status: duplicate A duplicate of another issue

Comments

@sisqo
Copy link

sisqo commented Sep 8, 2020

After upgrading from spring-boot 2.2.7. to spring boot 2.3.3 we are experiencing extreme slowness in receiving web content in the production environment.

The document of our application is 30kb and is downloaded in over 8.9 sec. Normally it takes about 200 ms.

With version 2.3.3. every request experience this issue, going back to version 2.2.7. the problem disappears.

The problem occurs only in the production environment (Google Cloud VM), while in local we are unable to reproduce it.

I attach the chrome inspection page that verify the problem
image

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 8, 2020
@wilkinsona
Copy link
Member

Thanks for the report.

Unfortunately, it's not clear why you believe that this is a problem with Spring Boot itself. You also haven't described what sort of content you're serving, whether it's generated by a controller, static content served by Spring MVC, static content served by Tomcat, or something else.

Given that we haven't heard of similar problems from anyone else, I think it's highly likely that the problem is specific to your application and/or the deployment environment. Perhaps you could spend some time describing exactly how the content is being served and narrowing down the possible causes of the problem by trying different versions of Tomcat, etc.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Sep 8, 2020
@sisqo
Copy link
Author

sisqo commented Sep 8, 2020

Thanks Andy for your feedback, you are absolutely right I try to go into more detail.

The application where the problem occurs is a spring-boot MVC application with embedded Tomcat. The calls are standard get calls handled with @GetMapping by a @Controller.
The controller returns the name of the .jsp page we use to render the content.

The problem occurs in the download time of the document, and this happens with all controllers and with all calls of our application. For example, this is the home page eg: https://www.vino75.com (at the moment we are up with version 2.2.7 and the problem does not appear).

We are thinking that the problem is spring-boot because this is the only difference between deploy and with and without the problem: we have tried to deploy the application several times by changing only the version of spring-boot. With version 2.2.7 the problem does not arise while with 2.3.3 it occurs systematically.

I attach a screenshot of when the content is downloaded successfully.

Let me know if I can provide more information to better investigate the problem.

Schermata 2020-09-08 alle 19 45 54

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 8, 2020
@philwebb
Copy link
Member

philwebb commented Sep 8, 2020

Without a way to replicate things locally it's very hard to say what the problem might be. JSP rendering is usually handled directly by Tomcat, and Spring Boot doesn't really get involved that much. Can you try with Spring Boot v2.2.9.RELEASE just to see if it's a Tomcat upgrade that caused the issue?

If that works, we need to find a way to replicate the issue or get some more server-side logs that could shed some light on the cause.

@philwebb philwebb added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Sep 8, 2020
@sisqo
Copy link
Author

sisqo commented Sep 8, 2020

We have upgraded from Spring Boot v2.2.7.RELEASE to v2.2.9.RELEASE and the issue is not present.

Schermata 2020-09-08 alle 21 52 00

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 8, 2020
@philwebb
Copy link
Member

philwebb commented Sep 8, 2020

Are you able to create a minimal sample that you can share that fails in the same way when you deploy it to Google Cloud?

@philwebb philwebb added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Sep 8, 2020
@sisqo
Copy link
Author

sisqo commented Sep 9, 2020

We are unable to reproduce the problem, everything works fine locally.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 9, 2020
@wilkinsona
Copy link
Member

We understand that. We're interested in a minimal sample that reproduces the problem when deployed to Google Cloud.

@wilkinsona wilkinsona added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Sep 9, 2020
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Sep 16, 2020
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Sep 23, 2020
@glennvdv
Copy link

We are experiencing a similair problem. We upgraded from 2.2.5 to 2.3.4 and now in our production environment we are experiencing performance issues. Most Pages are 2 seconds slower then before the upgrade. We have Java melody for monitoring and there we can see that jsp are using high cpu and slower rendering. Unfortunately we haven't been able tot reproduce this locally.
Our app is packaged as a war (because of jsp) and are using embedded tomcat.

@asafbart
Copy link

same issue here also, upgrade 2.2.6 to 2.3.3, 10 times slower response time 5ms vs 50 ms for very simple configuration

@snicoll
Copy link
Member

snicoll commented Dec 22, 2020

@asafbart we've requested a minimal sample that we can use to reproduce the problem. Can you please do that in the form of a sample project that works with 2.2.6 and is much slower by only changing the version to 2.3.3? You can do so by attaching a zip to this issue or share a link to a GitHub repository. Thank you.

@asafbart
Copy link

asafbart commented Dec 23, 2020

@snicoll found the issue. it was an import which used a library in class path which changes autoconfig and does not officially support this version of spring boot

@sisqo
Copy link
Author

sisqo commented Dec 23, 2020

@snicoll found the issue. it was an import which used a library called jasypt-spring-boot and does not officially support this version spring

@asafbart thank you for your feedback, unfortunately it does not completely solve the case, in our project we don't have jasypt-spring-boot library

@asafbart
Copy link

@sisqo Probably unrelated, but generally my lesson is to see if some library on your classpath might affect the AutoConfiguration... but yeah maybe unrelated to you

@sisqo
Copy link
Author

sisqo commented Apr 1, 2021

Issue finally solved!!! This is the complete explanation:
https://vivekvara.medium.com/jsp-performance-degrades-from-spring-boot-2-3-x-for-undefined-attributes-8cb434f743c2#_=_

@wilkinsona
Copy link
Member

Thanks for following up, @sisqo. I don't understand why the EL implementation would only cause a problem on Google Cloud, but I'm glad that you got to the bottom of it. Your problem's a duplicate of #24744 which is the issue where we switched to the faster Apache EL implementation in 2.5.

@wilkinsona wilkinsona added the status: duplicate A duplicate of another issue label Apr 1, 2021
@sisqo
Copy link
Author

sisqo commented Apr 1, 2021

Thanks for following up, @sisqo. I don't understand why the EL implementation would only cause a problem on Google Cloud, but I'm glad that you got to the bottom of it. Your problem's a duplicate of #24744 which is the issue where we switched to the faster Apache EL implementation in 2.5.

It's not related to Google Cloud, now is clear. We were misled by the fact that this problem only occurred in production, but it was due to the fact that some parts of jsp were being processed in production that were obviously involved.
Thank you for your feedback and linking to the duplicate case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

7 participants