Job taking too long time to create new pages

I have created a plugin (type=job) that loads data and then creates pages. Around 3000 pages are created and performance on our production server is much slower than while developing with the SDK.

The actual code to create the pages is pretty straightforward:

overviewPage = new Page();

pageManager.saveContentEntity(overviewPage, null);

Creating a page takes around 15 milliseconds but over 2000 milliseconds on our production server. Enabling profiling gives the following in the logs:

2012-06-11 15:27:59,048 DEBUG [scheduler_Worker-5] [atlassian.util.profiling.UtilTimerStack] log [2842ms] - ContentEntityManager.saveContentEntity()
  [0ms] - UserAccessor.getPropertySet()
  [0ms] - UserAccessor.getUserProfilePicture()
  [0ms] - UserAccessor.getUserProfilePicture()
  [656ms] - NotificationManager.getNotificationsBySpaceAndType()
  [689ms] - NotificationManager.getNotificationsByPage()
  [5ms] - LinkManager.updateOutgoingLinks()

Is there any reason why so much time is spent on the methods called by the NotificationManager?

I guess this is pretty vague, but any help would be appreciated. Thanks.

3 answers

[656ms] - NotificationManager.getNotificationsBySpaceAndType()
[689ms] - NotificationManager.getNotificationsByPage()
Would be the issue. Is the cache for these full? Maybe you can increase them. I would also do some SQL profiling on it.

My guess is that your production server contains different, and more, watchers or users. Which, upon creation, are all notified or checked if they need notifications. Could that be the explanation?

Do you really want to notify your users that you just created 3000 pages ? R K above is right.

Your answer is here:


boolean isMinorEdit()
Minor edits indicate that notifications should not be sent out informing users of changes made to the page.

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted Thursday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

178 views 12 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot