pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: weigelt@metux.de
To: pgsql-performance@postgresql.org
Subject: Re: BLOB's bypassing the OS Filesystem for better Image loading speed?
Date: Thu, 12 May 2005 12:02:56 +0200
Message-ID: <op.sqnp66onth1vuj@localhost> (raw)
In-Reply-To: <20050511232623.GE6485@nibiru.borg.metux.de>
References: <426DFA46.8090402@yahoo.de>
	<20050511232623.GE6485@nibiru.borg.metux.de>


>> Filesystems with many Filesystem Objects can slow down the Performance
>> at opening and reading Data.

	On my laptop, lighttpd takes upto 15000 hits PER SECOND on static 2-3 Kb  
files (tested with apachebench 2).
	Apache is slower, of course : 3-4000 hits per second which is not that  
bad.
	Using a dynamic script with images in the database, you should account  
for query and transmission overhead, dynamic page overhead... mmm, I'd say  
using a fast application server you could maybe get 2-300 images served  
per second from the database, and that's very optimistic. And then the  
database will crawl, it will be disintegrated by the incoming flow of  
useless requests... scalability will be awful...
	Not mentioning that browsers ask the server "has this image changed since  
the last time ?" (HEAD request) and then they don't download it if it  
doesn't. The server just stat()'s the file. statting a file on any decent  
filesystem (ie. XFS Reiser JFS etc.) should take less than 10 microseconds  
if the information is in the cache. You'll have to look in the database to  
check the date... more queries !

	If you want to control download rights on files, you can still put the  
files on the filesystem (which is the right choice IMHO) and use a dynamic  
script to serve them. Even better, you could use lighttpd's authorized  
file download feature.

	The only case I see putting files in a database as interesting is if you  
want them to be part of a transaction. In that case, why not...



view thread (6+ messages)

Message-ID: <op.sqnp66onth1vuj@localhost>
Permalink:  ../op.sqnp66onth1vuj@localhost/
Also on:    postgresql.org/message-id/op.sqnp66onth1vuj@localhost

 · 

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: lists@boutiquenumerique.com, weigelt@metux.de
  Subject: Re: BLOB's bypassing the OS Filesystem for better Image loading speed?
  In-Reply-To: <op.sqnp66onth1vuj@localhost>

* 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