spatie / laravel-short-schedule

Schedule artisan commands to run at a sub-minute frequency
https://freek.dev/1683-a-package-to-schedule-artisan-commands-at-sub-minute-frequencies
MIT License
611 stars 52 forks source link

CPU usage showing 100% memory usage #60

Closed salmanAhmad143 closed 2 years ago

salmanAhmad143 commented 2 years ago

Hi,

Thanks for creating this awesome library. I just starting to use this. My requirement was to run the command every 20 seconds. Everything was working fine but as soon as I moved it to the production server. Suddenly my CPU usage has been showing 100% memory usage. I don't know what's going on and how to handle this problem.

` protected function shortSchedule(\Spatie\ShortSchedule\ShortSchedule $shortSchedule) { // this artisan command will run every 20 second $shortSchedule->command('check:connectionExpire')->everySeconds(20);
}

` Below is the command that I had set up on my server crontab-

php /var/www/mySite/artisan short-schedule:run 1>> /dev/null 2>&1

Could you please suggest to me what I can do to overcome this problem?

Awaiting your reply.

Regards, Salman Ahmad