From: Luca Toscano
-To begin with, we only want to create a simple handler, that replies to the
+To begin with, we only want to create a simple handler that replies to the
client browser when a specific URL is requested, so we won't bother setting
up configuration handlers and directives just yet. Our initial module
definition will look like this:Hooking into httpd
Release Notes
AsyncRequestWorkerFactor.
The status page of mod_status shows new columns under the Async connections section:
AsyncRequestWorkerFactor.
Graceful process termination and Scoreboard usage-This mpm showed some scalability bottlenecks in the past leading to the following + This mpm showed some scalability bottlenecks in the past, leading to the following
error: "scoreboard is full, not at MaxRequestWorkers".
AsyncRequestWorkerFactor.
data, and the amount of data produced by the filter is too big to be
buffered in memory, the thread used for the request is not freed while
httpd waits until the pending data is sent to the client.- To illustrate this point we can think about the following two situations: + To illustrate this point, we can think about the following two situations: serving a static asset (like a CSS file) versus serving content retrieved from FCGI/CGI or a proxied server. The former is predictable, namely the event MPM has full visibility on the end of the content and it can use events: the worker thread serving the response content can flush the first bytes until EWOULDBLOCK
or EAGAIN is returned, delegating the rest to the listener. This one in turn
- waits for an event on the socket, and delegates the work to flush the rest of the content
- to the first idle worker thread. Meanwhile in the latter example (FCGI/CGI/proxied content)
+ waits for an event on the socket and delegates the work to flush the rest of the content
+ to the first idle worker thread. Meanwhile in the latter example (FCGI/CGI/proxied content),
the MPM can't predict the end of the response and a worker thread has to finish its work
before returning the control to the listener. The only alternative is to buffer the
response in memory, but it wouldn't be the safest option for the sake of the
@@ -249,7 +254,7 @@ of the AsyncRequestWorkerFactor.
Before these new APIs where made available, the traditional The MPM assumes that the underlying
AsyncRequestWorkerFactor.
To mitigate this problem, the event MPM does two things:
table |
no |
MIME header environment for the response, printed even on errors and
- persist across internal redirects |
+ persist across internal redirects. A read-only lua table suitable for iteration is available as r:err_headers_out_table(). |
||
filename |
@@ -493,13 +493,13 @@ end
table | yes | MIME header environment from the request. This contains headers such as Host,
- User-Agent, Referer and so on. |
+ User-Agent, Referer and so on. A read-only lua table suitable for iteration is available as r:headers_in_table().
||
headers_out |
table | yes | -MIME header environment for the response. | +MIME header environment for the response. A read-only lua table suitable for iteration is available as r:headers_out_table(). | |
hostname |
@@ -541,7 +541,7 @@ end
notes |
table | yes | -A list of notes that can be passed on from one module to another. | +A list of notes that can be passed on from one module to another. A read-only lua table suitable for iteration is available as r:notes_table(). |
options |
@@ -608,7 +608,7 @@ end
subprocess_env |
table | yes | -The environment variables set for this request. | +The environment variables set for this request. A read-only lua table suitable for iteration is available as r:subprocess_env_table(). |
started |
diff --git a/docs/manual/mod/mod_status.html.en b/docs/manual/mod/mod_status.html.en
index 77570a7c5a0..537536e611d 100644
--- a/docs/manual/mod/mod_status.html.en
+++ b/docs/manual/mod/mod_status.html.en
@@ -49,9 +49,9 @@ performance
| Description: | Provides better support for systemd integration |
|---|---|
| Status: | Extension |
| Module Identifier: | systemd_module |
| Source File: | mod_systemd.c |
| Compatibility: | Available in Apache 2.4.42 and later |
This module provides support for systemd integration. It allows
+ httpd to be used in a service with the systemd
+ Type=notify (see systemd.service(5)
+ for more information). The module is activated if loaded.
ExtendedStatus is
+ enabled by default if the module is loaded. If ExtendedStatus is not disabled in
+ the configuration, run-time load and request statistics are made
+ available in the systemctl status output.
event, worker, prefork, mpm_winnt, mpm_netware, mpmt_os2The maximum length of the queue of pending connections.
- Generally no tuning is needed or desired, however on some
- systems it is desirable to increase this when under a TCP SYN
+ Generally no tuning is needed or desired; however on some
+ systems, it is desirable to increase this when under a TCP SYN
flood attack. See the backlog parameter to the
listen(2) system call.
0, then the process will never expire.
Setting MaxConnectionsPerChild to a
- non-zero value limits the amount of memory that process can consume
+ non-zero value limits the amount of memory that a process can consume
by (accidental) memory leakage.
ServerLimit.
For threaded and hybrid servers (e.g. event
- or worker) MaxRequestWorkers restricts
+ or worker), MaxRequestWorkers restricts
the total number of threads that will be available to serve clients.
- For hybrid MPMs the default value is 16 (ServerLimit) multiplied by the value of
+ For hybrid MPMs, the default value is 16 (ServerLimit) multiplied by the value of
25 (ThreadsPerChild). Therefore, to increase MaxRequestWorkers to a value that requires more than 16 processes,
you must also raise ServerLimit.
For worker and event, the default is
MaxSpareThreads 250. These MPMs deal with idle threads
on a server-wide basis. If there are too many idle threads in the
- server then child processes are killed until the number of idle
+ server, then child processes are killed until the number of idle
threads is less than this number. Additional processes/threads
might be created if ListenCoresBucketsRatio
is enabled.
worker and event use a default of
MinSpareThreads 75 and deal with idle threads on a server-wide
- basis. If there aren't enough idle threads in the server then child
+ basis. If there aren't enough idle threads in the server, then child
processes are created until the number of idle threads is greater
than number. Additional processes/threads
might be created if ListenCoresBucketsRatio
@@ -494,7 +494,7 @@ spikes
mpm_netware uses a default of
MinSpareThreads 10 and, since it is a single-process
- MPM, tracks this on a server-wide bases.
mpmt_os2 works
similar to mpm_netware. For
@@ -520,7 +520,7 @@ of the daemon
The PidFile directive sets the file to
which the server records the process id of the daemon. If the
- filename is not absolute then it is assumed to be relative to the
+ filename is not absolute, then it is assumed to be relative to the
ServerRoot.
PidFile /var/run/apache.pid@@ -583,7 +583,7 @@ the child processes
File-based shared memory is useful for third-party applications that require direct access to the scoreboard.
-If you use a ScoreBoardFile then
+
If you use a ScoreBoardFile, then
you may see improved speed by placing it on a RAM disk. But be
careful that you heed the same warnings about log file placement
and security.
ThreadStackSize is
set to a value lower than the operating system default. This type
of adjustment should only be made in a test environment which allows
- the full set of web server processing can be exercised, as there
+ the full set of web server processing to be exercised, as there
may be infrequent requests which require more stack to process.
The minimum required stack size strongly depends on the modules
used, but any change in the web server configuration can invalidate
diff --git a/docs/manual/new_features_2_4.html.en b/docs/manual/new_features_2_4.html.en
index 6bf3c0afa1d..2ae7c7d7ff2 100644
--- a/docs/manual/new_features_2_4.html.en
+++ b/docs/manual/new_features_2_4.html.en
@@ -208,6 +208,10 @@
mod_socache_redis (available since 2.4.39)mod_systemd (available since 2.4.42)Type=notify.