My users have the requirement of the parent page being an amalgamation of all its nested pages. We approached this requirement by using the display macro multiple times in a single page.
Each parent page contains 16 nested pages. This means that the parent page will use the display macro 16 times. Upon implementation, we had no issues loading/viewing the parent pages.
Recently, our site went “live”, increasing the number of concurrent users to ~100. At the same time, we started experiencing OutOfMemoryError: Java Heap Space with a particular parent page, whose nested pages have approximately 300 images in total, whenever a user accesses the above mentioned parent page. This required a server reboot everytime to “fix” it and I have since disabled access to the offending parent page.
I also discovered that this issue is not limited to this page only. Another parent page, whose nested pages have slightly lesser media content than the offending page, causes a site wide slow down whenever accessed. This page would load its content, however, some components would not load properly; e.g. the navigation panels do not load, the “3 dot” menus become unresponsive.
This has led me to suspect that the display macro may have some performance limitations. Is this a known limitation? Are there any alternative solutions to my user requirements?
Note: This is a lot (100 TPS is a lot!). You’ll need to size your servlet container properly and possibly even use XWiki clustering. Unless you mean 100 users but not at the same time which would be a lot lower than 100 TPS.
Thanks for the response, I am definitely still a beginner at administrating XWiki, appreciate the help. I’ve set up glowroot to monitor the transactions previously and the throughput of all web transactions is 23.4 per minute, is this higher than 100 TPS?
I had allocated -Xmx2048m initially, but I still experience the OOM error. Increasing it to -Xmx3072m still does not resolve it.
Is it a possibility that the instantaneous TPS is higher than 100 at the time that the offending page was accessed? From the IP access logs, each image in a page translates to a GET request to the server. Does this mean that accessing that page would lead to at least ~300 GET requests at that moment?
That doesn’t look right. You said you’re using the display macro and this macro doesn’t do any HTTP call. Maybe you’re doing something different like wrapping the calls to display with an async macro? Maybe you could show us your content?
So indeed for each image displayed there’s a call to a HTTP GET done by the browser to download and then display the image, so that’s actually perfectly normal (I forgot about the browser in my previous reply!).