add idxniceprio parameter to choose indexing process priority
This commit is contained in:
parent
da05b762a7
commit
aa40531bbe
@ -104,7 +104,7 @@ static void cleanup()
|
||||
// Also check for an interrupt request and return the info to caller which
|
||||
// should subsequently orderly terminate what it is doing.
|
||||
class MyUpdater : public DbIxStatusUpdater {
|
||||
public:
|
||||
public:
|
||||
MyUpdater(const RclConfig *config)
|
||||
: m_file(config->getIdxStatusFile().c_str()),
|
||||
m_stopfilename(config->getIdxStopFile()),
|
||||
@ -233,6 +233,7 @@ void rclIxIonice(const RclConfig *config)
|
||||
string clss, classdata;
|
||||
if (!config->getConfParam("monioniceclass", clss) || clss.empty())
|
||||
clss = "3";
|
||||
// Classdata may be empty (must be for idle class)
|
||||
config->getConfParam("monioniceclassdata", classdata);
|
||||
rclionice(clss, classdata);
|
||||
#endif
|
||||
@ -241,7 +242,13 @@ void rclIxIonice(const RclConfig *config)
|
||||
static void setMyPriority(const RclConfig *config)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if (setpriority(PRIO_PROCESS, 0, 20) != 0) {
|
||||
int prio{19};
|
||||
std::string sprio;
|
||||
config->getConfParam("idxniceprio", sprio);
|
||||
if (!sprio.empty()) {
|
||||
prio = atoi(sprio.c_str());
|
||||
}
|
||||
if (setpriority(PRIO_PROCESS, 0, prio) != 0) {
|
||||
LOGINFO("recollindex: can't setpriority(), errno " << errno << "\n");
|
||||
}
|
||||
// Try to ionice. This does not work on all platforms
|
||||
@ -418,54 +425,54 @@ static bool checktopdirs(RclConfig *config, vector<string>& nonexist)
|
||||
string thisprog;
|
||||
|
||||
static const char usage [] =
|
||||
"\n"
|
||||
"recollindex [-h] \n"
|
||||
" Print help\n"
|
||||
"recollindex [-z|-Z] [-k]\n"
|
||||
" Index everything according to configuration file\n"
|
||||
" -z : reset database before starting indexing\n"
|
||||
" -Z : in place reset: consider all documents as changed. Can also\n"
|
||||
" be combined with -i or -r but not -m\n"
|
||||
" -k : retry files on which we previously failed\n"
|
||||
"\n"
|
||||
"recollindex [-h] \n"
|
||||
" Print help\n"
|
||||
"recollindex [-z|-Z] [-k]\n"
|
||||
" Index everything according to configuration file\n"
|
||||
" -z : reset database before starting indexing\n"
|
||||
" -Z : in place reset: consider all documents as changed. Can also\n"
|
||||
" be combined with -i or -r but not -m\n"
|
||||
" -k : retry files on which we previously failed\n"
|
||||
#ifdef RCL_MONITOR
|
||||
"recollindex -m [-w <secs>] -x [-D] [-C]\n"
|
||||
" Perform real time indexing. Don't become a daemon if -D is set.\n"
|
||||
" -w sets number of seconds to wait before starting.\n"
|
||||
" -C disables monitoring config for changes/reexecuting.\n"
|
||||
" -n disables initial incremental indexing (!and purge!).\n"
|
||||
"recollindex -m [-w <secs>] -x [-D] [-C]\n"
|
||||
" Perform real time indexing. Don't become a daemon if -D is set.\n"
|
||||
" -w sets number of seconds to wait before starting.\n"
|
||||
" -C disables monitoring config for changes/reexecuting.\n"
|
||||
" -n disables initial incremental indexing (!and purge!).\n"
|
||||
#ifndef DISABLE_X11MON
|
||||
" -x disables exit on end of x11 session\n"
|
||||
" -x disables exit on end of x11 session\n"
|
||||
#endif /* DISABLE_X11MON */
|
||||
#endif /* RCL_MONITOR */
|
||||
"recollindex -e [<filepath [path ...]>]\n"
|
||||
" Purge data for individual files. No stem database updates.\n"
|
||||
" Reads paths on stdin if none is given as argument.\n"
|
||||
"recollindex -i [-f] [-Z] [<filepath [path ...]>]\n"
|
||||
" Index individual files. No database purge or stem database updates\n"
|
||||
" Will read paths on stdin if none is given as argument\n"
|
||||
" -f : ignore skippedPaths and skippedNames while doing this\n"
|
||||
"recollindex -r [-K] [-f] [-Z] [-p pattern] <top> \n"
|
||||
" Recursive partial reindex. \n"
|
||||
" -p : filter file names, multiple instances are allowed, e.g.: \n"
|
||||
" -p *.odt -p *.pdf\n"
|
||||
" -K : skip previously failed files (they are retried by default)\n"
|
||||
"recollindex -l\n"
|
||||
" List available stemming languages\n"
|
||||
"recollindex -s <lang>\n"
|
||||
" Build stem database for additional language <lang>\n"
|
||||
"recollindex -E\n"
|
||||
" Check configuration file for topdirs and other paths existence\n"
|
||||
"recollindex -e [<filepath [path ...]>]\n"
|
||||
" Purge data for individual files. No stem database updates.\n"
|
||||
" Reads paths on stdin if none is given as argument.\n"
|
||||
"recollindex -i [-f] [-Z] [<filepath [path ...]>]\n"
|
||||
" Index individual files. No database purge or stem database updates\n"
|
||||
" Will read paths on stdin if none is given as argument\n"
|
||||
" -f : ignore skippedPaths and skippedNames while doing this\n"
|
||||
"recollindex -r [-K] [-f] [-Z] [-p pattern] <top> \n"
|
||||
" Recursive partial reindex. \n"
|
||||
" -p : filter file names, multiple instances are allowed, e.g.: \n"
|
||||
" -p *.odt -p *.pdf\n"
|
||||
" -K : skip previously failed files (they are retried by default)\n"
|
||||
"recollindex -l\n"
|
||||
" List available stemming languages\n"
|
||||
"recollindex -s <lang>\n"
|
||||
" Build stem database for additional language <lang>\n"
|
||||
"recollindex -E\n"
|
||||
" Check configuration file for topdirs and other paths existence\n"
|
||||
#ifdef FUTURE_IMPROVEMENT
|
||||
"recollindex -W\n"
|
||||
" Process the Web queue\n"
|
||||
"recollindex -W\n"
|
||||
" Process the Web queue\n"
|
||||
#endif
|
||||
#ifdef RCL_USE_ASPELL
|
||||
"recollindex -S\n"
|
||||
" Build aspell spelling dictionary.>\n"
|
||||
"recollindex -S\n"
|
||||
" Build aspell spelling dictionary.>\n"
|
||||
#endif
|
||||
"Common options:\n"
|
||||
" -c <configdir> : specify config directory, overriding $RECOLL_CONFDIR\n"
|
||||
;
|
||||
"Common options:\n"
|
||||
" -c <configdir> : specify config directory, overriding $RECOLL_CONFDIR\n"
|
||||
;
|
||||
|
||||
static void
|
||||
Usage(FILE *where = stderr)
|
||||
|
||||
@ -817,18 +817,38 @@ checkneedretryindexscript = rclcheckneedretry.sh
|
||||
# Example: mondelaypatterns = *.log:20 "*with spaces.*:30"</descr></var>
|
||||
#mondelaypatterns = *.log:20 "*with spaces.*:30"
|
||||
|
||||
# <var name="idxniceprio" type="int">
|
||||
#
|
||||
# <brief>"nice" process priority for the indexing processes. Default: 19
|
||||
# (lowest)</brief>
|
||||
#
|
||||
# <descr>Appeared with 1.26.5. Prior versions were fixed at 19.</descr>
|
||||
#
|
||||
# </var>
|
||||
#idxniceprio = 19
|
||||
|
||||
|
||||
# <var name="monioniceclass" type="int">
|
||||
#
|
||||
# <brief>ionice class for the real time indexing process</brief>
|
||||
# <descr>On platforms where this is supported. The default value is
|
||||
# 3.</descr></var>
|
||||
# monioniceclass = 3
|
||||
# <brief>ionice class for the indexing process.</brief>
|
||||
#
|
||||
# <descr>Despite the misleading name, and on platforms where this is
|
||||
# supported, this affects all indexing processes,
|
||||
# not only the real time/monitoring ones. The default value is 3 (use
|
||||
# lowest "Idle" priority).</descr>
|
||||
#
|
||||
# </var>
|
||||
#monioniceclass = 3
|
||||
|
||||
# <var name="monioniceclassdata" type="string">
|
||||
#
|
||||
# <brief>ionice class parameter for the real time indexing process.</brief>
|
||||
# <descr>On platforms where this is supported. The default is
|
||||
# empty.</descr></var>
|
||||
# <brief>ionice class level parameter if the class supports it.</brief>
|
||||
#
|
||||
# <descr>The default is empty, as the default "Idle" class has no
|
||||
# levels.</descr>
|
||||
#
|
||||
# </var>
|
||||
#
|
||||
#monioniceclassdata =
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ bool rclionice(const string& clss, const string& cdata)
|
||||
string ionicexe;
|
||||
if (!ExecCmd::which("ionice", ionicexe)) {
|
||||
// ionice not found, bail out
|
||||
LOGDEB0("rclionice: ionice not found\n" );
|
||||
LOGDEB0("rclionice: ionice not found\n");
|
||||
return false;
|
||||
}
|
||||
vector<string> args;
|
||||
@ -51,9 +51,8 @@ bool rclionice(const string& clss, const string& cdata)
|
||||
int status = cmd.doexec(ionicexe, args);
|
||||
|
||||
if (status) {
|
||||
LOGERR("rclionice: failed, status 0x" << (status) << "\n" );
|
||||
LOGERR("rclionice: failed, status 0x" << status << "\n");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user