facil.io: use the `FIO_DEDICATED_SYSTEM` implementation (from master) (#3392)
* Update facil.io version + add common setup script
The main relevant difference in the updated facil.io version is the
memory allocator (I wrote a custom memory allocator that should
minimize lock contention).
It's possible to test the new version without the multi-threaded memory
allocator by using:
```sh
export CFLAGS="${CFLAGS} -DFIO_FORCE_MALLOC"
```
I tried testing the dockerfile locally, but couldn’t make it work.
For some reason the vagrant machine refuses to find the tfb command
(`vagrant up` complains with a number of errors as well, this being one
of them).
I might open a separate issue for that, but I’m not sure if it isn’t
something I’m doing wrong.
* Copy app only once
* Test the facil.io `FIO_DEDICATED_SYSTEM` flag (in master)
I hope this isn’t rude of me, but instead of releasing a facil.io
version, I am updating this app to test the effects of the
`FIO_DEDICATED_SYSTEM` flag introduced in [the facil.io master
branch](https://github.com/boazsegev/facil.io/blob/2fb10a91248eb359f1aae
c3f46ecc0c63b043afc/lib/facil/core/facil.c#L192-L204).
facil.io assumes processes are for concurrency and threads are for
parallelism (protection against slow/blocking user code).
However, when deploying facil.io on dedicated systems, this isn’t
always the best design choice. Hence, the `FIO_DEDICATED_SYSTEM` adds
concurrent thread execution into the mix.
I’m not sure if this flag should be enabled on Citrin, but this should
demonstrate this flag’s effects.
* Set workers and threads to utilize threads
* Use numeral settings instead of variable settings
This change is probably temporary, the idea was to divide the cores
between 4 processes (each using threads to utilize the remaining
cores).
* Calculate threads by CPU count
* Make sure we have at least 1 thread...