When ever there is a request for CGI script container creates a seperate process for it. Containers have a limitation on the number of process that it can create.
In servlets every incoming request is handled by a seperate
thread.
The most popular platform for writing CGI script is Perl. The server needs to load the CGI script and Perl interpreter for every incoming request that it receives. This brings down the efficiency of the server.
Unlike CGI script the servlet initialization code is executed only once.