Class WEBrick::HighPerformanceServer
In: lib/webrick/highperformanceserver.rb
Parent: WEBrick::HTTPServer

A high performance WEBrick server that takes advantage of sendfile(2) and fork(2) to drastically increase the performance of serving static files.

Instead of starting a HighPerformanceServer like a regular HTTPServer, use HighPerformanceServer::create.

Methods

access_log   create   listen   new   shutdown  

Attributes

listeners  [RW]  Server sockets for my children.

Public Class methods

Creates :Processes new HighPerformanceServers all listening on the same server sockets.

config and default work the same as they do for HTTPServer.

yields each forked child’s server object. The server will not be started nor will signals be caught.

Returns the pids of the created HighPerformanceServer children.

Typical usage:

  WEBrick::HighPerformanceServer.create do |server|
    server.mount '/', WEBrick::HTTPServlet::FileHandler,
                 '/usr/local/www/data'
    trap 'INT' do server.shutdown end
    trap 'TERM' do server.shutdown end
    server.start
  end

Public Instance methods

HighPerformanceServer doesn’t log. Oh you want access logs? Well tough!

Our listeners have already been created, so suck them in from the class.

Don‘t close the listeners, just stop.

[Validate]