Jira Development Server is VERY slow

I’m currently developing a Jira plugin with Java for Jira Server.
With the Jira Development SDK I run a local Jira Server on my beefy developer computer.
It has 32 Gibs of RAM and an i7 with 8 cores with up to 5GHz clock speed.

Still my loading times of any jira site are very long. I speak 30s on average and 5min in like 10% of the cases. Sometimes the sites load in an instant. In idle state Jira sucks 15-20% CPU resources and 2.7 Gigs of RAM.

It seems like Jira is doing nothing when I load a page, because I cannot se any change in the CPU usage when I hit F5. It waits for a arbitrary long time and then suddenly the CPU spikes to 100% for 2 seconds and the page is loaded.

When I releoad multiple tabs they all finish at the same time even when I hit “releoad” at different times.

It’s not only page loads that would maybe require IO work, but it also happens with my own REST endpoints inside the plugin. Even my “Hello World” test endpoint has the same long loading times.

At this point I already feel like Jira is blocking requests on purpose, maybe because this is a development version and Atlassian wants people to buy a license. It’r really tiring to develop like this. Can someone explain this?

Hi there. I expect you run your local Jira Server via “atlas-run.bat” or so, which starts the Jira in development mode, right? I did so in my case and I also struggled with extremely slow page loading (like about 10s). I think that this is caused by atlassian.dev.mode (Java) system property being ON, which in turn activates the atlassian.disable.caches property. It is probably this which causes “Cache-Control: no-cache” and similar headers to be sent for all, even static, resources to the browser. I think this should explain the sluggishness, because all the resources (and there are many) are re-downloaded every time.

It looks like the stuff described above is quite under-documented, so if anyone can explain how to alter these settings, it would be great. Atlassian themselves don’t seem to bother, maybe also because they are gradually turning down support for anything outside of the cloud solution…?

Hi @Philipp,

There are quite a few things to think about here. The development licence doesn’t block or run slower by design. So, as you’re running a development version, Jira will be using the local H2 database locally, which can be quite slow.

You might be running with the default memory settings, so in your pom.xml you can increase the memory to Jira with (at least that’s what I have for my testing)

<jvmArgs>-Xmx2g -Xms1g</jvmArgs>

Make sure you do a mvn clean every now and then to ensure you have a clean environment.

In terms of actual running speed, does this happen with all browsers? Including in private/incognito mode? It may well be that the browser or local machine/network is blocking the connection for some reason.

Try using Developer tools network tab in the browser to see if there’s a front end issue causing the delay. Otherwise, do the server logs provide anything helpful?

One final idea might be to run jconsole and see if there are excessive Garbage Collections. This document might help with this

Finally, are you connecting to the server with a debugger? Are there breakpoints that might be slowing things down? I know IntelliJ warns me with method breakpoints.

Regards,
James.

Hi @Philipp,

Don’t know if this is suitable for you, but I don’t use the instance started by atlas-run or atlas-debug, they are running very slow even if you disable the dev mode or enable the cache.

I’m using the local instance running in a docker container, this way of running lacks the quick reload ability, but as I compare the two ways, this lacking is worth the speed of instance.

I hope that it will give you a suggestion.

Hello all. I’ve done some further investigation and testing, which confirmed my ideas mentioned above. There is an article I recommend reading: Up to Eleven - Amplify Your Development Setup for Atlassian Server and Data Center. I’ll try to describe the resulting tips below, I hope it helps someone.

Not sure what and when you were testing this, but disabling dev mode makes a huge difference: from 10s to 0,5s per page load.

The main and biggest performance gain seems to come from enabling web resource batching, which can be toggled simply by pressing B when viewing a Jira page, when having quick reload activated. As suggested by @jrichards, if one looks into the Network tab of your browser, you can see just tens of requests instead of over one thousand requests after enabling web resource batching.

There is only a slight performance improvement when enabling the cache.

Finally, here are the various elements which you can put to your pom.xml to control the settings described above:

<build>
    <plugins>
        <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>jira-maven-plugin</artifactId>
            <version>${amps.version}</version>
            <extensions>true</extensions>
            <configuration>
                <productVersion>${jira.version}</productVersion>
                <productDataVersion>${jira.version}</productDataVersion>
                <systemPropertyVariables><!-- missing in the generated pom.xml altogether, not sure why -->
                    <atlassian.dev.mode>false</atlassian.dev.mode><!-- default: true -->
                    <atlassian.disable.caches>false</atlassian.disable.caches><!-- default: true when the one above is true -->
                </systemPropertyVariables>
                <enableQuickReload>true</enableQuickReload><!-- default: ? -->
                ...

Alternatively, passing system properties into environment variable ATLAS_OPTS (for example export ATLAS_OPTS="-Datlassian.dev.mode=false" on Linux) should work too, according to the linked article.

I believe if Atlassian really want to help their plugins’ developers, they should document stuff like this, as the out-of-the-box slowness can quickly discourage contributors from even starting developing.

1 Like