skip to main |
skip to sidebar
CGI vs Servlet
- CGI: Common Gateway Interface, creates a heavy weight process to handle each http request. N number of copies of the same traditional CGI programs is copied into memory to serve N number of requests.
- Servlet: Spawns a lightweight Java thread to handle each http request. Single copy of a type of servlet but N number of threads (thread sizes can be configured in an application server). In MVC, servlets process requests and select JSP views. So servlets act as controller.