I have a server with say, 16 cores and 32G memory. For a process like apache
, which spawns a new thread for every new connection which of the following alternatives is better, and why?
Also what will happen in the case of an application like cassandra
. In case of cassandra where there are a lot of writes to the memory, this will mean having two 'nodes' on the same machine will be beneficial in any way?
Multiple (say, two) instances of the same application running on the same machine and serving on two different ports. (May be an LB on a different machine in front of this machine).
I'm confused how will the OS handle two instances of a multithreading application. Will both the processes will have threads running on all cores? In what cases will the context switching occur (between processes and threads) and how will it effect the performance?
A single instance of a multithreading application serving on one port.
In case of an application like cassandra where the threads are going to have shared memory to which they'll write, when will the context switch occur between threads?