diff options
author | erdgeist <> | 2008-11-03 01:52:23 +0000 |
---|---|---|
committer | erdgeist <> | 2008-11-03 01:52:23 +0000 |
commit | 18b6e9b212364b4ce5f00c126327cfde74b6c9bd (patch) | |
tree | d5c8c4de154d30280c5e6b9966d174296a230c33 | |
parent | 9c0b23e28dd2b1719cf969dfc37827c0c41d236d (diff) |
Spread the amount of time spent in cleanup about 2 minutes
-rw-r--r-- | ot_clean.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -8,6 +8,7 @@ | |||
8 | #include <string.h> | 8 | #include <string.h> |
9 | #include <pthread.h> | 9 | #include <pthread.h> |
10 | #include <sys/uio.h> | 10 | #include <sys/uio.h> |
11 | #include <unistd.h> | ||
11 | 12 | ||
12 | /* Libowfat */ | 13 | /* Libowfat */ |
13 | #include "byte.h" | 14 | #include "byte.h" |
@@ -103,6 +104,11 @@ static void clean_make() { | |||
103 | } | 104 | } |
104 | } | 105 | } |
105 | mutex_bucket_unlock( bucket ); | 106 | mutex_bucket_unlock( bucket ); |
107 | |||
108 | /* We want the cleanup to be spread about 2 Minutes to reduce load spikes | ||
109 | during cleanup. Sleeping around two minutes was chosen to allow enough | ||
110 | time for the actual work and fluctuations in timer. */ | ||
111 | usleep( ( 2 * 60 * 1000000 ) / OT_BUCKET_COUNT ); | ||
106 | } | 112 | } |
107 | } | 113 | } |
108 | 114 | ||