pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: matt@ymogen.net
To: Alex Hayward <xelah-pgsql@xelah.com>
Cc: 'PostgreSQL Performance' <pgsql-performance@postgresql.org>
Subject: Re: Performance Bottleneck
Date: Tue, 10 Aug 2004 21:04:56 +0100 (BST)
Message-ID: <4995.82.68.132.233.1092168296.squirrel@webmail.ymogen.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0408101521200.423@sphinx.mythic-beasts.com>
References: <007f01c47d54$233b4bf0$8300a8c0@solent>
	<Pine.LNX.4.58.0408101521200.423@sphinx.mythic-beasts.com>


> Squid also takes away the work of doing SSL (presuming you're running it
> on a different machine). Unfortunately it doesn't support HTTP/1.1 which
> means that most generated pages (those that don't set Content-length) end
> up forcing squid to close and then reopen the connection to the web
> server.

It is true that it doesn't support http/1.1, but 'most generated pages'? 
Unless they are actually emitted progressively they should have a
perfectly good content-length header.

> I've also had some problems when Squid had a large number of connections
> open (several thousand); though that may have been because of my
> half_closed_clients setting. Squid 3 coped a lot better when I tried it
> (quite a few months ago now - and using FreeBSD and the special kqueue
> system call) but crashed under some (admittedly synthetic) conditions.

It runs out of the box with a very conservative setting for max open file
descriptors - this may or may not be the cause of the problems you have
seen.  Certainly I ran squid with >16,000 connections back in 1999...

> You still have periods of time when the web servers are busy using their
> CPUs to generate HTML rather than waiting for database queries. This is
> especially true if you cache a lot of data somewhere on the web servers
> themselves (which, in my experience, reduces the database load a great
> deal). If you REALLY need to reduce the number of connections (because you
> have a large number of web servers doing a lot of computation, say) then
> it might still be useful.

Aha, a postgres related topic in this thread!  What you say is very true,
but then given that the connection overhead is so vanishingly small, why
not simply run without a persistent DB connection in this case?  I would
maintain that if your webservers are holding open idle DB connections for
so long that it's a problem, then simply close the connections!

M



view thread (38+ messages)

Message-ID: <4995.82.68.132.233.1092168296.squirrel@webmail.ymogen.com>
Permalink:  ../4995.82.68.132.233.1092168296.squirrel@webmail.ymogen.com/
Also on:    postgresql.org/message-id/4995.82.68.132.233.1092168296.squirrel@webmail.ymogen.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: matt@ymogen.net, xelah-pgsql@xelah.com
  Subject: Re: Performance Bottleneck
  In-Reply-To: <4995.82.68.132.233.1092168296.squirrel@webmail.ymogen.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox