]> err.no Git - varnish/log
varnish
16 years agoAdd an optional shortcut:
phk [Wed, 11 Jun 2008 21:12:26 +0000 (21:12 +0000)]
Add an optional shortcut:

The parameter session_linger determines how many milliseconds the
workerthread waits to see if another request has arrived, before
handing the session over to the session herder.

If we manage to catch the next request this way, we save a number
of semi-expensive steps, if we hang around too long, the worker-thread
gets to goof off.

A relatively small sample of data from a live server, indicates
that 20% of all requests arrive within 50 msec of the previous
request and 50% within 100msec.

It is not clear at present how these timeintervals relate to client
RTT, or if they are systematically too high, due to the duration
of the detour over the herder.

There is a new line in varnishstat keeping track of how many times
this gamble succeeds.

Experimentation is encouraged.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2663 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoBe a little less hysteric with charging session statistics to
phk [Wed, 11 Jun 2008 20:50:55 +0000 (20:50 +0000)]
Be a little less hysteric with charging session statistics to
srcaddr and global counters.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2662 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRefactor the fields of struct acct so we don't have to remember them three
phk [Tue, 10 Jun 2008 14:37:14 +0000 (14:37 +0000)]
Refactor the fields of struct acct so we don't have to remember them three
different places in the code.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2661 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoMake this compile under OS/X 10.5 Leopard
phk [Tue, 10 Jun 2008 13:29:08 +0000 (13:29 +0000)]
Make this compile under OS/X 10.5 Leopard

Submitted by: peter
Closes: 245
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2660 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoSlight backtracking: Store the specified socket name in the listen socket
phk [Mon, 9 Jun 2008 13:35:35 +0000 (13:35 +0000)]
Slight backtracking:  Store the specified socket name in the listen socket
structure, instead of whatever we actually bound to.  It is more informative
and intuitive.

Report the listen socket spec in the SessionOpen shm record.

Close listen sockets as soon as we have forked the child, this eliminated
a fd-leak when a socket was eliminated from listen_address while the child
ran.

Fix various potential problems related to not being able to bind to one
or more listen addresses.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2659 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDon't leak listen address structures if we fail to bind to them.
phk [Mon, 9 Jun 2008 13:11:45 +0000 (13:11 +0000)]
Don't leak listen address structures if we fail to bind to them.

Associate ascii representation addr/port strings with each listen
socket, already in the manager process.

Postpone listen(2) call until client is ready, to limit initial
connection spike.

XXX: I still miss an unlisten(2).

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2658 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a VSS_bind() function, using the meat of VSS_listen()
phk [Mon, 9 Jun 2008 13:01:27 +0000 (13:01 +0000)]
Add a VSS_bind() function, using the meat of VSS_listen()

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2657 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoStyle & Polish.
phk [Mon, 9 Jun 2008 08:35:38 +0000 (08:35 +0000)]
Style & Polish.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2656 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoProperly lock n_wrk* statics variables without using more lock operations.
phk [Mon, 9 Jun 2008 08:12:31 +0000 (08:12 +0000)]
Properly lock n_wrk* statics variables without using more lock operations.

Have the worker threads add themselves to the pool, while the hold the pool
lock anyway.

Collect stats per pool, and have the decimator aggregate over all pools
and into the shared memory counters.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2655 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoIf we decide not to eliminate the worker thread, properly do so.
phk [Sun, 8 Jun 2008 20:42:28 +0000 (20:42 +0000)]
If we decide not to eliminate the worker thread, properly do so.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2654 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRedo the way we manage the thread pool(s).
phk [Sat, 7 Jun 2008 21:19:58 +0000 (21:19 +0000)]
Redo the way we manage the thread pool(s).

This is necessary to generalize the thread pools to do other tasks
for us in the future.

Please read the descriptions of the new and changed thread_pool*
parameters carefully before you tweak them, some of them have
slightly different meanings now.

The high-level view of this is that we now have dedicated a thread to
adding threads to the pools, in addition to the thread we already
had that killed idle threads from the pools.

The difference is that this new thread is quite a bit more reluctant
to add threads than the previous code, which would add a thread any
time it could get away with it.

Hopefully that reduces the tendency for thread-pile-ups.

This commit also reduces the cross-pool locking contention by making
the overflow queue a per pool item.

The down side of that is that more of the stats counters have become
unlocked and thus can get out of sync if two threads race when updating
them.  This is an XXX item.

Thanks to Anders Nordby for testing this patch.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2653 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoSpell "X-Forwarded-for" as "X-Forwarded-For", this seems to match the
phk [Fri, 6 Jun 2008 21:50:17 +0000 (21:50 +0000)]
Spell "X-Forwarded-for" as "X-Forwarded-For", this seems to match the
unwritten lore better.

Closes 203

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2652 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDuh!
phk [Fri, 6 Jun 2008 10:42:55 +0000 (10:42 +0000)]
Duh!

I had the sense of FIONBIO args right in the first place.

Revert 2647 and promise not to commit when sleepy.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2651 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd an XXX comment.
phk [Thu, 5 Jun 2008 09:19:27 +0000 (09:19 +0000)]
Add an XXX comment.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2650 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoWe don't need srandomdev.h here anymore.
phk [Thu, 5 Jun 2008 09:18:09 +0000 (09:18 +0000)]
We don't need srandomdev.h here anymore.

Don't hand-roll an assert.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2649 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a new-line before, and reword some of the default cautions a little
phk [Thu, 5 Jun 2008 09:16:29 +0000 (09:16 +0000)]
Add a new-line before, and reword some of the default cautions a little
bit.

Automatically calculate the margin, based on the width of the parameter
names we have.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2648 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoGet the sign right on FIONBIO ioctl.
phk [Thu, 5 Jun 2008 09:12:51 +0000 (09:12 +0000)]
Get the sign right on FIONBIO ioctl.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2647 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a "timeout counter" and cleans the timeout sockets every 60
phk [Mon, 2 Jun 2008 19:45:05 +0000 (19:45 +0000)]
Add a "timeout counter" and cleans the timeout sockets every 60
seconds instead of cleaning it in every new connection received.
We are using it here, and the performance is much better now.

Submmitted by: Rafael Umann <rafael.umann@terra.com.br>

Closes ticket #235

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2646 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoOverhaul the regexp purge/ban code, with a detour around the CLI code.
phk [Sat, 31 May 2008 21:26:20 +0000 (21:26 +0000)]
Overhaul the regexp purge/ban code, with a detour around the CLI code.

CLI code:

In CLI help, don't list commands with no syntax description.

Add a CLI_HIDDEN macro to construct such entries.  They are
useful as backwards compatibility entries which we do not want
to show in the help.

CLI interface to BAN (purge) code:

Get the CLI names right for purging so they are purge.FOO instead
of FOO.purge.

This means that you should use "purge.url" and "purge.hash"
instead of "url.purge" and "hash.purge".

Add compat entries for the old, and keep them through the 2.x
release series.

Add purge.list command to list purges currently in effect.
NB: This is not 100% locking safe, so don't abuse it.

BAN (purge) code:

Add reference counting and GC to bans.

Since we now have full reference counting, drop the sequence
number based soft references and go to "hard" pointer
references from the object to the purges.

Give the "ban" structure the miniobj treatment while we are
at it.

The cost of this is a lock operation to update refcounts
once all applicable bans have been checked on an object.

There is no locking cost if there is no bans to check.

Add explicit call to new BAN_DestroyObj() when objects are
destroyed to release the refcount.

When we release an object refcount in BAN_DestroyObj(),
check if we can destroy the last purge in the list also.

We only destroy one ban per BAN_DestroyObj() call, to avoid
getting stuck too long time, (tacitly assuming that we will
destroy more objects than bans.)

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2645 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoGo over the Telnet/CLI code in the manager process.
phk [Sat, 31 May 2008 09:34:28 +0000 (09:34 +0000)]
Go over the Telnet/CLI code in the manager process.

Implement "quit" (ticket 125) and drop the planned aliases.

Add CLIS_CLOSE return status, to communicate that close is happening.

Fix logical bug in fd-table allocation bug in event-engine.

Plug memory leak in CLI session destruction.

Increase listen depth of telnet socket to 10.

Ignore trailing whitespace and empty CLI input lines.

Log CLI sessions and commands into syslog.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2644 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoI belive this fixes the ESI issue that JT Justman has reported.
phk [Fri, 30 May 2008 22:25:58 +0000 (22:25 +0000)]
I belive this fixes the ESI issue that JT Justman has reported.

(no ticket)

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2643 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a new backend attribute in VCL: "connect_timeout".
phk [Fri, 30 May 2008 22:18:26 +0000 (22:18 +0000)]
Add a new backend attribute in VCL: "connect_timeout".

This is how long time we wait for a TCP connection to the backend to
become established.

Typical usage:

backend b1 {
.host = "hex";
.port = "80";
.connect_timeout = 500 ms;
}

It can also be used in backends in director declarations.

Also add a parameter called "connect_timeout" which sets the default
to 400 msec (a number pulled out of my old black magicians hat).

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2642 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoBack in the mists of time, the SocketWizards were so happy to get
phk [Fri, 30 May 2008 21:39:56 +0000 (21:39 +0000)]
Back in the mists of time, the SocketWizards were so happy to get
any connections at all, that they didn't even consider that maybe
connect(2) should have a timeout argument.

Add TCP_connect() which addresses this shortcoming, using what I
belive is a widely supported workaround.

Not to POSIX: please fix.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2641 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a new vcl function regsuball()
phk [Tue, 27 May 2008 07:10:22 +0000 (07:10 +0000)]
Add a new vcl function regsuball()

It works just like regsub(), but replaces all occurrences of the regexp.

regsub("1foofoofoo2", "foo", "bar") -> "1barfoofoo2"

regsuball("1foofoofoo2", "foo", "bar") -> "1barbarbar2"

Fixes ticket 238

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2640 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoBe more consistent about sockets and blocking/non-blocking mode:
phk [Mon, 26 May 2008 10:13:52 +0000 (10:13 +0000)]
Be more consistent about sockets and blocking/non-blocking mode:

Accept sockets are non-blocking, to avoid races where the client closes
before we get to accept it.  (Spotted by: "chen xiaoyong")

Unfortunately, that means that session sockets inherit non-blocking mode,
which is the opposite of what we want in the worker thread but correct
for the acceptor thread.

We prefer to have the extra syscalls in the worker thread, that complicates
things a little bit.

Use ioctl(FIONBIO) instead of fcntl(2) which is surprisingly expensive.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2639 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoBackend sockets are always in blocking mode.
phk [Mon, 26 May 2008 09:14:23 +0000 (09:14 +0000)]
Backend sockets are always in blocking mode.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2638 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd TCP_blocking() and TCP_nonblocking() and use them instead of
phk [Mon, 26 May 2008 08:38:00 +0000 (08:38 +0000)]
Add TCP_blocking() and TCP_nonblocking() and use them instead of
fondling fcntl(2) directly.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2637 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd compiler command for Solaris.
phk [Mon, 26 May 2008 08:36:18 +0000 (08:36 +0000)]
Add compiler command for Solaris.

Closes ticket #239

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2636 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoExample VCL: Cleanup and update for varnish version >= 1.2
ssm [Thu, 24 Apr 2008 06:37:01 +0000 (06:37 +0000)]
Example VCL: Cleanup and update for varnish version >= 1.2

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2634 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRemove an assert which is no longer true in the case of a non-headered
phk [Mon, 21 Apr 2008 07:01:20 +0000 (07:01 +0000)]
Remove an assert which is no longer true in the case of a non-headered
(not-RFC2616 compliant) request.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2633 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoMake it possible for the acceptor to provide a method by which sessions
phk [Mon, 21 Apr 2008 06:33:37 +0000 (06:33 +0000)]
Make it possible for the acceptor to provide a method by which sessions
are passed to it.

If no method is provided, we fall back to vca_pipes.

closes #227

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2632 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoMissing handling of sp->restarts and sp->director.
phk [Thu, 17 Apr 2008 20:08:49 +0000 (20:08 +0000)]
Missing handling of sp->restarts and sp->director.

Spotted by: "postwait"

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2631 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoSIZE_MAX is not spelled SIZE_T_MAX in polite company.
phk [Wed, 16 Apr 2008 07:58:43 +0000 (07:58 +0000)]
SIZE_MAX is not spelled SIZE_T_MAX in polite company.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2630 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoPolish up the malloc allocator to make it more useful for test and
phk [Tue, 8 Apr 2008 15:34:57 +0000 (15:34 +0000)]
Polish up the malloc allocator to make it more useful for test and
debugging:

Implement an upper limit for allocated memory, specify as:
-smalloc,40M

Give the malloc allocator its own stats counters so we can see deeply
into what it does.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2629 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRemove trailing blank from error message
phk [Tue, 8 Apr 2008 15:33:30 +0000 (15:33 +0000)]
Remove trailing blank from error message

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2628 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoWrap long line
phk [Tue, 8 Apr 2008 15:33:08 +0000 (15:33 +0000)]
Wrap long line

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2627 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agosvn-externals debian svn://svn.debian.org:/svn/pkg-varnish/packages/varnish/trunk...
bahner [Thu, 3 Apr 2008 17:15:58 +0000 (17:15 +0000)]
svn-externals debian svn://svn.debian.org:/svn/pkg-varnish/packages/varnish/trunk/debian

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2626 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDebian pakking er flyttet til svn://svn.debian.org/svn/pkg-varnish/packages/varnish...
bahner [Wed, 2 Apr 2008 09:42:16 +0000 (09:42 +0000)]
Debian pakking er flyttet til svn://svn.debian.org/svn/pkg-varnish/packages/varnish/debian

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2618 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoEmit an extra CR+NL after the end of chunked encoding.
phk [Mon, 31 Mar 2008 22:07:15 +0000 (22:07 +0000)]
Emit an extra CR+NL after the end of chunked encoding.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2617 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoFix ESI documents with multiple includes.
phk [Mon, 31 Mar 2008 21:48:33 +0000 (21:48 +0000)]
Fix ESI documents with multiple includes.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2616 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agospelling fixes
phk [Mon, 31 Mar 2008 21:48:16 +0000 (21:48 +0000)]
spelling fixes

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2615 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoFix a memoryleak relating to hash strings, found by: Arjan (noosius).
phk [Mon, 31 Mar 2008 11:49:20 +0000 (11:49 +0000)]
Fix a memoryleak relating to hash strings, found by: Arjan (noosius).

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2614 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoFix three memory leaks related to vsb's not being vsb_deleted:
phk [Mon, 31 Mar 2008 11:47:15 +0000 (11:47 +0000)]
Fix three memory leaks related to vsb's not being vsb_deleted:

Two really bad ones in Vary processing, found by Arjan (noosius).

One isignificant one related to -b arguments being wrong,
found by FlexeLint after I taught it how to spot this kind of issue.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2613 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoExplain to FlexeLint that vsb_new()/vsb_delete() are alloc/free functions.
phk [Mon, 31 Mar 2008 11:43:48 +0000 (11:43 +0000)]
Explain to FlexeLint that vsb_new()/vsb_delete() are alloc/free functions.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2612 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoI'm amazed that we have been able to spell "Authorization" as
phk [Mon, 31 Mar 2008 07:03:02 +0000 (07:03 +0000)]
I'm amazed that we have been able to spell "Authorization" as
"Authentication" for this long without anybody noticing until now.

Mea Culpa.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2611 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoIf the backend does not transmit a respose string, use the default
phk [Mon, 24 Mar 2008 08:45:54 +0000 (08:45 +0000)]
If the backend does not transmit a respose string, use the default
string for the status code as found in RFC2616.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2609 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agosmall fixes to the debian packaging: removed a lintian warning, merged two
kobold [Mon, 24 Mar 2008 07:32:12 +0000 (07:32 +0000)]
small fixes to the debian packaging: removed a lintian warning, merged two
changelog entries, cleaned debian/rules.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2608 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agos/remove/unset/, but keep remove as an alias for backward compat.
des [Wed, 19 Mar 2008 12:27:43 +0000 (12:27 +0000)]
s/remove/unset/, but keep remove as an alias for backward compat.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2607 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoThe value of HTTP_HDR_MAX is not visible to the preprocessor, so
des [Sun, 16 Mar 2008 14:11:26 +0000 (14:11 +0000)]
The value of HTTP_HDR_MAX is not visible to the preprocessor, so
(IOV_MAX < (HTTP_HDR_MAX * 2)) is equivalent to (IOV_MAX < (0 * 2)),
which obviously is never true.  Fixes #222.

Submitted by: Jyri J. Virkki <jyri@virkki.com>

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2606 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoUse a private cond-var for each worker thread, instead of pipe(2)-pair, it is cheaper.
phk [Thu, 13 Mar 2008 12:49:36 +0000 (12:49 +0000)]
Use a private cond-var for each worker thread, instead of pipe(2)-pair, it is cheaper.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2605 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoMake VSLR() static, it's unused outside shmlog.c
phk [Thu, 13 Mar 2008 10:34:30 +0000 (10:34 +0000)]
Make VSLR() static, it's unused outside shmlog.c

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2604 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a DSL() macro for diagnostic shmlogging and use it.
phk [Thu, 13 Mar 2008 10:29:14 +0000 (10:29 +0000)]
Add a DSL() macro for diagnostic shmlogging and use it.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2603 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDon't shmlog ECONNABORTED
phk [Thu, 13 Mar 2008 10:14:10 +0000 (10:14 +0000)]
Don't shmlog ECONNABORTED

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2602 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDebian packaging: Do not include the upstream INSTALL file
ssm [Thu, 13 Mar 2008 05:59:19 +0000 (05:59 +0000)]
Debian packaging: Do not include the upstream INSTALL file

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2600 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRefactor, implement random mode.
des [Wed, 12 Mar 2008 15:11:00 +0000 (15:11 +0000)]
Refactor, implement random mode.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2599 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoFurther revamp the CLI handling in the cacher process, making it
phk [Wed, 12 Mar 2008 14:07:08 +0000 (14:07 +0000)]
Further revamp the CLI handling in the cacher process, making it
possible for various modules to add cli functions so they can
be manipulated on the fly.

CLI_AddFuncs() registers a set of CLI functions.  We operate
with three lists: the ones not shown in "help" because the
manager already showed them, the normal ones and the debug
commands which are also not shown in a plain "help".

Move the registration of cli functions out to the code they
belong in: VCL, BAN and VCA.

Give VCA a real Init function, and have the cli function ("start")
initiate the acceptor thread which listens for incoming connections.

Split CLI_Init() into CLI_Init() and CLI_Run()

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2598 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a CLI support function for concatenating two cli_proto tables
phk [Wed, 12 Mar 2008 13:46:34 +0000 (13:46 +0000)]
Add a CLI support function for concatenating two cli_proto tables
in malloc'ed memory.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2597 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoGive cacher private cli functions a private prefix of "ccf" instead
phk [Wed, 12 Mar 2008 10:29:43 +0000 (10:29 +0000)]
Give cacher private cli functions a private prefix of "ccf" instead
of overloading common cli function namespace "cli_func".

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2596 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRework the manager/cacher cli relationship, so that the manager does
phk [Wed, 12 Mar 2008 10:25:51 +0000 (10:25 +0000)]
Rework the manager/cacher cli relationship, so that the manager does
not have to grope around in the cacher's data structures.

Whenever the manager gets a CLI command it does not understand, it
will pass it to the cacher process, if it is running.

This complicated "help" a little bit, because we want to show the
combined commands of the manager and cacher.

Since we're dealing with help anyway, hide undocumented debug
commands from it.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2595 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoChange the default cli help function to ignore options starting
phk [Wed, 12 Mar 2008 10:21:49 +0000 (10:21 +0000)]
Change the default cli help function to ignore options starting
with '-'.

Remove header line.

If argument is not found, return CLIS_UNKNOWN.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2594 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoSlightly more elegant version of the previous commit, which also fixed a
des [Tue, 11 Mar 2008 11:25:28 +0000 (11:25 +0000)]
Slightly more elegant version of the previous commit, which also fixed a
tiny braino.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2593 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoFix a couple of glaring errors in vca_pollspace().
des [Tue, 11 Mar 2008 11:10:19 +0000 (11:10 +0000)]
Fix a couple of glaring errors in vca_pollspace().

Noticed by: Jyri J. Virkki <jyri@virkki.com>

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2592 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoVSL_H_Print() prints a 'b' in the third column for backend-related log
des [Tue, 11 Mar 2008 09:48:27 +0000 (09:48 +0000)]
VSL_H_Print() prints a 'b' in the third column for backend-related log
entries, a 'c' for client-related log entries, and a ' ' for everything
else (CLI Ping for instance).  This makes it hard to process logs with
awk or similar tools, since the number of columns varies.  Therefore,
change the character used for non-backend-or-client log entries to '-'.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2591 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoThis is slightly experimental:
phk [Mon, 10 Mar 2008 21:21:15 +0000 (21:21 +0000)]
This is slightly experimental:

Reduce SHM mutex contention further, by only holding lock over
reservation of space, and do the copying from workthread buffer
to shm buffer efter we let go of the mutex.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2590 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDebian packaging: Move control file "docs" to "varnish.docs" for consistency, add...
ssm [Mon, 10 Mar 2008 08:17:23 +0000 (08:17 +0000)]
Debian packaging: Move control file "docs" to "varnish.docs" for consistency, add HTML changelogs from the doc/ directory to the packaging

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2588 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDebian packaging: Fix syntax error in varnishlog init script, and set correct variabl...
ssm [Mon, 10 Mar 2008 07:46:37 +0000 (07:46 +0000)]
Debian packaging: Fix syntax error in varnishlog init script, and set correct variable in defaults file. Add clarifying comment for variable

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2586 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDebian packaging: Add changelog entry for 1.2-0
ssm [Mon, 10 Mar 2008 07:15:56 +0000 (07:15 +0000)]
Debian packaging: Add changelog entry for 1.2-0

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2583 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDebian packaging: removing obsolete TODO file
ssm [Mon, 10 Mar 2008 07:13:36 +0000 (07:13 +0000)]
Debian packaging: removing obsolete TODO file

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2582 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDebian packaging: Allow adjustment of maximum locked memory size
ssm [Mon, 10 Mar 2008 06:02:00 +0000 (06:02 +0000)]
Debian packaging: Allow adjustment of maximum locked memory size

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2580 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoBraino in previous commit.
des [Sun, 9 Mar 2008 15:24:37 +0000 (15:24 +0000)]
Braino in previous commit.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2577 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoInclude complete headers with each replayed request.
des [Sun, 9 Mar 2008 15:17:49 +0000 (15:17 +0000)]
Include complete headers with each replayed request.
Ignore SIGPIPE, otherwise varnishreplay will stop as soon as varnishd starts
overflowing.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2576 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd -k option which specifies the number of log entries to keep. Along with
des [Sun, 9 Mar 2008 15:14:04 +0000 (15:14 +0000)]
Add -k option which specifies the number of log entries to keep.  Along with
-s, this allows varnishlog to be used to extract part of a log file, or
partition a log file into smaller sections.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2575 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd a -s option which specifies a number of entries to skip.
des [Sat, 8 Mar 2008 16:55:22 +0000 (16:55 +0000)]
Add a -s option which specifies a number of entries to skip.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2572 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoIf it looks like a new request starts before a previous request on the same
des [Sat, 8 Mar 2008 15:42:23 +0000 (15:42 +0000)]
If it looks like a new request starts before a previous request on the same
fd has finished, flush the previous request with an additional line to note
that the request was interrupted.

This is usually a symptom of the child dying midway through the first
request.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2569 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agodump.pool was removed a while ago.
des [Sat, 8 Mar 2008 13:47:56 +0000 (13:47 +0000)]
dump.pool was removed a while ago.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2565 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoThis is more pre-2.0 than 1.1.2+
ingvar [Fri, 7 Mar 2008 15:07:31 +0000 (15:07 +0000)]
This is more pre-2.0 than 1.1.2+

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2562 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoLog free object workspace instead of used to get the size of the object
phk [Fri, 7 Mar 2008 11:43:38 +0000 (11:43 +0000)]
Log free object workspace instead of used to get the size of the object
structure into the picture.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2561 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAdd diagnostic features to keep track of object workspace usage.
phk [Fri, 7 Mar 2008 11:36:52 +0000 (11:36 +0000)]
Add diagnostic features to keep track of object workspace usage.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2560 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoSplit the http_workspace into sess_workspace and obj_workspace, so they
phk [Fri, 7 Mar 2008 11:13:11 +0000 (11:13 +0000)]
Split the http_workspace into sess_workspace and obj_workspace, so they
can be tuned separately.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2559 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAttempt to mlock(2) SHMFILE in core.
phk [Fri, 7 Mar 2008 11:04:51 +0000 (11:04 +0000)]
Attempt to mlock(2) SHMFILE in core.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2558 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoKeep track of how often we flush the private shm buffer due to overflows.
phk [Fri, 7 Mar 2008 10:58:12 +0000 (10:58 +0000)]
Keep track of how often we flush the private shm buffer due to overflows.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2557 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoPut waiting list shmlogs under diag_bitmap
phk [Fri, 7 Mar 2008 10:36:40 +0000 (10:36 +0000)]
Put waiting list shmlogs under diag_bitmap

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2556 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoCheck EOF as bitflag in kqueue return flags
phk [Wed, 5 Mar 2008 13:18:39 +0000 (13:18 +0000)]
Check EOF as bitflag in kqueue return flags

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2555 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRelax assertions, and fix the build.
des [Tue, 4 Mar 2008 11:42:00 +0000 (11:42 +0000)]
Relax assertions, and fix the build.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2554 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRegen
des [Tue, 4 Mar 2008 11:03:03 +0000 (11:03 +0000)]
Regen

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2553 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoDefine obj.hash in the correct place, and regen.
des [Tue, 4 Mar 2008 11:02:25 +0000 (11:02 +0000)]
Define obj.hash in the correct place, and regen.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2552 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoImplement obj.hash.
des [Tue, 4 Mar 2008 10:59:32 +0000 (10:59 +0000)]
Implement obj.hash.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2551 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRemove duplicate allocation.
des [Tue, 4 Mar 2008 10:58:02 +0000 (10:58 +0000)]
Remove duplicate allocation.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2550 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoThe final piece of the double -> string puzzle.
des [Tue, 4 Mar 2008 09:29:54 +0000 (09:29 +0000)]
The final piece of the double -> string puzzle.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2549 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoPolish CLI output
phk [Tue, 4 Mar 2008 08:54:53 +0000 (08:54 +0000)]
Polish CLI output

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2548 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoRegen for VRT_double_string()
des [Mon, 3 Mar 2008 17:03:53 +0000 (17:03 +0000)]
Regen for VRT_double_string()

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2547 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoClean up the int -> str and ip -> str conversion code, and add double -> str.
des [Mon, 3 Mar 2008 17:03:05 +0000 (17:03 +0000)]
Clean up the int -> str and ip -> str conversion code, and add double -> str.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2546 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoWorkaround: ignore uncached objects in EXP_Touch()
phk [Fri, 29 Feb 2008 09:38:49 +0000 (09:38 +0000)]
Workaround: ignore uncached objects in EXP_Touch()

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2544 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoGo over the expiry and LRU code once more:
phk [Tue, 26 Feb 2008 11:05:54 +0000 (11:05 +0000)]
Go over the expiry and LRU code once more:

Drop the hangman, with grace implemented we might as well just ditch
the object when the timer expires.

Use separate markers for "on LRU" and "on binheap" and document the
specific protocol for avoiding conflicts between LRU and timer processing.

Many more asserts and a couple of minor bugfixes.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2543 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoFix a bug in the hangman code: conversion from object to objexp
phk [Tue, 26 Feb 2008 09:23:39 +0000 (09:23 +0000)]
Fix a bug in the hangman code: conversion from object to objexp
missed a marker variable.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2542 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoGive the random director its own magic
phk [Tue, 26 Feb 2008 09:12:29 +0000 (09:12 +0000)]
Give the random director its own magic

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2541 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoGet the pthread_mutex_trylock() assert right, the error code is the
phk [Tue, 26 Feb 2008 09:10:35 +0000 (09:10 +0000)]
Get the pthread_mutex_trylock() assert right, the error code is the
return value, and not in errno.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2540 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoAvoid asserting on correct errno from pthread_mutextrylock()
phk [Mon, 25 Feb 2008 22:30:23 +0000 (22:30 +0000)]
Avoid asserting on correct errno from pthread_mutextrylock()

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2539 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoExplicitly initialize errno to zero before mutex ops.
phk [Mon, 25 Feb 2008 18:42:07 +0000 (18:42 +0000)]
Explicitly initialize errno to zero before mutex ops.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2538 d4fa192b-c00b-0410-8231-f00ffab90ce4

16 years agoThe expiry module keeps all cached objects on two data structures:
phk [Sat, 23 Feb 2008 20:36:33 +0000 (20:36 +0000)]
The expiry module keeps all cached objects on two data structures:
the LRU list and the binary heap.  In both of these cases, operations
on one object will result in certain fields in neighbor objects in
these data structures to be updated.

In difference from cache_hash.c which examine objects related by
hash match where the existence of the hash lookup in the first place
is a predictor for their likely use, in cache_expire the neighbor
objects are totally unrelated and the fact that we update their
list pointers or binheap index in no way indicates that they will
get a cache hit any time soon.

Paging in one page for a number of objects, just to move another
object up or down the binheap or LRU list is thus not only slow,
but also increases varnish' VM footprint for no real benefit.

This commit moves the relevant housekeeping fields into a "objexp"
structure, which gets hung off the objects when they enter the cache.

The objexp structure is small (40 bytes on i386) so statistically it
is more than an order of magnitude more likely to already be in core
when we need it, compared to the object itself.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2537 d4fa192b-c00b-0410-8231-f00ffab90ce4