1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

46 Commits

Author SHA1 Message Date
Jim Jagielski
5790ed1c71 Revert an old (~10yr) change to the fd Q; move back to
FIFO rather than LIFO, for more consistent performance
so that older requests don't suffer

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1064269 13f79535-47bb-0310-9956-ffa450edef68
2011-01-27 19:34:38 +00:00
Chris Darroch
a9365f9d5c I'm not 100% sure about this, but it seems to silence the
compiler warnings generated by r101236 (which was, in turn,
intended to do the same).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726113 13f79535-47bb-0310-9956-ffa450edef68
2008-12-12 20:31:09 +00:00
Ruediger Pluem
4f4fec46e7 * Recheck again if idle workers are still available when we are signaled that
they are. This is needed since it can happen that we are signaled by a
  worker thread that went idle but received a context switch before it could
  tell us. If it does signal us later once it is on CPU again there might be
  no idle worker left. See
  https://issues.apache.org/bugzilla/show_bug.cgi?id=45605#c4

PR: 45605
Submitted by: Denis Ustimenko <denusk gmail.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@702867 13f79535-47bb-0310-9956-ffa450edef68
2008-10-08 13:32:07 +00:00
Chris Darroch
46ccf01ae7 add comment from event MPM's fdqueue ap_pop_pool() regarding
ABA problem and avoidance because only caller is single listener thread


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@633612 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 20:03:51 +00:00
Ruediger Pluem
2735bedb6a * Add hint to PR in comment. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630350 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 23:05:37 +00:00
Ruediger Pluem
38e1b39356 * Second part of fix for PR 44402:
- Fix the same race condition in event MPM.
  - Slightly optimize code in worker MPM by removing the need for an additional
    dereference operation.
  - Do some word smithing on the CHANGES entry.

PR: 44402
Submitted by: Basant Kumar Kukreja <basant.kukreja sun.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630348 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 22:58:42 +00:00
Nick Kew
6c1e117186 Worker MPM: fix race condition
PR44402: reported and fixed by Basant Kumar Kukreja


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630335 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 22:17:42 +00:00
Nick Kew
e5061abc93 Multiple trivial fixes from Christophe JAILLET
PR 38699, 39518, 42005, 42006, 42007, 42008, 42009
The patches are all his, and are sufficiently trivial to review
at a glance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557837 13f79535-47bb-0310-9956-ffa450edef68
2007-07-20 01:26:55 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Greg Ames
1192058be2 ap_queue_push: update comment to reflect reality
pointed out by: Ron Park (ronp cnet.com)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111385 13f79535-47bb-0310-9956-ffa450edef68
2004-12-09 14:11:29 +00:00
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
b4a7810707 fix copyright dates according to the first checkin
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102587 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 13:52:12 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Brian Pane
89bb4a8784 Switch to the new 32-bit APR atomic API for better portability
(the old code assumed that apr_atomic_t and apr_uint32_t were interchangeable).
Also, add more detailed comments on how one of the synchronization
functions works.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101340 13f79535-47bb-0310-9956-ffa450edef68
2003-09-29 03:58:41 +00:00
Brian Pane
2393e19673 Add casts to apr_atomic_casptr arguments to avoid compiler warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101236 13f79535-47bb-0310-9956-ffa450edef68
2003-09-13 03:45:50 +00:00
Joe Orton
8c86fe9d94 Minor cleanups:
* fdqueue.c (ap_queue_info_term, ap_queue_interrupt_all):
Remove redundant conditionals.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100542 13f79535-47bb-0310-9956-ffa450edef68
2003-07-10 20:29:25 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Jeff Trawick
e29c32ba6f fix the type of the idlers field to match what apr_atomic_cas() expects
this fixes the compile when using the native compiler for AIX (and likely
other non-gcc compilers)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98272 13f79535-47bb-0310-9956-ffa450edef68
2003-01-15 13:43:58 +00:00
Brian Pane
f86c81e344 Replace most of the mutex locking in the worker MPM's "queue info"
object with atomic compare-and-swap loops.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98159 13f79535-47bb-0310-9956-ffa450edef68
2003-01-03 18:35:08 +00:00
Ian Holsman
fada680320 typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96294 13f79535-47bb-0310-9956-ffa450edef68
2002-08-02 17:37:52 +00:00
Brian Pane
69371c8cb3 Removed some code from the mutex-protected block in ap_queue_pop().
If the worker thread synchronization is working properly, it's not
necessary to set these fields to NULL after removing an element from
the queue, and it's IMO more important to have a shorter code path
leading up to the mutex_unlock.  I left in support for NULLing the
fields when debugging, though.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94850 13f79535-47bb-0310-9956-ffa450edef68
2002-04-29 01:57:39 +00:00
Brian Pane
d3d545e861 Removed the "not_full" condition variable and associated conditional
logic from the file descriptor queue, now that we can rely on the
idle worker reference count to keep the listener from trying to
push connections into a full queue
Reviewed by:	Aaron Bannert (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94845 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 23:12:35 +00:00
Brian Pane
6625520bac Moved the recycled pool list from the queue to the queue_info structure.
The advantage of doing this is that it enables us to guarantee that the
number of ptrans pools in existence at once is no greater than the
number of worker threads, and that we'll never have to delete ptrans
pools.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94830 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 05:28:18 +00:00
Brian Pane
91aefd5c8f Added a missing pool deletion case and simplified the conditionals
for the error-case return (thanks to Justin for suggesting the
latter)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94829 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 04:48:43 +00:00
Brian Pane
669d2ac35c Move a potentially expensive pool cleanup operation outside
the mutex-protected critical path of ap_queue_pop()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94828 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 03:32:10 +00:00
Aaron Bannert
c87eec9800 Preserve the original error, or if the unlock fails then use that
error instead.

Obtained from:  Justin Erenkrantz
Submitted by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94827 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 03:20:06 +00:00
Aaron Bannert
23fa964736 Add a "queue_info" structure to the worker MPM. This is used to prevent
the listener thread from accept()ing more connections than there are
available workers. This prevents long-running requests from starving
connections that have been accepted but not yet processed.

The queue_info is a simple counter, mutex, and condition variable. Only
the listener thread blocks on the condition, and only when there are no
idle workers. In the fast path there is a mutex lock, integer decrement,
and and unlock (among a few conditionals). The worker threads each notify
the queue_info when they are about to block on the normal worker_queue
waiting for some connection to process, which wakes up any sleeping
listener thread to go perform another accept() in parallel.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94824 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 01:45:00 +00:00
Aaron Bannert
77adcc0737 Convert the worker MPM's fdqueue from a LIFO back into a FIFO. Since
elements in the queue represent accept()ed connections, we want them
to be processed in the order that they were received.  (I erroneously
converted it to a LIFO quite awhile ago in the hopes that it would
improve cache efficiency.)

Remember to perform a make clean in the worker directory after this patch,
since this patch changes the size of the fd_queue_t object (which is
allocated in worker.c).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94813 13f79535-47bb-0310-9956-ffa450edef68
2002-04-26 17:13:51 +00:00
Jeff Trawick
4867fb1974 Don't drop connections during graceful restart. Previously, worker
threads could exit even though there were connections waiting in the
queue.

Now, for a graceful restart the worker threads won't exit until they
are told that the queue has been drained and no more connections will
ever be added.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94106 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 19:12:54 +00:00
Jeff Trawick
ca62366801 fix a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94088 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 15:27:31 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Jeff Trawick
a57a1a0c11 Convert the ap_queue_foo routines to return apr_status_t as appropriate.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93530 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 14:22:05 +00:00
Brian Pane
481bad782c Performance optimization: updated the worker MPM to recycle
per-transaction pools instead of destroying them.  Based on
Ian's benchmark testing, this reduces CPU utilization by
about 1% on Solaris.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93386 13f79535-47bb-0310-9956-ffa450edef68
2002-02-13 04:49:55 +00:00
Aaron Bannert
53e16c92fc Fully convert worker's fdqueue to the new APR lock API:
- Mutexes and Condition Variables from APR are now used instead of
  direct (non-portable) calls to pthread.

Still need to fully APRize these routines, particularly the return
values. In many cases a failed lock or cond var call will simply return
FD_QUEUE_FAILURE. This should obviously instead return the appropriate
APR error code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91531 13f79535-47bb-0310-9956-ffa450edef68
2001-10-17 16:29:37 +00:00
Ryan Bloom
973dc48adc clean up the fdqueue a bit more, by implementing Greg's
suggestions to getting rid of redundant variables, as well as
converting the simple ap_queue_full/ap_queue_empty tests into macros.
This also reinstates the "not_full" condition, which turned out to
be useful afterall in cases where we wanted to prevent the listener
thread from accepting further connections until the worker queue has
room for more.

Submitted by:	[Aaron Bannert <aaron@clove.org>]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91223 13f79535-47bb-0310-9956-ffa450edef68
2001-10-01 19:37:20 +00:00
Ryan Bloom
40dc2ab173 Turn the worker MPM's queue into a LIFO. This may
improve cache-hit performance under some conditions.

Submitted by:   Aaron Bannert <aaron@clove.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91077 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 23:09:12 +00:00
Ryan Bloom
3f8dd5a641 Cleanup the worker MPM. We no longer re-use transaction
pools.  This incurs less overhead than shuffling the pools
around so that they can be re-used.  Remove one of the
queue's condition variables.  We just redefined the API to
state that you can't try to add more stuff than you allocated
segments for.

Submitted by:	  Aaron Bannert <aaron@clove.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91075 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 21:14:18 +00:00
Ryan Bloom
0cdf95d374 Remove an obsolete function from fdqueue. The worker MPM now uses the
fdqueue functions in a different way.
Submitted by:	Aaron Bannert <aaron@clove.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90749 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 23:50:12 +00:00
Ryan Bloom
fe4fa0cd35 Make the worker MPM shutdown and restart cleanly. This also
cleans up some race conditions, and gets the worker using
pools more cleanly.

Submitted by:	[Aaron Bannert <aaron@clove.org>]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90635 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 16:49:39 +00:00
Ryan Bloom
643dfa0c94 Get the worker MPM working again. This should fix the serialization
problems, and it makes up initialize the queue only once.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89930 13f79535-47bb-0310-9956-ffa450edef68
2001-08-05 18:41:38 +00:00
Ryan Bloom
5bfcf2aa8e It helps if we broadcast to the workers that we are trying to shutdown.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89827 13f79535-47bb-0310-9956-ffa450edef68
2001-07-31 15:35:28 +00:00
Ryan Bloom
f6371b63d9 Add the worker MPM. The name is probably horrible, but I couldn't come
up with anything better.  This is a multiple-worker/single listener MPM.
This MPM is definately not complete, but it is a first step in the
right direction.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89781 13f79535-47bb-0310-9956-ffa450edef68
2001-07-30 05:02:53 +00:00