Cron Tasks not running in background, causing pages to take forever to load We recently upgraded to D8 and I have been experiencing weird issues with Cron. Specifically, whenever the Cron is running, web pages are taking forever to load because cron is running some JS on the front end of any page you attempt to load. Specifically, it appears to be a timeout method that is holding up the page load.

NOTE: I will update this post and provide the exact JS file and function that is running on the front end the next time it happens to me. At the time of writing, cron wasn't running and therefore I couldn't inspect the web page to get the running method

I know it's not the CPU on the server because when cron was running it never got above 20% CPU utilization.
Isn't cron suppose to run in the background? Why would cron have a JS file being executed on every page, causing any page not to load until cron finishes?
Part of the settings on /admin/config/system/cron are for the Automated Cron module, which adds them via automated_cron_form_system_cron_settings_alter(). The form field it adds has the following description.

More information about setting up scheduled tasks can be found by reading the cron tutorial on drupal.org.

If you follow that link, you will read the following sentences. (Emphasis is mine.)

The automated cron module has the disadvantage that it is triggered by a request, and the unlucky user who sends the request may experience a fairly long delay. For this reason, the automated cron is typically used by smaller sites that are unable to create a cron job manually, e.g. using the Linux crontab. If crontab is desired, Drupal console command may be used to simplify the configuration (rather than curling the long URL show in /admin/config/system/cron. Here is an example crontab entry:
30 * * * * web_user /var/www/html/vendor/bin/drupal --root=/var/www/html/docroot cron:execute &gt; /dev/null 2&gt;&amp;1


Essentially, what you are experiencing is how the Automated Cron module work, but that isn't the only way to run cron tasks for Drupal.
You could also pass the URL shown on on /admin/config/system/cron after To run cron from outside the site, go to to wget or curl. This requires that you have access to, for example, cPanel for the site, which allows to set cron tasks.