Skip to content

Commit

Permalink
nghttpx: Split monolithic one process into control and worker processes
Browse files Browse the repository at this point in the history
The control process handles signals, reads configuration, reads
private keys, and bind port (which may be privileged one).  It never
drop privileges, so that it can execute new binary with the same
privilege.  It forks worker process.  The worker process handles all
incoming connections.  It drops privilege.
  • Loading branch information
tatsuhiro-t committed Sep 18, 2015
1 parent b57b0db commit ce1b11e
Show file tree
Hide file tree
Showing 8 changed files with 881 additions and 539 deletions.
8 changes: 8 additions & 0 deletions doc/nghttpx.h2r
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ SIGUSR2
After new process comes up, sending SIGQUIT to the original process
to perform hot swapping.

.. note::

nghttpx consists of 2 processes: one process for processing these
signals, and another one for processing requests. The former spawns
the latter. The former is called master process, and the latter is
called worker process. The above signal must be sent to the master
process. If the worker process receives one of them, it is ignored.

SERVER PUSH
-----------

Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ NGHTTPX_SRCS = \
shrpx_memcached_connection.cc shrpx_memcached_connection.h \
shrpx_memcached_request.h \
shrpx_memcached_result.h \
shrpx_worker_process.cc shrpx_worker_process.h \
shrpx_process.h \
buffer.h memchunk.h template.h

if HAVE_SPDYLAY
Expand Down
Loading

0 comments on commit ce1b11e

Please sign in to comment.