summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-04-05Handling error return from application 'run()' function.Max Romanov1-3/+7
Server error response generated or connection closed.
2018-04-05Stopping timed out application process.Max Romanov1-9/+88
2018-04-03HTTP: using r->mem_pool retention counter for response buffers.Igor Sysoev1-9/+8
2018-03-28Using more expressive name for field.Igor Sysoev1-18/+19
2018-03-21Added Ruby support.Alexander Borisov1-0/+88
2018-03-15Skipping idle state when port already closed.Max Romanov1-1/+1
2018-03-14Ignoring response for already terminated request.Max Romanov1-0/+3
Request can be terminated because of invalid response headers and content should be ignored in this case.
2018-03-13Releasing application on configuration failure.Max Romanov1-0/+15
2018-03-07Socket configuration should retain application.Max Romanov1-0/+8
This retains application during reconfiguration if an incoming connection was already established before the reconfiguration, but no request was yet created for the connection and thus no application was yet assigned to the request.
2018-03-05Reduced number of critical log levels.Valentin Bartenev1-15/+14
2018-02-20Removed unwanted assertions.Max Romanov1-11/+19
2018-02-09Made nxt_assert() statements to be compiled only with debug.Valentin Bartenev1-2/+12
2018-02-09Changed the default number of spare processes to 0.Valentin Bartenev1-1/+1
2018-02-08Router: fixed freed memory access race condition.Igor Sysoev1-6/+8
2018-02-07Style fixes.Andrey Zelenkov1-1/+1
2018-02-07Fixed processing of application response in router.Max Romanov1-1/+4
If the first buffer contained only header and there were other buffers in chain, those buffers were not processed. In particular, this broke Perl application responses with empty body.
2018-01-31Added Perl support.Alexander Borisov1-4/+93
2018-01-29Introducing extended app process management.Max Romanov1-85/+545
- Pre-fork 'processes.spare' application processes; - fork more processes to keep 'processes.spare' idle processes; - fork on-demand up to 'processes.max' count; - scale down idle application processes above 'processes.spare' after 'processes.idle_timeout'; - number of concurrently started application processes also limited by 'processes.spare' (or 1, if spare is 0).
2018-01-24Fixed formatting in nxt_sprintf() and logging.Sergey Kandaurov1-3/+3
2018-01-24Using size_t for the field width type of the "%*s" specifier.Sergey Kandaurov1-3/+3
2017-12-28Fixing memory leak introduced in changeset 5817734dd9b9.Igor Sysoev1-1/+4
2017-12-28HTTP keep-alive connections support.Igor Sysoev1-640/+120
2017-12-28Changed nxt_mp_retain() and nxt_mp_release() interfaces.Igor Sysoev1-4/+13
2017-12-27Implementing worker stop after limits.requests.Max Romanov1-4/+13
2017-12-27Rescheduling of pending request after configured timeout.Max Romanov1-83/+214
New optional configuration parameter introduced: limits.reschedule_timeout. Default value 1 second. In the case when request is written to the port socket 'in advance', it is called 'pending'. On every completed request, the head of pending request is checked against reschedule timeout. If this request waiting for execution longer than timeout, it is cancelled, new port selected for this request.
2017-12-27Fixing code style.Max Romanov1-16/+16
2017-12-27Fixing application timeout.Max Romanov1-89/+318
Application timeout limits maximum time of worker response in processing particular request. Not including the time required to start worker, time in request queue etc.
2017-12-27Changing worker selection precedence.Max Romanov1-22/+47
This patch increase precedence of non-started worker over busy worker. 1. idle worker; 2. start new worker; 3. busy worker, but can accept request in advance;
2017-12-27Implementing the ability to cancel request before worker starts processing it.Max Romanov1-131/+103
2017-12-25HTTP parser: reworked header fields handling.Valentin Bartenev1-8/+8
2017-12-25Restoring apps in case of reconfiguration error.Max Romanov1-0/+3
2017-11-27A number of engine connections is decreased on connection close.Igor Sysoev1-1/+1
2017-10-19Keep application worker until response for all requests received.Max Romanov1-1/+4
2017-10-19Fixed the bug introduced in the previous changeset.Igor Sysoev1-4/+9
2017-10-18Router: fixed segfault after configuration change.Igor Sysoev1-177/+241
2017-10-17Storing memory cache slot hint inside nxt_sockaddr_t.Igor Sysoev1-3/+5
2017-10-10Optimized application type handling.Valentin Bartenev1-17/+2
2017-10-04Port message fragmentation supported.Max Romanov1-15/+9
- Each sendmsg() transmits no more than port->max_size payload data. - Longer buffers are fragmented and send using multiple sendmsg() calls. - On receive side, buffers are connected in chain. - Number of handler calls is the same as number of nxt_port_socket_write() calls. - nxt_buf_make_plain() function introduced to make single plain buffer from the chain.
2017-10-04Optimized request<->app link allocation.Max Romanov1-36/+59
Only purpose of request<->app link instance is to be enqueued in application requests queue. It is possible to avoid request<->app link allocation from memory pool in case when spare application port is available. Instance from local stack can be used to prepare and send message to application.
2017-10-04Using port 'post' facility to proxy remove pid message to workers.Max Romanov1-83/+21
Remove pid proxying to worker engines implementation was originally overcomplicated. Memory pool and 2 engine posts (there and back again) are optimized out and replaced with band new nxt_port_post() call.
2017-10-04Using request mem pool for req<->app link.Max Romanov1-2/+19
Request <-> application link structure (nxt_req_app_link_t) used to register the request in application request queue (nxt_app_t.requests) and generate application-specific port message. Now it is allocated from request pool. This pool created for request parsing and used to allocate and store information specific to this request.
2017-10-04Fixed error generation during request processing.Max Romanov1-40/+94
Request can be processed in thread different from the thread where the connection originally handled. Because of possible racing conditions, using original connection structures is unsafe. To solve this, error condition is registered in 'ra' (request <-> application link) and traversed back to original connection thread where the error message can be generated and send back to client.
2017-10-04Introducing use counters for port and app. Thread safe port write.Max Romanov1-330/+432
Use counter helps to simplify logic around port and application free. Port 'post' function introduced to simplify post execution of particular function to original port engine's thread. Write message queue is protected by mutex which makes port write operation thread safe.
2017-10-04Using engine memiory pool for port write allocations.Max Romanov1-7/+1
To allow use port from different threads, the first step is to avoid using port's memory pool for temporary allocations required to send data through the port. Including but not limited by: - buffers for data; - send message structures; - new mmap fd notifications; It is still safe to use port memory pool for incoming buffers allocations because recieve operation bound to single thread.
2017-10-04Fixing memory leak when handling remove pid message.Max Romanov1-0/+2
Worker threads ports need to receive 'remove pid' message to properly handle application process exit case and finish requests processed by particular application worker. Main process send 'remove pid' notification to service thread port only and this message must be 'proxied' to other running engines. Separate memory pool created for this message. For each engine structure required to post message to engine allocate from the pool using 'retain' allocation method. After successfull post structure will be freed using 'release' method. To completely destroy poll one more 'release' should be called to release initial reference count. I'm afraid this should be simplified using good old malloc() and free() calls.
2017-09-27Event engine memory cache for nxt_sockaddr_t.Igor Sysoev1-3/+10
Introducing event engine memory cache and using the cache for nxt_sockaddr_t structures.
2017-09-22Removed fibers from compilation.Valentin Bartenev1-0/+2
It's not used anyway, but breaks building with musl. This closes issue #5 on GitHub.
2017-09-15Introducing named port message handlers to avoid misprints.Max Romanov1-16/+4
2017-09-15Fixing memory leak of request parse context.Max Romanov1-10/+11
2017-09-15Introducing application timeout.Max Romanov1-76/+334