-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-31511 Avoid keeping the workunit graphs in memory #18519
HPCC-31511 Avoid keeping the workunit graphs in memory #18519
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-31511 Jirabot Action Result: |
@@ -42,6 +42,7 @@ include_directories ( | |||
./../../system/jlib | |||
./../bindings/http/platform | |||
./../../common/environment | |||
./../../common/workunit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected a need to add workunit to the link libraries as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why it builds without - probably because one of the libraries included already links to it. But I will add.
@@ -1788,5 +1788,6 @@ extern WORKUNIT_API void executeThorGraph(const char * graphName, IConstWorkUnit | |||
extern WORKUNIT_API TraceFlags loadTraceFlags(IConstWorkUnit * wu, const std::initializer_list<TraceOption> & y, TraceFlags dft); | |||
|
|||
extern WORKUNIT_API bool executeGraphOnLingeringThor(IConstWorkUnit &workunit, unsigned wfid, const char *graphName); | |||
extern WORKUNIT_API bool workunitGraphCacheEnabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of exported variables. We tend to provide get()/set() functions everywhere else except for roxie. I may not care enough to avoid merging though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can come up with a good reason, I don't mind changing. But there are plenty of other exported variables around...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are very few, except for roxie. (E.g. I don't think there are any in this file.)
It generates slightly worse code (an extra indirect) - not significant in this case, but in general worth avoiding. (Thread local access code is much worse...)
thorlcr/slave/thslavemain.cpp
Outdated
@@ -393,6 +393,7 @@ int main( int argc, const char *argv[] ) | |||
#else | |||
globals.setown(loadConfiguration(globals, argv, "thor", "THOR", nullptr, nullptr, nullptr, false)); | |||
#endif | |||
workunitGraphCacheEnabled = globals->getPropBool("expert/@workunitGraphCacheEnabled", workunitGraphCacheEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too early. (See the comment in the code below....)
I would expect a similar call in the thor master.
@jakesmith Does the slave load the graph from the workunit? Does it reload it for each subgraph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not per subgraph, but per Thor 'job' (i.e. each workflow graph)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too early. (See the comment in the code below....)
yes, would be good to move within RegisterSelf next to similar expert tests,
and so that's bare-metal compatible, should use getExpertOptBool, i.e.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect a similar call in the thor master.
in master, a getExpertOptBool call should go in CJobManager::execute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardkchapman - please see additional comments re. Thor.
thorlcr/slave/thslavemain.cpp
Outdated
@@ -393,6 +393,7 @@ int main( int argc, const char *argv[] ) | |||
#else | |||
globals.setown(loadConfiguration(globals, argv, "thor", "THOR", nullptr, nullptr, nullptr, false)); | |||
#endif | |||
workunitGraphCacheEnabled = globals->getPropBool("expert/@workunitGraphCacheEnabled", workunitGraphCacheEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too early. (See the comment in the code below....)
yes, would be good to move within RegisterSelf next to similar expert tests,
and so that's bare-metal compatible, should use getExpertOptBool, i.e.:
thorlcr/slave/thslavemain.cpp
Outdated
@@ -393,6 +393,7 @@ int main( int argc, const char *argv[] ) | |||
#else | |||
globals.setown(loadConfiguration(globals, argv, "thor", "THOR", nullptr, nullptr, nullptr, false)); | |||
#endif | |||
workunitGraphCacheEnabled = globals->getPropBool("expert/@workunitGraphCacheEnabled", workunitGraphCacheEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect a similar call in the thor master.
in master, a getExpertOptBool call should go in CJobManager::execute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardkchapman - looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ok to merge. remaining question is about the default. I would opt for default the same in 9.4 and on in 9.6 via a separate PR.
Please squash. Thanks.
@@ -1788,5 +1788,6 @@ extern WORKUNIT_API void executeThorGraph(const char * graphName, IConstWorkUnit | |||
extern WORKUNIT_API TraceFlags loadTraceFlags(IConstWorkUnit * wu, const std::initializer_list<TraceOption> & y, TraceFlags dft); | |||
|
|||
extern WORKUNIT_API bool executeGraphOnLingeringThor(IConstWorkUnit &workunit, unsigned wfid, const char *graphName); | |||
extern WORKUNIT_API bool workunitGraphCacheEnabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are very few, except for roxie. (E.g. I don't think there are any in this file.)
It generates slightly worse code (an extra indirect) - not significant in this case, but in general worth avoiding. (Thread local access code is much worse...)
common/workunit/workunit.cpp
Outdated
@@ -10411,8 +10411,11 @@ IPropertyTree * CLocalWUGraph::getXGMMLTreeRaw() const | |||
return p->getPropTree("xgmml"); | |||
} | |||
|
|||
bool workunitGraphCacheEnabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this default on in 8.4 and then off in 9.6 to help reduce the potential for unexpected regressions. Then it could be tested on development system to verify the impact.
Signed-off-by: Richard Chapman <[email protected]>
a19aeae
to
16bc421
Compare
I have changed the default to be true in this PR that targets 9.4, and squashed. Once merged and upmerged I can do a new PR to change the default in 9.6 |
bbd581d
into
hpcc-systems:candidate-9.4.x
@mckellyln this option will be available in 9.4.x. It would be worth testing it on the development systems once this build is deployed to see what effect it has on memory usage and performance. |
Type of change:
Checklist:
Smoketest:
Testing:
Compiled