summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-08-11 19:20:15 +0300
committerMax Romanov <max.romanov@nginx.com>2020-08-11 19:20:15 +0300
commit83595606121a821f9e3cef0f0b7e7fe87eb1e50a (patch)
tree2374867dd2f69654a71e95b7abec3fdad13ffd1a /src/nxt_router.h
parent6e31d6cd39be9d3f4ee680fc13c3fe42f5cd39e7 (diff)
downloadunit-83595606121a821f9e3cef0f0b7e7fe87eb1e50a.tar.gz
unit-83595606121a821f9e3cef0f0b7e7fe87eb1e50a.tar.bz2
Introducing the shared application port.
This is the port shared between all application processes which use it to pass requests for processing. Using it significantly simplifies the request processing code in the router. The drawback is 2 more file descriptors per each configured application and more complex libunit message wait/read code.
Diffstat (limited to 'src/nxt_router.h')
-rw-r--r--src/nxt_router.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nxt_router.h b/src/nxt_router.h
index d8e93be6..7e0dc7d7 100644
--- a/src/nxt_router.h
+++ b/src/nxt_router.h
@@ -101,18 +101,20 @@ typedef struct {
struct nxt_app_s {
- nxt_thread_mutex_t mutex; /* Protects ports queue. */
- nxt_queue_t ports; /* of nxt_port_t.app_link */
+ nxt_thread_mutex_t mutex; /* Protects ports queue. */
+ nxt_queue_t ports; /* of nxt_port_t.app_link */
+ nxt_lvlhsh_t port_hash; /* of nxt_port_t */
nxt_queue_t spare_ports; /* of nxt_port_t.idle_link */
nxt_queue_t idle_ports; /* of nxt_port_t.idle_link */
nxt_work_t adjust_idle_work;
nxt_event_engine_t *engine;
- nxt_queue_t requests; /* of nxt_request_app_link_t */
- nxt_queue_t pending; /* of nxt_request_app_link_t */
nxt_str_t name;
+ uint32_t port_hash_count;
+
+ uint32_t active_requests;
uint32_t pending_processes;
uint32_t processes;
uint32_t idle_processes;
@@ -120,7 +122,6 @@ struct nxt_app_s {
uint32_t max_processes;
uint32_t spare_processes;
uint32_t max_pending_processes;
- uint32_t max_pending_responses;
uint32_t max_requests;
nxt_msec_t timeout;
@@ -139,6 +140,9 @@ struct nxt_app_s {
nxt_atomic_t use_count;
nxt_app_joint_t *joint;
+ nxt_port_t *shared_port;
+
+ nxt_port_mmaps_t outgoing;
};