403 - Forbidden on gitweb pages

Поиск
Список
Период
Сортировка
Искать

403 - Forbidden on gitweb pages

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Every so often (a few percent of the time, I think) I get "403 -
Forbidden" from following a link on http://git.postgresql.org/gitweb/.
So far, a reload has always worked first time, but there's definitely
something fishy in there.  I don't recall exactly when this started
happening, maybe a month or so back; it hasn't been there all along.

Anybody else see this, or have an idea what broke?
		regards, tom lane


Re: 403 - Forbidden on gitweb pages

От:
Alvaro Herrera <alvherre@2ndquadrant.com>
Дата:
Tom Lane wrote:
> Every so often (a few percent of the time, I think) I get "403 -
> Forbidden" from following a link on http://git.postgresql.org/gitweb/.
> So far, a reload has always worked first time, but there's definitely
> something fishy in there.  I don't recall exactly when this started
> happening, maybe a month or so back; it hasn't been there all along.
> 
> Anybody else see this, or have an idea what broke?

Yes, I see this also.  I reported it to Magnus, who muttered something
about Varnish possibly misbehaving, but that was the end of it.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


Re: 403 - Forbidden on gitweb pages

От:
Dave Page <dpage@pgadmin.org>
Дата:


On Thursday, February 14, 2013, Alvaro Herrera wrote:
Tom Lane wrote:
> Every so often (a few percent of the time, I think) I get "403 -
> Forbidden" from following a link on http://git.postgresql.org/gitweb/.
> So far, a reload has always worked first time, but there's definitely
> something fishy in there.  I don't recall exactly when this started
> happening, maybe a month or so back; it hasn't been there all along.
>
> Anybody else see this, or have an idea what broke?

Yes, I see this also.  I reported it to Magnus, who muttered something
about Varnish possibly misbehaving, but that was the end of it.


He told me it was intentional rate limiting, applied because gitweb is so inefficient.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: 403 - Forbidden on gitweb pages

От:
Magnus Hagander <magnus@hagander.net>
Дата:


On Feb 14, 2013 1:35 AM, "Dave Page" <dpage@pgadmin.org> wrote:
>
>
>
> On Thursday, February 14, 2013, Alvaro Herrera wrote:
>>
>> Tom Lane wrote:
>> > Every so often (a few percent of the time, I think) I get "403 -
>> > Forbidden" from following a link on http://git.postgresql.org/gitweb/.
>> > So far, a reload has always worked first time, but there's definitely
>> > something fishy in there.  I don't recall exactly when this started
>> > happening, maybe a month or so back; it hasn't been there all along.
>> >
>> > Anybody else see this, or have an idea what broke?
>>
>> Yes, I see this also.  I reported it to Magnus, who muttered something
>> about Varnish possibly misbehaving, but that was the end of it.
>>
>
> He told me it was intentional rate limiting, applied because gitweb is so inefficient.

Correct. And varnish is not involved at all. I think alvaro is confusing it with me saying that varnish might be a way for us to actually fix the problem.

The problem is basically that gitweb is a big perl cgi (yes, cgi only) which means that for every request it had to reload all of perl and reparse the whole script. And on top of that the actual implementation of several features is fairly slow in itself.

This caused easy overload - for example the whole site went down when a search engine spidered us...

The bandaid solution was to rate limit access per ip. The error you hit is when you're rate limited.

Now, I was supposed to have on my to do list to make a better fix. But as this one was implemented a long time ago (measured in years, really, I have to admit I forgot... I'll put bit back on the list.

/Magnus

Re: 403 - Forbidden on gitweb pages

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Magnus Hagander  writes:
> The bandaid solution was to rate limit access per ip. The error you hit is
> when you're rate limited.

[ raised eyebrow... ]  I'm fairly sure I've seen it more than once when
performing a *single* page fetch.  In any case, the probability of
failure increased by a couple orders of magnitude sometime in the past
month or so, because I'd never seen it before that.
		regards, tom lane


Re: 403 - Forbidden on gitweb pages

От:
Magnus Hagander <magnus@hagander.net>
Дата:


On Feb 14, 2013 5:31 AM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>
> Magnus Hagander <magnus@hagander.net> writes:
> > The bandaid solution was to rate limit access per ip. The error you hit is
> > when you're rate limited.
>
> [ raised eyebrow... ]  I'm fairly sure I've seen it more than once when
> performing a *single* page fetch.  In any case, the probability of
> failure increased by a couple orders of magnitude sometime in the past
> month or so, because I'd never seen it before that.

In that case you may be hitting a different issue, and we're writing it off as the rare limiting by mistake. Because nothing about that one has changed for quite some time, and should never hit on a single page. Will have to investigate that further then.

/Magnus

Re: 403 - Forbidden on gitweb pages

От:
Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Дата:
Magnus Hagander  writes:
> The problem is basically that gitweb is a big perl cgi (yes, cgi only)
> which means that for every request it had to reload all of perl and reparse
> the whole script. And on top of that the actual implementation of several
> features is fairly slow in itself.

What about finding a more efficient replacement?
 http://gitlabhq.com/ http://hjemli.net/git/cgit/

We need to check that GitLab can be setup to not offer all of its
features, and the CGIT way of displaying branches looks very much suited
to our project back branches support.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


Re: 403 - Forbidden on gitweb pages

От:
Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
Дата:
On 02/14/2013 05:31 AM, Tom Lane wrote:
> Magnus Hagander  writes:
>> The bandaid solution was to rate limit access per ip. The error you hit is
>> when you're rate limited.
> 
> [ raised eyebrow... ]  I'm fairly sure I've seen it more than once when
> performing a *single* page fetch.  In any case, the probability of
> failure increased by a couple orders of magnitude sometime in the past
> month or so, because I'd never seen it before that.

any chance you moved to a different browser (or a new version of it) in
that timeframe?
I can trivially reproduce that issue here now because my browser is
employing fairly agressive prefetching techniques that the currently
rate-limiting system is not prepared to deal with, and from looking at
the logs this is actually a fairly common issue :(


Stefan


Re: 403 - Forbidden on gitweb pages

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Stefan Kaltenbrunner  writes:
> On 02/14/2013 05:31 AM, Tom Lane wrote:
>> [ raised eyebrow... ]  I'm fairly sure I've seen it more than once when
>> performing a *single* page fetch.  In any case, the probability of
>> failure increased by a couple orders of magnitude sometime in the past
>> month or so, because I'd never seen it before that.

> any chance you moved to a different browser (or a new version of it) in
> that timeframe?
> I can trivially reproduce that issue here now because my browser is
> employing fairly agressive prefetching techniques that the currently
> rate-limiting system is not prepared to deal with, and from looking at
> the logs this is actually a fairly common issue :(

Hm.  I usually use Apple's Safari, which is currently at 6.0.2, and
it looks like I installed that update at the beginning of November.
It's possible they instituted aggressive prefetching in the 6.0.1 to
6.0.2 update, but somehow I doubt that.

Would it make sense to just back off the rate limiting a bit?
		regards, tom lane


Re: 403 - Forbidden on gitweb pages

От:
Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
Дата:
On 02/15/2013 12:28 AM, Tom Lane wrote:
> Stefan Kaltenbrunner  writes:
>> On 02/14/2013 05:31 AM, Tom Lane wrote:
>>> [ raised eyebrow... ]  I'm fairly sure I've seen it more than once when
>>> performing a *single* page fetch.  In any case, the probability of
>>> failure increased by a couple orders of magnitude sometime in the past
>>> month or so, because I'd never seen it before that.
> 
>> any chance you moved to a different browser (or a new version of it) in
>> that timeframe?
>> I can trivially reproduce that issue here now because my browser is
>> employing fairly agressive prefetching techniques that the currently
>> rate-limiting system is not prepared to deal with, and from looking at
>> the logs this is actually a fairly common issue :(
> 
> Hm.  I usually use Apple's Safari, which is currently at 6.0.2, and
> it looks like I installed that update at the beginning of November.
> It's possible they instituted aggressive prefetching in the 6.0.1 to
> 6.0.2 update, but somehow I doubt that.

hm ok...

> 
> Would it make sense to just back off the rate limiting a bit?

done that for now until we have a better solution - lets see if it
behaves better now.


Stefan


Re: 403 - Forbidden on gitweb pages

От:
Magnus Hagander <magnus@hagander.net>
Дата:
On Fri, Feb 15, 2013 at 3:33 PM, Stefan Kaltenbrunner
 wrote:
> On 02/15/2013 12:28 AM, Tom Lane wrote:
>> Stefan Kaltenbrunner  writes:
>>> On 02/14/2013 05:31 AM, Tom Lane wrote:
>>>> [ raised eyebrow... ]  I'm fairly sure I've seen it more than once when
>>>> performing a *single* page fetch.  In any case, the probability of
>>>> failure increased by a couple orders of magnitude sometime in the past
>>>> month or so, because I'd never seen it before that.
>>
>>> any chance you moved to a different browser (or a new version of it) in
>>> that timeframe?
>>> I can trivially reproduce that issue here now because my browser is
>>> employing fairly agressive prefetching techniques that the currently
>>> rate-limiting system is not prepared to deal with, and from looking at
>>> the logs this is actually a fairly common issue :(
>>
>> Hm.  I usually use Apple's Safari, which is currently at 6.0.2, and
>> it looks like I installed that update at the beginning of November.
>> It's possible they instituted aggressive prefetching in the 6.0.1 to
>> 6.0.2 update, but somehow I doubt that.
>
> hm ok...
>
>>
>> Would it make sense to just back off the rate limiting a bit?
>
> done that for now until we have a better solution - lets see if it
> behaves better now.

I've deployed what I think is a better fix for this now - it's now
limited to two parallel *active* connections from wherever, but any
further requests are placed in a queue rather than being rejected iwth
403.

As a bonus, we now also have caching. That makes particularly the
frontpage quite a lot faster for most people - not likely to have a
big effect on details pages, since there are just too many of them to
get efficient caching.

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/


FAQ