- There are different architectures for web servers that result in variations in performance and resource usage, including:
- Single-process, single-threaded architecture that can only handle one request at a time. Not used in production.
- Multiple process, one thread per process architecture where each process handles one request. Uses more RAM than multi-threaded.
- Multiple threaded architecture where a process distributes requests to a thread pool, allowing for more concurrency limited only by thread pool size.
- Event-based architectures provide an alternative to threads by manually handling context switches in an event queue, allowing for more parallelism than threads. Technologies like Nginx and Node.js use this model.