Server module
- 1.select based server
Advantage: easy to implement
disadvantage: limit to fd, max is 1024 on most linux - 2./dev/poll based server
Advantage:
disadvantage: same to select - 3.epoll based server
Advantage: fastly, not need to check each fd.
disadvantage: do more coding - 4.thread based server
Advantage: cheap to create, easy to share memory
disadvantage: instability, crash thread make entry process down because allthreads share the same addres space.
- 5.process based server
Advantage: stable, crash process do not effect others.
disadvantage: create and kill processs overhead the web server. - 6.hybrid process thread server
Advantage:
disadvantage: - 7.process-pool and thread-pool based server
process pool, reference
dynamic-pool-of-processes
Preforking: Process Pools
3
Advantage:
disadvantage: - 8.event based server
Advantage:
disadvantage:
Biggest performance-killers
- 1.Data copies
- 2.Context switches
- 3.Memory allocation
- 4.Lock contention
Reference
- The C10K problem
- Scalable Network Programming
- High performance server architecture
- Comparison of web server software
- mongoose - easy to use web server
- Architecture of a Linux based Web Server - Monkey HTTP server
- Monkey HTTP server
- A very simple HTTP server writen in c
- HTTP-server
- How do I write a web server in C on linux
- webserver search on github
- simple webserver for linux
- Web server software architectures
- chaos - c++ network event library