Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run expirationd periodically? #38

Open
santhoshTpixler opened this issue Jul 30, 2019 · 3 comments · Fixed by #19
Open

How to run expirationd periodically? #38

santhoshTpixler opened this issue Jul 30, 2019 · 3 comments · Fixed by #19
Labels
documentation Improvements or additions to documentation

Comments

@santhoshTpixler
Copy link

I want to run the expirationd periodically without manually triggering it. For example, I want to run it once every hour. Is it possible?

@Totktonada Totktonada added the question Further information is requested label Aug 18, 2020
@Totktonada
Copy link
Member

It seems, it worth to clarify how expirationd works. The schema is the following:

  1. Process min(space_length, tuples_per_iteration) tuples.
  2. Sleep tuples_per_iteration × full_scan_time / space_length (but not beyond 1 second).
  3. Repeat 1-2 until the whole space will be traversed.
  4. Sleep 1 second.
  5. Repeat 1-4.

Example 1:

For given values:

 | space_length = 10^6
 | tuples_per_iteration = 1024 (default)
 | full_scan_time = 3600 (default, 1 hour)

We can calculate delay = min(1024 * 3600 / 10^6, 1) = 1.

The processing will look so:

+-> process 1024 tuples
|   sleep 1 second
|   <..975 more such steps..>
|   process 576 remaining tuples
|   sleep 1
|   sleep 1
|   (978 seconds of delays in sum, ~16 minutes)
+-- start again

Example 2:

For given values:

 | space_length = 10^6
 | tuples_per_iteration = 1
 | full_scan_time = 3600 (default, 1 hour)

We can calculate delay = min(3600 / 10^6, 1) = 0.0036.

The processing will look so:

+-> process 1 tuple
|   sleep 0.0036 seconds
|   <..10^6-1 more such steps..>
|   sleep 1
|   (3601 seconds of delays in sum, ~1 hour)
+-- start again

I think everything will be less obscure if we'll add ability to control maximum sleep time after processing of tuple_per_iteration tuples (now the maximum is 1 second) and to control a sleep time after traversing the whole space (it is hardcoded to 1 second). I hope we'll do it in PR #19. When it will be done, I'll return here with some recipes.

LeonidVas pushed a commit that referenced this issue Nov 20, 2020
Added the ability to set iteration and full scan delays for a task.

iteration delay - max sleep time between iterations (in seconds).
full scan delay - sleep time between full scans (in seconds).

Related to #38
@LeonidVas LeonidVas linked a pull request Nov 20, 2020 that will close this issue
LeonidVas pushed a commit that referenced this issue Dec 4, 2020
Added the ability to set iteration and full scan delays for a task.

iteration delay - max sleep time between iterations (in seconds).
full scan delay - sleep time between full scans (in seconds).

Related to #38
@akudiyar akudiyar added documentation Improvements or additions to documentation and removed question Further information is requested labels Apr 23, 2021
@akudiyar
Copy link

Need to add the comment #38 (comment) into README

@Totktonada
Copy link
Member

NB: Don't forget to add full_scan_delay into the processing schema and the examples above, when we'll adopt them for README.

@ArtDu ArtDu mentioned this issue Sep 14, 2021
ligurio pushed a commit that referenced this issue Sep 22, 2021
Added the ability to set iteration and full scan delays for a task.

iteration delay - max sleep time between iterations (in seconds).
full scan delay - sleep time between full scans (in seconds).

Related to #38
ArtDu pushed a commit to ArtDu/expirationd that referenced this issue May 10, 2022
Added the ability to set iteration and full scan delays for a task.

iteration delay - max sleep time between iterations (in seconds).
full scan delay - sleep time between full scans (in seconds).

Related to tarantool#38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants