Hi, On Tue, 13 Nov 2012 08:23:38 -0200 Friedrich Locke <friedrich.lo...@gmail.com> wrote:
> 0) To have a single process "accepting" incoming connection on port > 80 and send the new socket fd to one of the http server in a > round-roubin manner, or if you have N cores, create N - X processes or threads for handling the requests. Leave at least one core for the OS, so, have X >= 2. I would not fork at all. Have the threads ready when the requests are coming. At least this is what I did several years ago achieving the highest performance. Make X a variable to be able to tune a bit. You also should have a memory pool available to avoid calls to malloc and free. You must have a limit for the memory pool. Free the memory in the pool time to time so others can make use of the memory too. > The first approach leads to n+1 process. The second to exactly n > process. You need at least one core for handling the tasks of the OS. If I remember right, I took 10% of the cores plus one which I did not use and I took at least one core. This is all from memory. So, please consider that I could have missed something out. > Erich _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"