Commit Graph

175 Commits

Author SHA1 Message Date
Otto van der Schaaf 9fabe2d322 inflate-upstream: support gzipped/deflated upstreams
Adds suport for silently inflating compressed upstreams. This is
good for when the link to the upstream is low bandwidth

This should fix https://github.com/pagespeed/ngx_pagespeed/issues/140
2013-03-20 20:06:30 +01:00
Jeff Kaufman 46055b400a Merge pull request #187 from pagespeed/oschaaf-fix-message-handler-initializer
fix-message-handler-intializer: add log_ to the list
2013-03-12 13:04:14 -07:00
Otto van der Schaaf 606d011812 fix-message-handler-intializer: add log_ to the list 2013-03-12 19:56:52 +01:00
Jeff Kaufman e081fff031 shared-mem-locks: clean up shared memory segments
This wires up cleanup code shared memory segments.
It uses slightly modified copies of pthread_shared_mem.cc/h, containing a change
proposal to support our ordering of events during a configuration reload.

It can be tested and reviewed through this branch.

I did some extensive tests, it seems segment cleanup is not perfect yet
(segments for named locks, per vhost statistics segments). I think we need to
fix that in the trunk-tracking branch or in a separate pull though. It seems the
current trunk of psol has improvements that may fix this, and fixing it in this
pull will make it larger and more complex then I would like it to be.

Squash-merge of Otto's #179.
2013-03-06 10:02:29 -05:00
Jeff Kaufman 7735cf0636 ngx-pagespeed-message: wire up ngx_pagespeed_message url
This allows viewing the last few messages written to the SharedCircularBuffer in
NgxMessageHandler through url /ngx_pagespeed_message

Related issue: https://github.com/pagespeed/ngx_pagespeed/issues/153

Squash-merge of Otto's #180.
2013-03-06 09:57:41 -05:00
Jeff Kaufman 6344d31c83 Add /ngx_pagespeed_statistics
This adds /ngx_pagespeed_statistics. It also uses SharedMemoryStatistics instead
of the SimpleStatistics currently used, and sets them as the default. It also
adds support for tracking per server{} statistics.

Cleaning up of shared segments is disabled, because the current psol version we
link in has a problem with the ordering of nginx's events during a configuration
reload.

The referrer statistics will be ported in a separate pull.

Related to issue #133

Squash-merge of Otto's work in #176.
2013-02-26 11:42:39 -05:00
Jeff Kaufman 4f6f155920 message-handler: Add NgxMessageHandler
This adds an NgxMessageHandler, that uses ngx_log_error to output messages. It
is heavily based on apache_message_handler from mod_pagespeed.

It falls back to an internal GoogleMessageHandler if the required initialisation
has not been performed yet.

It can also install a crash handler, that will try to log a backtrace upon
receiving certain signals. In preparation of us porting /ngx_pagespeed_messages,
it also keeps the last few messages in a SharedCircularBuffer

(Squash-merge of Otto's #163)
2013-02-13 11:26:20 -05:00
Jeff Kaufman 102070269c rewrite_driver_factory: move instantiation up front
We need to have the NgxRewriteDriverFactory available at configuration parse
time to set options on it. This change moves instantiation of the factory in
front of configuration parsing.  Afterwards, a check is done to see if we where
enabled anywhere.  If we where not enabled / do not have any active server
contexts, the NgxRewriteDriverFactory is deleted. It's not very elegant, but we
can't think of anything better currently.

Squash merge of Otto's #165.
2013-02-11 10:49:20 -05:00
Jeff Kaufman 48582483a1 Merge pull request #167 from jperelli/patch-1
Solve "unknown type name ‘off64_t’", issue #166
2013-02-05 09:39:34 -08:00
jperelli f31f9de405 Solve "unknown type name ‘off64_t’", issue #166 2013-02-04 20:30:20 -02:00
Jeff Kaufman 9e6de567ee Merge pull request #162 from pagespeed/jefftk-experiment-resource-regexp
readme: support experiment resource urls
2013-02-01 06:42:53 -08:00
Jeff Kaufman cb2ce08004 readme: document tengine usage 2013-01-31 11:11:29 -05:00
Jeff Kaufman 0609b89162 readme: support experiment resource urls
A normal .pagespeed. url looks like:

    256x192vPuzzle.jpg.pagespeed.ic.alA0AdlR-2.jpg

If someone turns on RunExperiment, however, we generate urls like:

    256x192vPuzzle.jpg.pagespeed.a.ic.alA0AdlR-2.jpg
    256x192vPuzzle.jpg.pagespeed.b.ic.alA0AdlR-2.jpg

The new section is always a single letter between a and z.  We need to catch
these and pass them through to PageSpeed.
2013-01-31 10:44:31 -05:00
Jeff Kaufman 9c3c6e9ab0 Merge pull request #160 from pagespeed/oschaaf-shutdown-fix
shutdown-fix: fix a possible crasher on shutdown
2013-01-31 07:12:52 -08:00
Otto van der Schaaf be7b483cdc shutdown-fix: fix a possible crasher on shutdown 2013-01-31 16:09:03 +01:00
Jeff Kaufman dbcc5650c9 Merge pull request #159 from pagespeed/jefftk-debian-dependencies
readme: fix debian dependencies
2013-01-31 06:58:15 -08:00
Jeff Kaufman 4f97399f55 readme: fix debian dependencies
As @bnoordhuis points out, `build-essential` depends on `make` and older
releases call `git` as `git-core`.
2013-01-31 09:34:00 -05:00
Jeff Kaufman 5a73e37160 Merge pull request #158 from pagespeed/oschaaf-shared-mem-locks-fixed
Shared mem locks fixed
2013-01-30 13:58:35 -08:00
Otto van der Schaaf 1971ccc44f shared-memory-locks: Fix a segmentation fault
Do not instantiate a ProxyFetchFactory when the ServerContext is
NULL on cfg_s
2013-01-30 22:14:33 +01:00
Otto van der Schaaf 69cfb971ee Revert "Revert "locking: support shared memory locking""
This reverts commit be9a78b18a.
2013-01-30 22:12:20 +01:00
Jeff Kaufman c86f127161 Merge pull request #157 from benoit934/patch-2
Add Debian's Install dependencies command
2013-01-30 08:24:48 -08:00
Benoit Anastay 41e5a124d0 Add Debian's Install dependencies command 2013-01-30 01:51:18 +01:00
Jeff Kaufman be9a78b18a Revert "locking: support shared memory locking"
I just enabled this on jefftk.com and it locked the server up.

This reverts commit d0464e8982.
2013-01-29 18:12:07 -05:00
Jeff Kaufman d0464e8982 locking: support shared memory locking
Squashed merge of Otto's pull request #151.
2013-01-29 17:58:07 -05:00
Jeff Kaufman 5a10e31e81 experiments: support RunExperiment
Before the experiment code was just setting the need_to_store_experiment_data
option but nothing was looking at that option.  Rewrote the code, basing it on
InstawebContext::SetFuriousStateAndCookie, in order to actually set the cookie
to support the experiment.  There are tests for this functionality, but we're
waiting on issue #40 to be able to run them.

Manual testing (with line wrapping):

    $ curl -s -D- http://localhost:8050/mod_pagespeed_example/ | grep GFURIOUS
    Set-Cookie: _GFURIOUS=1; Expires=Fri, 01 Feb 2013 21:38:31 GMT;
                Domain=.localhost; Path=/

    $ curl -s -D- http://localhost:8050/mod_pagespeed_example/ | grep GFURIOUS
    Set-Cookie: _GFURIOUS=2; Expires=Fri, 01 Feb 2013 21:42:56 GMT;
                Domain=.localhost; Path=/

And it responds properly on receiving the cookie, although it did that before
this change too.
2013-01-29 17:55:55 -05:00
Jeff Kaufman ea4e17b623 add_instrumentation: return 204 and log for /ngx_pagespeed_beacon hits
Fixes #134
2013-01-23 17:43:57 -05:00
Jeff Kaufman 16dec39f7d guard against server only options being configured at location scope
guard against server only options being configured at location scope this
introduces a duplicated list of server-level-only options from mod_instaweb.cc,
which is a short term solution and should be removed later on

Fixes #99.
2013-01-23 17:30:52 -05:00
Jeff Kaufman cc14b642ad Merge pull request #146 from pagespeed/jefftk-lint-fixes
style: fix style errors cpplint finds; annotate the ones it's wrong about
2013-01-23 14:22:06 -08:00
Jeff Kaufman c4cb36f378 style: fix style errors cpplint finds; annotate the ones it's wrong about 2013-01-23 17:15:03 -05:00
Jeff Kaufman 3fe87dc64b shutdown-sequence: fix a segfault during a shutdown under load
Shut down the driver factory before the proxy fetch factory.
shutting down the driver factory will make sure that all worker
threads are stopped, This prevents in-flight callbacks to
destroyed proxy fetch factories, so we should be able to safely
delete them

This fixes #109.
2013-01-23 13:32:29 -05:00
Jeff Kaufman 5363fe0c32 cosmetic changes: alphabetization, spacing, indentation, type location
Merge of pull request #135
2013-01-23 13:29:18 -05:00
Jeff Kaufman 2056e919c4 config: fix line continuation bug 2013-01-22 12:54:18 -05:00
Jeff Kaufman 4eb9e0fce9 Merge pull request #139 from pagespeed/jefftk-32bit-arch
config: interpret amd64, i686, and i386
2013-01-21 14:50:12 -08:00
Jeff Kaufman 632973caed config: interpret amd64, i686, and i386 2013-01-21 17:18:45 -05:00
Jeff Kaufman 8fcea5c873 resources: reject non-HEAD non-GET requests 2013-01-21 13:48:32 -05:00
Jeff Kaufman 76ef7f9f47 readme: link to ngxpagespeed.com 2013-01-17 17:02:23 -05:00
Jeff Kaufman 7d825331cf readme: the Library command uses longer hashes now 2013-01-17 14:56:10 -05:00
Jeff Kaufman 53f08d3321 Merge pull request #132 from pagespeed/jefftk-strip-headers
headers: strip accept-bytes and vary-accept-encoding
2013-01-17 11:54:50 -08:00
Jeff Kaufman 98d404d707 headers: strip accept-bytes and vary-accept-encoding
If we're proxying the origin server might advertise `Accept-Ranges: bytes` but
we don't support range requests.  So we need to remove the header.  We also need
to not add `Vary: Accept-Encoding` twice, and because the gzip encoding will add
it later we need to remove it here.
2013-01-17 14:54:19 -05:00
Jeff Kaufman bf6a95ee1a readme: you can't send Accept-Encoding to an upstream 2013-01-16 17:13:08 -05:00
Jeff Kaufman df04cb1119 readme: document dependencies 2013-01-16 14:58:34 -05:00
Jeff Kaufman f80faa6016 readme: tidy link to mps build from source 2013-01-16 11:38:05 -05:00
Jeff Kaufman 111c354d65 readme: what to do if configure fails 2013-01-16 11:36:30 -05:00
Jeff Kaufman 87b4faa038 slow_worker: reenable slow worker for the file cache
The file cache needs a slow worker or it will never run the cleanup code.  In
configurations with multiple server blocks, like jefftk.com, the rewrite
driver factory could cause a a segfault by deleting the slow worker when setting
up caches.  So this fixes #126.
2013-01-15 15:33:43 -05:00
Jeff Kaufman b042efc2d0 threads: CHECK-fail on threads started before forking 2013-01-15 12:34:58 -05:00
Jeff Kaufman fc5ac99895 load-from-file: port load-from-file
load-from-file is helpful in may setups, and also is used in many
vhosts in the test configuration

Squash-merge of Otto's change via pull request #125
2013-01-15 10:04:08 -05:00
Jeff Kaufman 02dd432ac1 Revert "filecache-worker: hook the worker up to the filecache"
This is causing segfaults on jefftk.com.

This reverts commit 6f927897ec.
2013-01-11 10:16:42 -05:00
Jeff Kaufman d310f9d326 readme: run configure from nginx/ not nginx/src/ 2013-01-10 15:30:52 -05:00
Jeff Kaufman 27e093b365 remove stray fi 2013-01-10 15:29:12 -05:00
Jeff Kaufman 77fd3105eb readme: put valgrind doc in the right section of the config 2013-01-09 15:44:36 -05:00