ahmedde's avatar

ahmedde wrote a reply+100 XP

1w ago

I second that! The docs are missing too much, especially if you are using Laravel as API only. You have to google lots of obvious stuff that is not in the docs.

ahmedde's avatar

ahmedde started a new conversation+100 XP

2mos ago

Hi,

We're running a production app using Octane (Swoole) on Forge.

I have been getting few Sentry reports on memory leakage exceptions once every few days on random API routes. The exceptions are neither happening on consistent times or routes, which makes this difficult for me to find the piece that break the puzzle.

Example:

Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes)

I have checked the routes at which the exception is thrown, and there is nothing on them that may produce Octane memory leak. Some of them is very primal API routes that doesn't do much work.

For context, we're using Laravel as an API, a Filament dashboard, and we cache lots of stuff, but the cache is on Redis. The overall server memory usage never exceeds 40%.

From the logs, the error is coming from these sources. I understand Redis is involved, but I don't understand why.

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 356352 bytes) in /home/forge/x/vendor/predis/predis/src/Connection/StreamConnection.php on line 346
   INFO  {"status":500,"message":"Allowed memory size of 268435456 bytes exhausted (tried to allocate 356352 bytes)","errors":[]}.  

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 16384 bytes) in /home/forge/x/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php on line 488
   INFO  {"status":500,"message":"Allowed memory size of 268435456 bytes exhausted (tried to allocate 16384 bytes)","errors":[]}.  
ahmedde's avatar

ahmedde started a new conversation+100 XP

5mos ago

Hi,

I'm a beginner at Docker, and was looking if there was a ready-made configuration for Laravel using Docker. Being paid is totally ok.

I'm looking for something resilient and tested that covers all the processes that comes with Laravel (Composer, Octane, Queues, Horizon, Cron, Reverb, Scout, etc). This configuration will be used later with Kubernetes for running horizontal stateless servers.

I have tried this before and it went ok, but I probably made few big mistake here and there and I don't want to risk it on production-especially with Octane.

I checked out the class here for Laravel with Docker, and it was a good starting-point, but I don't think it can deliver to production.

Appreciate any input.

ahmedde's avatar

ahmedde wrote a reply+100 XP

6mos ago

We're still doing "Thanks guys I solved it"? 😭 Can you post your solution? thanks