Performance degradation and high response time on Jira application due to changes in velocity.properties

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

Performance degradation and high response time on Jira application due to changes in velocity.properties
Velocity is a server-side templating language used by Jira to render page content. Velocity allows Java objects to be called alongside standard HTML.
So while rendering contents on the Jira page and its layout, we use these templates to get the HTML format as well as the text and other contents

Now, this is where we see threads are slow. HOWEVER, we do not see threads being hung. They are moving slow, which means that the application is not completely unresponsive.

診断

If you could collect thread dumps at the time of the issue, You will notice that the below threads are very slow in pace. 

Most of the HTTP executable threads are waiting in the below condition

"https-jsse-nio-7010-exec-36 url:/sr/jira.issuev.../SearchRequest.xml username:XXXXX" #3148 daemon prio=5 os_prio=0 cpu=232828.19ms elapsed=9696.05s tid=0x00007f58080b0800 nid=0x1618 waiting for monitor entry [0x00007f575c51e000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:571)
- waiting to lock <0x00000006aae019f8> (a org.apache.velocity.runtime.VelocimacroFactory)
at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1562)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:199)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBodyImpl(DefaultVelocityManager.java:117)
at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBody(DefaultVelocityManager.java:97)
at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.toWriterImpl(DefaultVelocityTemplatingEngine.java:122)
at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asHtml(DefaultVelocityTemplatingEngine.java:113)
at com.atlassian.jira.plugin.AbstractJiraModuleDescriptor.writeHtml(AbstractJiraModuleDescriptor.java:127)
at com.atlassian.jira.plugin.AbstractJiraModuleDescriptor.getHtml(AbstractJiraModuleDescriptor.java:106)
at com.atlassian.jira.issue.views.IssueXMLView.getBody(IssueXMLView.java:177)


You notice that this thread is waiting to lock 0x00000006aae019f8 which is held by exec-28

"https-jsse-nio-7010-exec-28 url:/rest/greenhopp...issue/details.json username:XXXXX" #3140 daemon prio=5 os_prio=0 cpu=247513.52ms elapsed=9700.25s tid=0x00007f58080aa800 nid=0x160b runnable [0x00007f5761b55000]
java.lang.Thread.State: RUNNABLE
at org.apache.velocity.runtime.parser.ParserTokenManager.getNextToken(ParserTokenManager.java:4237)
at org.apache.velocity.runtime.parser.Parser.jj_scan_token(Parser.java:3327)
at org.apache.velocity.runtime.parser.Parser.jj_3_7(Parser.java:2875)
at org.apache.velocity.runtime.parser.Parser.jj_2_7(Parser.java:2560)
at org.apache.velocity.runtime.parser.Parser.Reference(Parser.java:1317)
at org.apache.velocity.runtime.parser.Parser.DirectiveArg(Parser.java:610)
at org.apache.velocity.runtime.parser.Parser.Directive(Parser.java:787)
at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:373)
at org.apache.velocity.runtime.parser.Parser.Directive(Parser.java:888)
at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:373)
at org.apache.velocity.runtime.parser.Parser.process(Parser.java:311)
at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:105)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1130)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1085)
at org.apache.velocity.Template.process(Template.java:124)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:446)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:354)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1400)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1379)
at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:625)
- locked <0x00000006aae019f8> (a org.apache.velocity.runtime.VelocimacroFactory)


原因

In the velocity.properties file, the resource loader cache was disabled. This could end up slowing up parsing velocity templates.

class.resource.loader.cache=false

ソリューション

Make sure to enable the resource loader cache in the velocity.properties file. Default Location of velocity.properties : <jira-installation-directory>/atlassian-jira/WEB-INF/classes/

class.resource.loader.cache=true



最終更新日 2023 年 9 月 14 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.