fitim's avatar

fitim wrote a reply+100 XP

4mos ago

The telescope is from my development server. I tried to remove telescope completely at some point since i suspected it may cause the issue. Even without telescope the problem persists.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

There are ~1000 request per minute. Usually the load is during the working hours. Outside of working hours we have not many requests. The most load would be like 1000 per minute

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

The production system gets ~1000 requests per minute for a small operation. For example: get user from DB who is making the request compare the DB data with input and perform an api request in another service is data does not match and store the update in database.

All production commands are performing well nothing out of ordinary.

But i have removed everything from dev server so there is nothing happening really. I just call the schedule:run and there is no commands to execute. It still spikes. Im thinking to remove the schedule:run from cron and do it as endpoint for runing my command. But this will be overkill and i still need to understand why these spikes ocur when there is nothing there.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

@snapey i have a chart of the issue in production. The app is running on a 6 code machine. so 30/6 is 5 threads waiting. Which makes the impact pretty severe in production. Increasing the lottery chances brought the values slightly lower but nothing of great improvement.

One question to you. There cleanup functions run only when schedule:run is configured? Because when i remove the schedule:run from cron the issue disappears.

fitim's avatar

fitim liked a comment+100 XP

4mos ago

I just upped the ratio to 20, 100. Lets see how this impacts.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

This is a chart from production. https://postimg.cc/ZWyhym6n i have a 6 core machine which is 30/6 which leaves 5 processes competing a the same time.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

I have a question if you don't mind. These Laravel cleanup functions are working only when schedule:run is setup in cron. Because when i remove the schedule:run from the cron the problem goes away for me.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

Thank you for your suggestion. I increased the chances of the lottery and now i have more frequent spikes (smaller spikes).

Is there any way how i can solve this issue long term? My production server is heavily impacted from this action. All monitoring tools raise alarms on heavy load.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

This values are from my dev server. In the actual production one the impact is way worse.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

I just upped the ratio to 20, 100. Lets see how this impacts.

fitim's avatar

fitim wrote a reply+100 XP

4mos ago

It is not exact time. There is some randomness there. The pattern is not always the same. I can not upload a direct link since this is my first day at the forum. But i will try to upload this: postimg.cc slash ZBVxPndK. If you can recreate the link you will see the chart of the CPU.

fitim's avatar

fitim started a new conversation+100 XP

4mos ago

I’m running into a strange performance issue with the Laravel scheduler and I’m trying to understand what’s going on.

Framework: Laravel 12 PHP: 8.2 Web server: Apache on Linux

"require": { "php": "^8.2", "ext-curl": "", "ext-openssl": "", "firebase/php-jwt": "^6.11", "laravel/framework": "^12", "laravel/telescope": "^5.5", "laravel/tinker": "^2.10", "stancl/tenancy": "^3.9.1" }, There is a fresh laravel install: The scheduler is triggered in the system’s cron like this:

          • php /path/to/artisan schedule:run >> /dev/null 2>&1

There are no scheduled tasks When I check the scheduler, I get this: $ php artisan schedule:list INFO No scheduled tasks have been defined.

What I actually see: CPU is mostly fine. About once per hour, CPU usage goes high for a short period (a few minutes). This pattern only exists while schedule:run is enabled.

I also can provide more data by request. I have CPU chart and more details about the instalation