One user having bad performance, can't delete her

Hi all

Long time no see, which means XWiki is running smoothly on our side :wink: Well, mostly.

Since the beginning, we’re using LDAP to have all 9 employees on board. Now one user is having major issues with her perfomance. Loading takes minutes, editing takes ages, saving falls into a timeout. First we thought her problems are due to her hardware/network/browser, but that’s all fine.

I created a local user for her and everything is as fast as it could be.

Now I thought that deleting and re-adding her user would be an idea, and here’s the (other) problem:

- Error while evaluating velocity template [deleteuorg.vm]

In full:

2018-04-25 16:39:36,030 [http://ccsrv06.carriercall.ch:8183/XW_003D4/bin/admin/XWiki/XWikiPreferences?xpage=deleteuorg&docname=XWiki.bschwoiger&form_token=rrxtpPp499ZtqYkpwTIUmQ] ERROR c.x.x.XWiki                    - Error while evaluating velocity template [deleteuorg.vm]
org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [/templates/deleteuorg.vm]
    at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:227)
    at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:361)
    at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:820)

A bit further down it says:

java.lang.OutOfMemoryError: Java heap space at 56:/templates/deleteuorg.vm[line 3, column 39

The whole line:

Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'delete' in  class com.xpn.xwiki.api.Document threw exception java.lang.OutOfMemoryError: Java heap space at 56:/templates/deleteuorg.vm[line 3, column 39]

As well, when modifying her user, XWiki throws exceptions.

How can I safely remove poor Brigitte from XWiki?

Thanks a ton in advance!

André

Edit: We’re running 10.1

This sounds like a document (the user profile here) with way too many attachments (or too big) for a database attachment store.

Hi Thomas

I’m afraid, she doesn’t have a single attachment on her profile - at least no visible one.

Huge history ?

That could be, she’s editing a lot … what helps here?

omg, she has 2400 edits in her profile history - one user (he’s not even working today) seems to be editing her profile every few minutes!

That’s probably the reason for the OOM then, when you don’t use the filesystem store for deleted document the whole document with history and attachment end up in the memory (several times) before being sent to the recycle bin table.

one user (he’s not even working today) seems to be editing her profile every few minutes!

Some script maybe ?

I’ll have to ask him when he’s back from holidays. I don’t think so, though.

Would you mind pointing me to the right table in the DB? I don’t feel like clicking “delete history” 200 times :wink:

Edit 1: I found ACTIVITYSTREAM_EVENT, but deleting records there doesn’t seem to have the desired effect.

Edit 2: Found the records in XWIKIRCS, same here…

A safer trick is to click Show minor edits and add &perPage=2000 to the URL (or less if it’s really too slow). Then you can delete a range of versions using Delete selected version range. Note that perPage is not required but then you can only delete 20 version (the default).

1 Like

This is the right table but then you still have the history in the cache.

I started deleting 15 minutes ago using the perPage hint (thanks for that). It’s still processing …

I guess I’ll take down the instance, delete the records from XWIKIRCS and start it again. Does that sound reasonable or stupid? (fine line between them, sometimes)

EDIT - just came back from lunch and noticed that it ran through :slight_smile:
Thanks a ton!

I was about to write the following:

It’s indeed possible it’s not very well optimized for this kind of volume and it would be a good candidate for a progress UI but I’m pretty sure it’s actually doing it’s job behind the scene (it’s just that it’s not sending any response to the browser until it’s done with it).

Note: not a fancy new forums expert myself but from what I understood changing the forum title when something is solved is old school and it’s better to indicate from the UI that one or several of the messages fixed the issue :slight_smile:

:smiley: Will do that. Call me old school. NNTP FTW! IRC! CompuServe!