N
N
nastyskafomka2019-03-25 23:32:03
linux
nastyskafomka, 2019-03-25 23:32:03

CRON task every minute is it ok?

Hello, is it ok to create a task in CRON for every minute?
For example, I need to execute a certain php script every minute that checks the database.
And is it normal to do queries to the database every minute?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2019-03-26
@OnYourLips

Not normal.
And if you need to run every half a minute, will you insert sleep?
What if the task lasts longer than a minute?
Apparently, you have chosen the wrong tool. Perhaps you need to do on some event, and not check the database. Think about queues.
We put the event in the queue - the queue handler processed it without delay.

C
CityCat4, 2019-03-26
@CityCat4

No.
Write demon.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question