pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
run httpd and postgresql on different machines ?
4+ messages / 4 participants
[nested] [flat]

* run httpd and postgresql on different machines ?
@ 2005-01-18 13:36 Chuming Chen <chen@musc.edu>
  2005-01-18 14:33 ` Re: run httpd and postgresql on different machines ? Christian Fowler <spider@viovio.com>
  2005-01-18 15:44 ` Re: run httpd and postgresql on different machines ? Scott Marlowe <smarlowe@g2switchworks.com>
  2005-01-19 00:49 ` Re: run httpd and postgresql on different machines ? Ron Mayer <rm_pg@cheapcomplexdevices.com>
  0 siblings, 3 replies; 4+ messages in thread

From: Chuming Chen @ 2005-01-18 13:36 UTC (permalink / raw)
  To: pgsql-admin

Hi, all,

I want to set up a web site using apache httpd, php and postgresql. From 
the performance point of view, which  architecture is better? 1)  Run 
httpd and postgresql on the same machine; 2) Run postgresql on seperate 
machine. My concern is that the machine I am going to run httpd has 
limitted storage. I am expecting the increasing of postgresql database 
once I set it ip.

Any suggestions and comments will be highly appreciated.

-- 
Chuming Chen
System Administrator
NHLBI Proteomics Center
Medical University of South Carolina
135 Cannon Street, Suite 303
Charleston SC 29425
Tel: 843-792-1555 (O)
Fax: 843-876-1126





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: run httpd and postgresql on different machines ?
  2005-01-18 13:36 run httpd and postgresql on different machines ? Chuming Chen <chen@musc.edu>
@ 2005-01-18 14:33 ` Christian Fowler <spider@viovio.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Christian Fowler @ 2005-01-18 14:33 UTC (permalink / raw)
  To: Chuming Chen <chen@musc.edu>; +Cc: pgsql-admin


One machine to run httpd + php and a separate machine for postgres is very 
common and highly recommended.

For safety, I would recommend using a private network (192.168.0.*) to 
connect the two machines, so your DB machine does not even have a public 
IP address. Ideally, use gigabit between the two machines.

Be sure you configure your pg_hba.conf properly too.


On Tue, 18 Jan 2005, Chuming Chen wrote:

> Hi, all,
>
> I want to set up a web site using apache httpd, php and postgresql. From the 
> performance point of view, which  architecture is better? 1)  Run httpd and 
> postgresql on the same machine; 2) Run postgresql on seperate machine. My 
> concern is that the machine I am going to run httpd has limitted storage. I 
> am expecting the increasing of postgresql database once I set it ip.
>
> Any suggestions and comments will be highly appreciated.
>
> -- 
> Chuming Chen
> System Administrator
> NHLBI Proteomics Center
> Medical University of South Carolina
> 135 Cannon Street, Suite 303
> Charleston SC 29425
> Tel: 843-792-1555 (O)
> Fax: 843-876-1126
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>     joining column's datatypes do not match
>

[ \ /
[ >X<   Christian Fowler      | spider AT viovio.com
[ / \   http://www.viovio.com | http://www.tikipro.org



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: run httpd and postgresql on different machines ?
  2005-01-18 13:36 run httpd and postgresql on different machines ? Chuming Chen <chen@musc.edu>
@ 2005-01-18 15:44 ` Scott Marlowe <smarlowe@g2switchworks.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Scott Marlowe @ 2005-01-18 15:44 UTC (permalink / raw)
  To: chen@musc.edu; +Cc: pgsql-admin

On Tue, 2005-01-18 at 07:36, Chuming Chen wrote:
> Hi, all,
> 
> I want to set up a web site using apache httpd, php and postgresql. From 
> the performance point of view, which  architecture is better? 1)  Run 
> httpd and postgresql on the same machine; 2) Run postgresql on seperate 
> machine. My concern is that the machine I am going to run httpd has 
> limitted storage. I am expecting the increasing of postgresql database 
> once I set it ip.
> 
> Any suggestions and comments will be highly appreciated.

It really depends on whether apache/php and postgresql are going to be
fighting for the same resources.  apache/php tends to be CPU intensive,
while PostgreSQL tends to be I/O intensive.  It might be more economical
to simply upgrade the I/O subsystem on the one machine to be bigger and
faster than to build a whole other machine.

On the other hand, setting it up on two machines allows you to configure
each one as the other's fail over so you can improve your reliability
and performance.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: run httpd and postgresql on different machines ?
  2005-01-18 13:36 run httpd and postgresql on different machines ? Chuming Chen <chen@musc.edu>
@ 2005-01-19 00:49 ` Ron Mayer <rm_pg@cheapcomplexdevices.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Ron Mayer @ 2005-01-19 00:49 UTC (permalink / raw)
  To: Chuming Chen <chen@musc.edu>

Chuming Chen wrote:
> 
> I want to set up a web site using apache httpd, php and postgresql. From 
> the performance point of view, which  architecture is better? 1)  Run 
> httpd and postgresql on the same machine; 2) Run postgresql on seperate 
> machine. My concern is that the machine I am going to run httpd has 
> limitted storage. I am expecting the increasing of postgresql database 
> once I set it ip.

I had good luck with 4 very cheap (small, used, 1CPU, IDE disk)
machines running httpd/php/MONO-ASP.NET, and 1 more expensived
machine (with some internal failover capabilities - dual power
supplies, with a RAID array, with a support contract) running
postgresql.

The reasoning was one of cost/performance with the ability to
have likely-to-fail components fail with no downtime.

The cheapest way to scale the front-end machines with failover
capabilities was to use sub-$1000 slightly obsolete PCs.
The cheapest way I knew to provide limited scalability
and failover (at least for disk) for a database was a raid array.

With some of the newer replication features or pgpool, it might
be easier to scale "out" instead of "up"; but I have no experience
making that determination.

How about the rest of you guys....

If CPU demands in my database get to the point of needing 5-CPUs
with a read-mostly (90%) system, am I better off with
   1 lots of replication between small servers
  or
   2 scaling up a big server.

(the reason I'm CPU bound instead of disk bound is that many
of my queries are spatial operations with PostGIS like unions
and buffers of polygons).



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-01-19 00:49 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18 13:36 run httpd and postgresql on different machines ? Chuming Chen <chen@musc.edu>
2005-01-18 14:33 ` Christian Fowler <spider@viovio.com>
2005-01-18 15:44 ` Scott Marlowe <smarlowe@g2switchworks.com>
2005-01-19 00:49 ` Ron Mayer <rm_pg@cheapcomplexdevices.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