Xwiki 9.11.4 high cpu issue and xwiki slow

Hello,

Sometime my xwiki on Tomcat is very slow and I tried to identify the source of this issue.
This issue is encountered randomly the afternoon.
I have javamelody installed and I can watch 33 requests in red color on
https://xxxxxxxxxxxxx/bin/get/XWiki/Notifications/Code/NotificationsDisplayerUIX?outputSyntax=plain&action=getUnreadCount
with 4 second each…

I checked my list of users with 1 or more XWiki.Notifications.Code.NotificationFilterPreferenceClass object and I have 20 with 10 or 30 object then I don’t know if it is related with.

Do you know how I can resolv my issue (with javamelody or another way)?

ty

Pascal B

That’s interesting. We need be able to understand if the new notifications feature still has performance issues. Normally @gdelhumeau is supposed to have fixed them but maybe there are some remaining.

@gdelhumeau What method do we have to debug perf issues on Notifications? Do you have some special debug logs to turn on, or some other way? Thanks

You may be able to get more information with glowroot actually. You can see slow requests and tie it with the underlying code.

The notifications performances issue we had has been fixed in XWiki 9.11.8.

ah cool so there’s a good chance that @Pbas 's issue is already fixed :slight_smile: When can you upgrade and test @Pbas ? :slight_smile:

Hum it is not simple for instant to upgrade xwiki version, because I’m home actually (because a nice doctor removed pieces of iron from my leg after my leg broken one year ago) and I need to merge all my customization before upgrade…

Anyways I found this old post about: https://forum.xwiki.org/t/xwiki-10-5-entended-cpu-spike-while-adding-new-pages/3238/34

I need to clean XWiki.Notifications.Code.NotificationFilterPreferenceClass object on every users
and set xwiki.plugin.watchlist.automaticwatch=none

Is it enough to fix my issue on xwiki 6.11.4 ?

You mean 9.11.4 I guess.

I don’t know if it’s enough but it cannot hurt. You could try.

Yes 9.11.4 sorry.
Ok I will try and keep you in touch

Here my piece of code from your snippet to remove all XWiki.Notifications.Code.NotificationFilterPreferenceClass object on all xwiki user

#if ($request.confirm == '1')
  #set($className='XWiki.Notifications.Code.NotificationFilterPreferenceClass')
  #set($hql = "select obj.name from BaseObject obj where obj.className='XWiki.XWikiUsers'")
  ## display 10 users
  ## set($results = $xwiki.search($hql, 10, 0))
  #set($results = $xwiki.search($hql))
  #foreach ($User in $results)
    ## * [[$User]]
    ## if you have more than one object on a page, you will have to loop over them and use "$doc.use"
    #set ($targetDoc = $xwiki.getDocument("$User"))
    #set ($result = $targetDoc.removeObjects("$className"))
    #if ($result)
      #set ($discard = $targetDoc.save('Removed all xobjects'))
      * XObjects $className removed on [[$targetDoc]]!
    #else
      ## Error: XObjects not removed on [[$targetDoc]] or object missing!
    #end
  #end
#else

----

[[**SUPPRESSION** des objets XWiki.Notifications.Code.NotificationFilterPreferenceClass de tous les utilisateurs>>||queryString='confirm=1']]
#end