I look after a small wiki for a vintage computer interest group. We’ve been running Tiki successfully for a few years now and we’re currently using Tiki 15.4. Our wiki has been slowly but surely growing over that time but a new problem has now started to emerge that I’m hoping this group may be able to help with.
Our problem is that images are failing to display correctly if we have more than about 20 images on a single wiki page. There are no problems if the page contains fewer images than this, but we do have a few pages with more than 20 or so images and they consistently give problems. The underlying server error for each failed image retrieval is “508 - Resource Limit Is Reached”.
Our site is hosted on a shared server running cpanel. We have a low-end plan that’s limited to 22 “entry processes” and this is the resource that’s being exhausted by visiting the problem pages. A single user visiting a single page containing more than about 20 images is enough to cause the problem – its not related to other server users or load as far as I can tell. The limit of 22 processes seems to be fairly typical for low-end hosting plans.
Our images are all stored in the File Gallery and are referenced within pages using similar syntax to this:
img type="fileId" fileId="36" thumb="box" rel="boxg" max="250" responsive="y"
Tiki then turns each of these image references into an html img statement similar to this:
img src="tiki-download_file.php?fileId=36&display&max=250" …(remainder removed)
From some research and testing, the problem seems to be that each php call within a page consumes a cpanel “entry process”. So, when we have too many images on a page we’re simply generating too many outstanding php calls and exceeding the server entry process limit. The issue may be related to the amount of time it takes to fetch and process each image, leading to an accumulation of outstanding php calls until we hit the limit but I’m really just guessing at this point.
One possible solution that does work is to split the problem pages into multiple smaller pages with less images on each. This isn’t ideal though as the information does logically fit on a single page in most cases. I have also tried resizing the gallery images to avoid having to dynamically rescale them at display time, and so hopefully improve processing time, but this didn't have any effect on the problem. Moving to a larger hosting plan with higher limits is not really an option for the group unfortunately.
Does anyone have any other thoughts on what might be causing this problem and/or how it might be fixed?