You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support tmpfs and a server queue for C++ compilers (#10)
This PR drops an option -working-dir, adding two new instead:
* -cpp-dir {string}, Directory for incoming C++ files and src cache
* -obj-dir {string}, Directory for resulting obj files and obj cache
The directory passed as -cpp-dir can be placed in tmpfs.
Also, nocc-server now managers C++ compiler launches with a waiting queue.
The purpose of a waiting queue is not to over-utilize server resources at peak times.
workingDir:=common.CmdEnvString("Directory for saving incoming files, default /tmp/nocc-server.", "/tmp/nocc-server",
62
-
"working-dir", "")
66
+
cppStoreDir:=common.CmdEnvString("Directory for incoming C++ files and src cache, default /tmp/nocc/cpp.\nIt can be placed in tmpfs to speed up compilation", "/tmp/nocc/cpp",
67
+
"cpp-dir", "")
68
+
objStoreDir:=common.CmdEnvString("Directory for resulting obj files and obj cache, default /tmp/nocc/obj.", "/tmp/nocc/obj",
69
+
"obj-dir", "")
63
70
logFileName:=common.CmdEnvString("A filename to log, by default use stderr.", "",
64
71
"log-filename", "")
65
72
logVerbosity:=common.CmdEnvInt("Logger verbosity level for INFO (-1 off, default 0, max 2).\nErrors are logged always.", 0,
@@ -70,6 +77,8 @@ func main() {
70
77
"obj-cache-limit", "")
71
78
statsdHostPort:=common.CmdEnvString("Statsd udp address (host:port), omitted by default.\nIf omitted, stats won't be written.", "",
72
79
"statsd", "")
80
+
maxParallelCxx:=common.CmdEnvInt("Max amount of C++ compiler processes launched in parallel, other ready sessions are waiting in a queue.\nBy default, it's a number of CPUs on the current machine.", int64(runtime.NumCPU()),
81
+
"max-parallel-cxx", "")
73
82
74
83
common.ParseCmdFlagsCombiningWithEnv()
75
84
@@ -78,10 +87,6 @@ func main() {
78
87
os.Exit(0)
79
88
}
80
89
81
-
iferr=cleanupWorkingDir(*workingDir); err!=nil {
82
-
failedStart("Can't create working directory "+*workingDir, err)
0 commit comments