meter icon indicating copy to clipboard operation
meter copied to clipboard

Error 500 by Memory Limit (many rows on DB)

Open jonaswebdev opened this issue 5 years ago • 2 comments

Firstly, I loved this Meter app to monitoring my apps on simple way, congrats by the project :)

Back to focus, I installed today about 6 hours ago, but now I have issues.

When I enter on /meter, I got Error 500, checking Laravel logs I saw a problem related with memory limit, my previous limit was 128M and I updated to 256M but keeps the same problem:

[2020-05-29 03:08:06] production.ERROR: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes) {"userId":1,"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes) at /var/vhosts/mydomain.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:127)

I checked the Meter DB table I saw something like more than 500Mb with almost 140k rows.

I ran the command to prune but didn't solve: php artisan meter:prune 0 entries pruned.

So, I checked the prune command and it only deletes more than 1 day ago.

Finally, I truncate the meter DB table and Meter App back to works.

My question: do you have an idea what could I do to avoid this?

maybe I could prune with on less interval but I will lose analysis data, right?

Thanks in advance

jonaswebdev avatar May 29 '20 03:05 jonaswebdev

Same here, any solutions?

Taoshan98 avatar Dec 06 '22 16:12 Taoshan98

setup a daily backup to s3 or something else and clean table.

Suggested tool: https://github.com/4nkitd/backup

4nkitd avatar Dec 17 '22 03:12 4nkitd