Hi we have a site on magento 2.2 version , the site usually goes down for about 3 to 4 minutes after within every 4 or 5 hours , than goes up when cron scheduler finishes it job . when we dig in matter in database
select count(status) from cron_schedule where status='pending'
, there are almost more than thousands of pending requests in status fields , the requests we are getting from our store server for pricing updates of products.
Following is the error comes on screen when site is down during execution of cron_scheduler .
Reason: Connection Timeout Reason: HTTP 503 - Service Unavailable
Can anyone please assist us why it's happening and what will be best permanent solution of it , because right now we are using temporary solution by doing so :
delete from cron_schedule where scheduled_at < date_sub(now(), interval 1 hour);