Web Technology Basics

With CGI, the web server starts the program as a new process every time it receives a request, and the process ends when processing is finished. Which of the following is the main reason that FastCGI and application-server approaches can handle many requests more efficiently than CGI?

  1. ABecause the program's processes stay resident and are reused, the work of starting a process and initializing for each request is saved
  2. BBecause they communicate with users over UDP instead of HTTP, the work of establishing a TCP connection for every request is eliminated
  3. CBecause they send the program to the browser and have it run inside the browser, the server does not need to process requests
Show answer and explanation

Answer: A. Because the program's processes stay resident and are reused, the work of starting a process and initializing for each request is saved

CGI is a simple mechanism in which the web server passes request information to the program through environment variables and standard input, and returns what the program writes to standard output as the response. However, it starts a process for every request and redoes loading of the language runtime and connecting to the database each time, so the load becomes heavy when there are many requests. FastCGI and application servers for each language keep the program resident, connect it to the web server through sockets or similar means, and process many requests repeatedly.

  • A. Correct. Keeping processes resident avoids repeating startup and initialization for every request.
  • B. FastCGI and application-server approaches also communicate with users over HTTP. The difference is how the program is run inside the server.
  • C. The program runs on the server. What runs in the browser is the JavaScript included in the page.
Practice this topic Back to topic

Books on Web Technology Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Web Technology Basics questions

  1. Among the ways of producing the pages of a website, which of the following generates the HTML files of all pages in advance at the build stage and returns those files as they are in response to requests?
  2. Which of the following correctly lists the elements in the first line (the request line) of an HTTP/1.1 request?
  3. Among HTTP methods, which of the following is not "safe" (not intended to change the state of resources on the server) but is "idempotent" (sending the same request any number of times leaves the same state as sending it once)?
  4. Which of the following correctly pairs an HTTP status code with its meaning?
  5. On a members-only website, an ordinary member who is logged in requests a page that only administrators may access. The server knows who the user is but does not allow access to this page. Which of the following status codes is most appropriate to return?