Re: how good is PostgreSQL

From: markw <markw(at)mohawksoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how good is PostgreSQL
Date: 2000-10-31 19:02:01
Message-ID: 39FF1729.9987A6BA@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Arnold Gamboa wrote:

> Hi,
>
> For users of large PostgreSQL and PostgreSQL builders, this is for you.
>
> I'm having a terrible time deciding now. :(
>
> We're about to build a "huge" website now. I got tied up in signing the
> contract without really getting enough information about PgSQL since this
> what we plan to implement with PHP (normally we use mySQL but i guess it
> does not fit for huge databases like that).
>
> Here's my problem.. We're about to build a site like hitbox.com where there
> is a large amount of database required.. If say there is 100,000 users with
> 1000 page hits per day for each, and everything will be logged, you could
> imagine how huge this will be. I'm just so "nervous" (really, that's the
> term) if we implement this and later on experience a slow down or worse than
> that, crash in the server.

That is a LOT of work for any system. That is over 1100 page views a second, or
under 900us each.. A standard Pentium III system, serving static pages would
have problems with that.

If you look at search engines, to get that performance with readonly data, they
usually cluster multiple systems and load balance across them. You may need to
segment your data and have multiple SQL servers perform different functions.

Also, that 1100 page view per second is assuming an even distribution of
traffic, which does not happen in a web server. If you average that much,
chances are there will be periods of twice that.

Look into a "local director," "Alteon," or even LVS.

>
>
> My questions are:
> 1. What is the limit for number of records in a table WITHOUT SUFFERING SLOW
> DOWN.

> 2. ....limit in number of tables per database
> 3. ... limit in number of database.

There are a couple factors involved, more complex than a simple response.

Use multiple databases and put each on a separate disk, with its own
controller. Better yet, have multiple load balanced web boxes do a lot of
processing in PHP and offload much of the CPU bound SQL work to the "cheap" web
boxes, and have multiple SQL databases in the back handling various independent
tasks.

In a web site I worked on, we had multiple front end web servers, load balanced
with an Alteon. Each web server had its own SQL database which provided SQL
access to "static" data which was updated each week. We had an additional
single SQL database backend which all the Web servers accessed for synchronized
dynamic data.

If you are serious about the load you expect to put on this system you must be
careful:
Do not create any indexes you do not need.
Do not use the "foreign key" constraint as it forces a trigger for each insert.

Make sure you index the keys by which you will access data.
Avoid searching by strings, try to use keys.

Even after that, you have a long way to go before you will hit 1000
transactions per second from any SQL database.

If you are betting your business on this implementation, you have a lot of
homework to do.

>
>
> Thanks for you comments. I would really appreciate every comment that I'll
> receive regarding this.
>
> Arnold

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message markw 2000-10-31 19:19:26 Re: True ACID under linux (no fsync)?
Previous Message Bernie Huang 2000-10-31 18:57:23 strange array insertion

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael J Schout 2000-10-31 19:16:09 7.0.2 crash (maybe linux kernel bug??)
Previous Message Lamar Owen 2000-10-31 16:37:50 Re: Re: [HACKERS] Re: [GENERAL] 7.0 vs. 7.1 (was: latest version?)