Skip to content

App frequently returns 500 error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (cloudron)ย #2130

Open
@SansGuidon

Description

@SansGuidon

Hi,

I'm using Shaarli 0.14.0 in a Cloudron (Docker-based web apps manager) setup and I frequently face errors for the past months and it seems to not improve with the growth of the Shaarli Database.
My Shaarli DB is not extremely big (around 9K links)

I did investigate a bit and tuned the app resources with more memory via Cloudron and via the Shaarli dedicated php.ini, yet I see no improvement.

php.ini

max_execution_time = 300
memory_limit = 512M
post_max_size = 64M

I started to observe that months ago with web crawlers increasing the traffic on my Shaarli instance, so I had to perform IP-blocking. But now even when I use Shaarli, like loading the home page or some search permalinks, I almost get a 500 every 1 out of 10 requests, sometimes more frequently.

Everytime this 500 occurs, this is logged:

Mar 04 13:46:20 [Tue Mar 04 12:46:20.147669 2025] [php:error] [pid 103] [client 172.18.0.1:46866] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 9235624 bytes) in /app/code/application/bookmark/BookmarkIO.php on line 93

In the last 20 minutes, this fatal error occured 20+ times.

Any idea how I could troubleshoot/mitigate this? I suspect that reading the shaarli data is a sensitive I/O operation which is the only thing I observe through the resources utilization graph -> the memory utilization is stable

Image

however the disk utilization is high and correlated with Shaarli usage/Shaarli reading the DB.

Image

Help / ideas are welcome ๐Ÿ™๐Ÿป

PS: I observe that the init.php file of Shaarli fixes the max memory to 128M.
https://github.com/shaarli/Shaarli/blob/master/init.php#L18

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions