diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-10-10 23:24:15 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-10-10 23:24:15 -0700 |
commit | b46bcdc5ab62756dc71c48871c03eb312282dcac (patch) | |
tree | 7d19e029b221c4350ee7e0ee58bfa5b882065f27 /src/common | |
parent | 3d86f968326b46d1f78ac208f383232d1bdb8408 (diff) | |
download | vyatta-cfg-b46bcdc5ab62756dc71c48871c03eb312282dcac.tar.gz vyatta-cfg-b46bcdc5ab62756dc71c48871c03eb312282dcac.zip |
performance optimization on commit. On successful commits (i.e. no failures) will improve performance by avoiding the piecewise priority based copy and just
copy the complete configuration once. On specific test configuration performance improvement brought commit boot time down from >15 minutes to less than 10
minutes.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/common.h | 2 | ||||
-rw-r--r-- | src/common/unionfs.c | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/common/common.h b/src/common/common.h index 06e3a9e..8b46498 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -42,7 +42,7 @@ common_set_parent_context(char *cpath, char *dpath); * **/ void -common_commit_copy_to_live_config(GNode *root_node, boolean test_mode); +common_commit_copy_to_live_config(GNode *root_node, boolean suppress_piecewise_copy, boolean test_mode); /** * diff --git a/src/common/unionfs.c b/src/common/unionfs.c index b053d80..c428dfa 100644 --- a/src/common/unionfs.c +++ b/src/common/unionfs.c @@ -605,7 +605,7 @@ set_path(char *path, boolean config) * **/ void -common_commit_copy_to_live_config(GNode *node, boolean test_mode) +common_commit_copy_to_live_config(GNode *node, boolean suppress_piecewise_copy, boolean test_mode) { //first check for existence of path before committing char *path = ((struct VyattaNode*)(node->data))->_data._path; @@ -689,7 +689,20 @@ common_commit_copy_to_live_config(GNode *node, boolean test_mode) system(command); } - piecewise_copy(node, test_mode); + if (suppress_piecewise_copy) { + sprintf(command, format1, tbuf_root, abuf_root); + if (g_debug) { + printf("%s\n",command); + syslog(LOG_DEBUG,"%s\n",command); + fflush(NULL); + } + if (test_mode == FALSE) { + system(command); + } + } + else { + piecewise_copy(node, test_mode); + } sprintf(command, format8, cbuf_root,abuf_root,mbuf_root); if (g_debug) { |