pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedHardware needed for 15,000,000 record DB?
10+ messages / 7 participants
[nested] [flat]
* Hardware needed for 15,000,000 record DB?
@ 2002-04-21 23:25 pdg@stratos.net
0 siblings, 2 replies; 10+ messages in thread
From: pdg@stratos.net @ 2002-04-21 23:25 UTC (permalink / raw)
To: pgsql-novice@postgresql.org; pgsql-admin
Hello, :-)
Can someone help me spec out the hardware needed for a simple web-based
database app?
Basically, that application needs to lookup a single row by its primary key.
This would be fairly straightforward, except that the table needs to contain
up to 15 million records. Each row will contain approximately 25 variable
length CHAR fields with perhaps a total of 3 to 4 kilobytes of data per row.
Updates will be done nightly via some sort of a batch process.
What kind of hardware would be needed for this sort of application? The
queries are not complex, it's just a lot of data.
Would a midrange Celeron processor with 256 MB RAM be sufficient? How would
backups work for a database this large?
Is PostgreSQL even the best database engine for this app? Perhaps MySQL? Or
maybe a Microsoft solution?
Thanks so much,
David
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: [NOVICE] Hardware needed for 15,000,000 record DB?
@ 2002-04-22 06:29 Mathieu Arnold <mat@mat.cc>
parent: pdg@stratos.net
1 sibling, 1 reply; 10+ messages in thread
From: Mathieu Arnold @ 2002-04-22 06:29 UTC (permalink / raw)
To: pgsql-novice@postgresql.org; pgsql-admin
--On dimanche 21 avril 2002 19:25 -0400 pdg@stratos.net wrote:
> Hello, :-)
>
> Can someone help me spec out the hardware needed for a simple web-based
> database app?
>
> Basically, that application needs to lookup a single row by its primary
> key. This would be fairly straightforward, except that the table needs to
> contain up to 15 million records. Each row will contain approximately 25
> variable length CHAR fields with perhaps a total of 3 to 4 kilobytes of
> data per row.
>
> Updates will be done nightly via some sort of a batch process.
>
> What kind of hardware would be needed for this sort of application? The
> queries are not complex, it's just a lot of data.
>
> Would a midrange Celeron processor with 256 MB RAM be sufficient? How
> would backups work for a database this large?
>
> Is PostgreSQL even the best database engine for this app? Perhaps MySQL?
> Or maybe a Microsoft solution?
well, I have a server with a database over 7GB, and :
backup=> select count(*) from file;
count
----------
19430605
(1 row)
backup=> explain analyze select * from file where id_file = 29000000;
NOTICE: QUERY PLAN:
Index Scan using file_pkey on file (cost=0.00..3.18 rows=1 width=117)
(actual time=0.60..0.61 rows=1 loops=1)
Total runtime: 0.77 msec
and it's an old poor :
hda: IBM-DTLA-307030, ATA DISK drive
ps: the select count(*) took a long time, but I believe that was because
there was a batch running and feeding the db :)
--
Mathieu Arnold
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: [NOVICE] Hardware needed for 15,000,000 record DB?
@ 2002-04-22 07:41 pdg@stratos.net
parent: Mathieu Arnold <mat@mat.cc>
0 siblings, 1 reply; 10+ messages in thread
From: pdg@stratos.net @ 2002-04-22 07:41 UTC (permalink / raw)
To: Mathieu Arnold <mat@mat.cc>; pgsql-novice@postgresql.org; pgsql-admin
Hello,
> well, I have a server with a database over 7GB, and :
>
> backup=> select count(*) from file;
> count
> ----------
> 19430605
> (1 row)
>
> backup=> explain analyze select * from file where id_file = 29000000;
> NOTICE: QUERY PLAN:
>
> Index Scan using file_pkey on file (cost=0.00..3.18 rows=1 width=117)
> (actual time=0.60..0.61 rows=1 loops=1)
> Total runtime: 0.77 msec
>
> and it's an old poor :
> hda: IBM-DTLA-307030, ATA DISK drive
>
> ps: the select count(*) took a long time, but I believe that was because
> there was a batch running and feeding the db :)
Thanks for the information.
Though, as a newbie, I am not quite sure what all the above performance
numbers actually mean. :)
What sort of CPU/Memory configuration are you running this server on?
Thanks again,
David
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: [NOVICE] Hardware needed for 15,000,000 record DB?
@ 2002-04-22 07:58 Mathieu Arnold <mat@mat.cc>
parent: pdg@stratos.net
0 siblings, 0 replies; 10+ messages in thread
From: Mathieu Arnold @ 2002-04-22 07:58 UTC (permalink / raw)
To: pdg@stratos.net; pgsql-novice@postgresql.org; pgsql-admin
--On lundi 22 avril 2002 03:41 -0400 pdg@stratos.net wrote:
> Hello,
>
>
>> well, I have a server with a database over 7GB, and :
>>
>> backup=> select count(*) from file;
>> count
>> ----------
>> 19430605
>> (1 row)
>>
>> backup=> explain analyze select * from file where id_file = 29000000;
>> NOTICE: QUERY PLAN:
>>
>> Index Scan using file_pkey on file (cost=0.00..3.18 rows=1 width=117)
>> (actual time=0.60..0.61 rows=1 loops=1)
>> Total runtime: 0.77 msec
>>
>> and it's an old poor :
>> hda: IBM-DTLA-307030, ATA DISK drive
>>
>> ps: the select count(*) took a long time, but I believe that was because
>> there was a batch running and feeding the db :)
>
> Thanks for the information.
>
> Though, as a newbie, I am not quite sure what all the above performance
> numbers actually mean. :)
>
> What sort of CPU/Memory configuration are you running this server on?
well, it means that I got an entry from my database (which have 19,430,605
entries) in 0.77 msec using the primary key.
the server is a pIII 600 with 256M of ram, but there is a lot of other
things running on.
The main things about database is the hard drive speed, with the turtle
I've got in this server, it is *slow*, just get a scsi3 hard drive and
it'll run like smoothly, the second thing, is the memory/cpu speed, but it
really only gets useful if you have very complex queries.
--
Mathieu Arnold
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Hardware needed for 15,000,000 record DB?
@ 2002-04-22 22:17 Jeremy Buchmann <jeremy@wellsgaming.com>
parent: pdg@stratos.net
1 sibling, 1 reply; 10+ messages in thread
From: Jeremy Buchmann @ 2002-04-22 22:17 UTC (permalink / raw)
To: pdg@stratos.net; +Cc: pgsql-admin
pdg@stratos.net wrote:
> Hello, :-)
>
> Can someone help me spec out the hardware needed for a simple web-based
> database app?
>
> Basically, that application needs to lookup a single row by its primary key.
> This would be fairly straightforward, except that the table needs to contain
> up to 15 million records. Each row will contain approximately 25 variable
> length CHAR fields with perhaps a total of 3 to 4 kilobytes of data per row.
>
> Updates will be done nightly via some sort of a batch process.
>
> What kind of hardware would be needed for this sort of application? The
> queries are not complex, it's just a lot of data.
Databases are I/O bound...if your I/O is slow, your database will be slow.
So your goal is to minimize the amount of I/O needed and the time it takes
to do the I/O. You minimize the amount of I/O by getting things with big
caches. You minimize the amount of time the I/O takes by using fast
storage devices.
This means SCSI. If you have limited funds, spend them on fast SCSI disks
with big caches and a good controller instead the latest and greatest
processor.
If you have the funds, look into getting a RAID card with a big cache on it.
A RAID 1 or 5 also helps out if a disk crashes.
> Would a midrange Celeron processor with 256 MB RAM be sufficient? How would
> backups work for a database this large?
I would not use the Celeron. The Celeron lacks cache, and you want all the
cache you can afford. One user posted benchmarks to this list showing the
Celeron to be twice as slow as a PIII at the same clock speed.
Buy a lot of memory. And make sure the motherboard you get can support a lot
of memory (i.e., it has 4 or more slots for RAM).
Backups: DDS3/4 tape is a good, but expensive choice. It's one of the few backup
technologies that has cheap media and is vendor-neutral. Stay away from
"Big floppies" like Jaz drives. They're too flaky.
> Is PostgreSQL even the best database engine for this app? Perhaps MySQL? Or
> maybe a Microsoft solution?
MySQL is traditionally faster at pumping out web pages with pure speed, but
PostgreSQL has been catching up very quickly. Also, PostgreSQL has
traditionally been able to handle many more concurrent users, but I think
MySQL has been getting better there, too. I haven't seen any banchmarks
with recent versions of either database. They're both free, so try some
tests with both of them (but don't forget to tune them properly).
If you care anything about cost or flexibility, I wouldn't go for a Microsoft
"solution".
--Jeremy
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Hardware needed for 15,000,000 record DB?
@ 2002-04-23 02:34 Curt Sampson <cjs@cynic.net>
parent: Jeremy Buchmann <jeremy@wellsgaming.com>
0 siblings, 1 reply; 10+ messages in thread
From: Curt Sampson @ 2002-04-23 02:34 UTC (permalink / raw)
To: Jeremy Buchmann <jeremy@wellsgaming.com>; +Cc: pgsql-admin
On Mon, 22 Apr 2002, Jeremy Buchmann wrote:
> Databases are I/O bound...if your I/O is slow, your database will be slow.
> So your goal is to minimize the amount of I/O needed and the time it takes
> to do the I/O. You minimize the amount of I/O by getting things with big
> caches.
Assuming you freqently access the same data. If you're doing
essentially random queries on a 50 GB database, an extra few hundred
megabytes of cache will probably make little difference.
> You minimize the amount of time the I/O takes by using fast
> storage devices.
> This means SCSI.
Not necessarially. More disk arms is also a big help, so much so
that I would take two IDE drives (assuming that they're fast modern
ones) over one SCSI drive any day.
You probably want to at least make sure that your log files and
data files are on separate disks.
> If you have the funds, look into getting a RAID card with a big cache on it.
> A RAID 1 or 5 also helps out if a disk crashes.
A RAID 5 will slow down write performance considerably, but the
added reliability might be worth the tradeoff. But mirroring is
better, if you can afford it. Almost certainly you want your log
file on a mirrored volume rather than on a RAID 5 volume.
As far as a "big cache" goes, well, see above. Also note that if
your OS caches blocks in system RAM, you will: a) have two caches
in series, which is a bit of a waste, and b) n MB of cache on a
raid controller will often be more expensive than the same amount
as system RAM.
> > Is PostgreSQL even the best database engine for this app? Perhaps MySQL? Or
> > maybe a Microsoft solution?
>
> MySQL is traditionally faster at pumping out web pages with pure speed, but
> PostgreSQL has been catching up very quickly. Also, PostgreSQL has
> traditionally been able to handle many more concurrent users, but I think
> MySQL has been getting better there, too. I haven't seen any banchmarks
> with recent versions of either database. They're both free, so try some
> tests with both of them (but don't forget to tune them properly).
For this simple application, I'd say MySQL is likely to be a bit
faster, simply because the database will be smaller. (MySQL has
considerably less row overhead.) However, the speed difference is
not likely to be too great, and certain other things might make
MySQL even worse.
> If you care anything about cost or flexibility, I wouldn't go for a
> Microsoft "solution".
Au contraire, MS SQL Server is cheap (compared to other commerical
products) and is a pretty good database. I would happily use it
again. But the fact that it runs under Windows only makes administration
a pain, and "cheap" in the commerical world is still a heck of a
lot more expensive than "free."
However, given the size of your project, and what you're looking
at spending, I can't see MS SQL Server or other products in that
class being worthwhile. An SQL Server installation is typically a
$10,000-$50,000 kind of thing. (You can do it for a lot less, but
most such products that can get by with such small installations
would probably be just as well off with PostgreSQL.)
cjs
--
Curt Sampson <cjs@cynic.net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Hardware needed for 15,000,000 record DB?
@ 2002-04-23 17:22 Jeremy Buchmann <jeremy@wellsgaming.com>
parent: Curt Sampson <cjs@cynic.net>
0 siblings, 1 reply; 10+ messages in thread
From: Jeremy Buchmann @ 2002-04-23 17:22 UTC (permalink / raw)
To: Curt Sampson <cjs@cynic.net>; +Cc: pgsql-admin
Curt Sampson wrote:
> On Mon, 22 Apr 2002, Jeremy Buchmann wrote:
>
>>You minimize the amount of time the I/O takes by using fast
>>storage devices.
>>This means SCSI.
>
>
> Not necessarially. More disk arms is also a big help, so much so
> that I would take two IDE drives (assuming that they're fast modern
> ones) over one SCSI drive any day.
SCSI also has several other advantages...it doesn't suck up all your
CPU time when there's a lot of disk activity, and it supports
command queueing. IDE was designed to be cheap, SCSI was designed to
be good. I've used both and from my experience, SCSI is The Way.
--Jeremy
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Hardware needed for 15,000,000 record DB?
@ 2002-04-23 17:44 David Gilbert <dgilbert@velocet.ca>
parent: Jeremy Buchmann <jeremy@wellsgaming.com>
0 siblings, 2 replies; 10+ messages in thread
From: David Gilbert @ 2002-04-23 17:44 UTC (permalink / raw)
To: Jeremy Buchmann <jeremy@wellsgaming.com>; +Cc: Curt Sampson <cjs@cynic.net>; pgsql-admin
>>>>> "Jeremy" == Jeremy Buchmann <jeremy@wellsgaming.com> writes:
Jeremy> Curt Sampson wrote:
>> On Mon, 22 Apr 2002, Jeremy Buchmann wrote:
>>
>>> You minimize the amount of time the I/O takes by using fast
>>> storage devices. This means SCSI.
>>
>>
>> Not necessarially. More disk arms is also a big help, so much so
>> that I would take two IDE drives (assuming that they're fast modern
>> ones) over one SCSI drive any day.
Jeremy> SCSI also has several other advantages...it doesn't suck up
Jeremy> all your CPU time when there's a lot of disk activity, and it
Jeremy> supports command queueing. IDE was designed to be cheap, SCSI
Jeremy> was designed to be good. I've used both and from my
Jeremy> experience, SCSI is The Way.
Well... I wouldn't phrase the problem that 1-dimensionally. There are
IDE drives that support queueing (IBM Deskstar something-or-other) and
some OSs have ATA controller code that really kicks but (FreeBSD, for
instance), so from a software point of view, IDE can work well.
It's even likely that the maufacturing process is nearly identical for
some makes and models.
But the RMA rates for _extreme_ usage don't match. My theory:
I find that IDE drives placed in situations where their request queue
is populated completely for days at a time will fail between 3 and 6
months where SCSI drives can last years in this condition. Pay
attention to the qualification: we're talking not even a milisecond of
unused time for at least hours on end out of a day.
I believe this is due to the SCSI disk having software that will
momentarily stop processing requests to perform a recalibration
... where IDE drives may only do this when they are idle for some
small period of time.
Dave.
--
============================================================================
|David Gilbert, Velocet Communications. | Two things can only be |
|Mail: dgilbert@velocet.net | equal if and only if they |
|http://daveg.ca | are precisely opposite. |
=========================================================GLO================
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Hardware needed for 15,000,000 record DB?
@ 2002-04-23 23:18 Ragnar Kjørstad <postgres@ragnark.vestdata.no>
parent: David Gilbert <dgilbert@velocet.ca>
1 sibling, 0 replies; 10+ messages in thread
From: Ragnar Kjørstad @ 2002-04-23 23:18 UTC (permalink / raw)
To: David Gilbert <dgilbert@velocet.ca>; +Cc: Jeremy Buchmann <jeremy@wellsgaming.com>; Curt Sampson <cjs@cynic.net>; pgsql-admin
On Tue, Apr 23, 2002 at 01:44:40PM -0400, David Gilbert wrote:
> I believe this is due to the SCSI disk having software that will
> momentarily stop processing requests to perform a recalibration
> ... where IDE drives may only do this when they are idle for some
> small period of time.
Another reason is that IDE drives often have higher densities. A 160 GB
SCSI disk have a lot of plates (8?), while IDE drives with the same
capacity typicly have only one or two. It basicly means that the disk is
more sensitive to errors.
(Numbers above may not be correct for all IDE and SCSI-disks, they are
just meant as an illustration)
This, like many other IDE/SCSI issues is not a IDE-problem per-say -
it's just (like it was written earlier in the thread) that SCSI-disks
are typicly designed for servers, while IDE disks are typicly designed
for workstations.
--
Ragnar Kjørstad
Big Storage
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Hardware needed for 15,000,000 record DB?
@ 2002-04-25 16:57 Mike Castle <dalgoda@ix.netcom.com>
parent: David Gilbert <dgilbert@velocet.ca>
1 sibling, 0 replies; 10+ messages in thread
From: dalgoda@ix.netcom.com @ 2002-04-25 16:57 UTC (permalink / raw)
To: pgsql-admin
In article <15557.40328.672259.475024@trooper.velocet.net>,
David Gilbert <dgilbert@velocet.ca> wrote:
>IDE drives that support queueing (IBM Deskstar something-or-other) and
Aren't these the same drives that are dying left and right?
mrc
--
Mike Castle dalgoda@ix.netcom.com www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2002-04-25 16:57 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-04-21 23:25 Hardware needed for 15,000,000 record DB? pdg@stratos.net
2002-04-22 06:29 ` Mathieu Arnold <mat@mat.cc>
2002-04-22 07:41 ` pdg@stratos.net
2002-04-22 07:58 ` Mathieu Arnold <mat@mat.cc>
2002-04-22 22:17 ` Jeremy Buchmann <jeremy@wellsgaming.com>
2002-04-23 02:34 ` Curt Sampson <cjs@cynic.net>
2002-04-23 17:22 ` Jeremy Buchmann <jeremy@wellsgaming.com>
2002-04-23 17:44 ` David Gilbert <dgilbert@velocet.ca>
2002-04-23 23:18 ` Ragnar Kjørstad <postgres@ragnark.vestdata.no>
2002-04-25 16:57 ` Mike Castle <dalgoda@ix.netcom.com>
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