From: Mike N. <ta...@al...> - 2002-03-18 09:57:20
|
Chris Knight wrote: > Sorry for the off-topic post Not off-topic. > but I'm wondering how to do the following under > Windows: > > Under FreeBSD, I'm able to run several hundred instances of Firebird CS, > each listening on a separate IP [...] > I'd like to be able to do the same thing under Windows. I assume you are aware that the Microsoft licensing costs to be able to do this, and the machine needed for several hundred of quite heavy processes, would probably sum up to some pretty large number. But, are you asking about running several hundred CS processes on Win32? SS processes would probably be quite easy to fix, but CS is AFAIK not something to use on Win32, especially since it's (again AFAIK) not supported and Win32 doesn't come with an inetd. > Is it possible to > have multiple Firebird installs, each listening to their own IP and > authenticating against their own isc4.gdb? Currently, and in order, no, no and yes. > If not, which bits of code do I need to modify to make it do so? It depends on how you want to be able to start the processes. If you want to start them as services I think you are in for a bumpy ride. If you however accept to start them as console processes it's doable. A non-complete list would be something like: The registry-handling (you can not use the ini-file-from-hell). The easiest way to do this is by starting the processes as console processes, setting the environment variable(s) needed to point to different DB locations for each process. Search for ISC_ENV inside jrd/gds.c(pp). Maybe this means you really don't need to change that part of the code. You need some kind of major-multi-IP-address-able-per-NIC TCP stack. I don't know if the MS stack handles hundreds of virtual/additional IP's, and even if it does I wouldn't have too high hopes about its performance. Anyway, you would need to make the engine bind() to specified interfaces, changing sin_addr.s_addr from INADDR_ANY to a specific IP to be gotten from ini-file, command line, environment variable or some other means you can give different processes different input. You therefore need to add parsing for this and change the code inside (at least) inet.c(pp) to bind() to the right IP. Another way of doing it could be to put another machine (with a _real_ OS :-) ) in front of the window box, and then forward its incoming connections on different IPs to the same IP but different ports on the Win32 box, since the port Firebird listens to can be configured. You would then probably need to remove the check for already started server from remote/window.c(pp), and most definitely you'd need to create differently named file-mapping objects (ipserver/ipserver.c(pp) - probably just by appending the process ID to the name). Then you probably need to rename the window (possibly even the window-class) to different names for each instance. Note that if you require the Guardian to start the processes, this should probably be a command-line parameter to the server so that the guardian process(es) knows what server to check for. Also note that this doubles the amount of processes that have to run on the machine, and you would still need to start the different guardian processes from consoles and make it set/forward environment variables and command-line parameters to the server process. You'd also manually have to do the "load balancing" of setting CPU_AFFINITY for the different processes. There are probably also a bunch of other places to change, but this should give you a start. > I'm not interested in replies containing the word VMware either. How about Bochs? ;-) /Mike |