starting compile server - advice needed

Per Bothner per@bothner.com
Fri Jul 11 23:29:00 GMT 2003


Mike Stump wrote:

> I'm more interested in things like,

 > Do we let multiple users use one server?

My inclination is to say no.  That would force the server to run with 
the permission of all the users who might use it, and then verify that 
the current request has the correct permissions.

Much simpler and safer to require the client and server to both run as 
the same user, I think.

 > should create the server in pwd, or /tmp?

Using /tmp makes sense if we want to use the same server in multiple 
working directories - but then the client has to tell the server what 
it's cwd is, so it can resolve relative pathnames.

A problem with using /tmp is how can the client find the server - what 
should it be called?  Assuming that the server is single user (see 
above), then it seems the server socket has to include to users name, 
number, or home directory.

An alternative is to bind the server to a socket in the user's home 
directory.

But the simplest solution appears to use cwd, but possibly provide a 
flag or environment variable to override it.

 > Should we timeout in 1 minute, or 1 hour or 1 day?

I don't know.  1 minute is too short.  If a server is bound to cwd, then 
1 hour or 1 day timeout may create too many servers.

> Should we autostart the server?

That is the question I asked.  (I mainly asked *how*, but I also asked 
"should we".)

> In the testsuite, how should we stop the server. 
>  gcc --kill-server makes sense, but should it kill all languages, or 
> just one language?  If the server is in /tmp, should we kill them?

I don't know.

> What if they are `running'?

Currently --kill-server is "soft" - it sends the server a request to 
reset the timeout to zero, so it will exit when it it gets to that 
request.  Perhaps a "hard" kill, to forcibly kill the server process,
would be more useful.  A soft kill is useful for "exit after this request".

> What about a build with -j2?  What about a 
> QMtets with -j2?  Who should load balance the CPUs?  How?

My thinking is that if a server is per-directory, then a "smart make" or 
  IDE might start multiple parallel servers, for multiple directories. 
That doesn't help if a single directory has many source files.  In that 
case it might be useful to use an option to override the default server 
name, so one might create more than one (one per cpu), or fewer servers 
than the number of directories.

> Do we let multiple projects use one server?

That doesn't seem very useful.

> These are the types of questions it would be nice to get answers for.

Yes.  But the answer to most of these will have to be come from 
practical experience.  Though have some ideas to start out with can't hurt.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/




More information about the Gcc mailing list