Running HFCD on a multi-CPU server
I’ve been asked several times about this: Suppose I have a quad-core or 8-core server with lots of RAM. Can this machine run multiple instances of HFCD, each of which serves an instance of Flex Builder running on a ‘slow’ laptop on the same LAN?
I think the answer is yes… though someone has to do a field test for me. One little-known (or I should say undocumented) feature is that you can specify the admin and compiler port numbers on the command line when you start hfcd.
By default, it uses port 50207 and 50208. You can specify two different numbers like this:
> ./hfcd 50210 50211
Now, say if you want to start 4 instances of HFCD on your multi-CPU server, you can do:
> ./hfcd 50201 50202 & > ./hfcd 50203 50204 & > ./hfcd 50205 50206 & > ./hfcd 50207 50208 &
Of course, you want to make sure that the combined value of the -Xmx setting of all instances is less than the amount of physical memory on that machine.
The next step is to adjust the IP address and port numbers in Flex Builder. In Flex Builder, simply click Preferences –> HellFire Compiler; change the address and port numbers and restart FB.
Now you may be wondering why several developers want to share one fast machine to compile Flex apps. Well, the key question is: how much time each developer would take from the machine to compile during a say, 8-hour work day and how frequent these developers send the compile requests to the machine? Do they all do it at or about the same time throughout the day? If the ‘collision’ rate is low on any given work day, the effect would be like each developer having exclusive access to the CPU resources. That’s obviously a lot better than the ‘local-HFCD’ scenario.