Should cron work? Or do they mostly visit?

I have been looking for the answer to this question for some time, and I find mixed answers. Does cron work with heavy and expensive processes that consume a lot of resources? Or they mostly get to this page (regardless of the script that runs when cron launches it)

I intend to use multiple cron jobs for multiple sites. Let's say I have 3 different cron jobs that will click on specific pages on 10 sites every minute. Does anyone have 10 or 100 cron jobs like this in a trigger manner, like deleting a browser (-wget ...> / dev / null 2> & 1)? If you do, are you experiencing additional stress?

Further explanation; as you may know, WP-cron events are not executed if no one visits the WordPress site during a scheduled event, until someone appears and fires it. I have some not-so-active WordPress sites that I plan on implementing planned events, and I'm trying to figure it out.

What do you think of cron online services? Do they exist only because most users are not allowed to create cron jobs? Or is it because cron jobs slow down the server and so you can take the load off your server?

+6
source share
2 answers

Are cron jobs hard and expensive processes that consume a lot of resources?

Not unless you make them like that. The cron process itself is very easy. All you have to do is call your script. If your script is a heavy and expensive process, this has nothing to do with cron .

they mostly go to this page

Kind of an odd metaphor, but I suppose so. The cron executes a script. If this script is also used as a web page in a way, then yes, the two scripts are comparable. (Actually, a cron script call is probably less resource intensive than the web server calling the script.) Although I recommend decoupling your web page code from the command line code. (If your cron task calls an HTTP request to a page, for example, using wget or something like that. In this case, it has nothing to do with the "page" and just calls the command line utility.)

What do you think of cron online services? Do they exist only because most users are not allowed to create cron jobs? Or is it because cron jobs slow down the server and so you can take the load off your server?

Being sounds more believable. cron not resource intensive. But this requires access that some hosting providers do not provide.

+8
source

Using a cron job to access a web page to run application processes is not difficult.

This is a slightly long approach, but the page retrieval action ( wget , etc.) is not heavy.

The severity of your application process is another matter entirely.

0
source

All Articles