seperating SQL and application server?

2003-11-16 Thread Zhang Weiwu
Hello. I am running apache + php + mysql on an PIII 800MHz server. 
Phpgroupware webpages takes several seconds to show up on a LAN (15 
seconds at max). I mean each webpage takes several seconds to show up, 
even if I am the only user to access the server, and the server have no 
other works to do.

I wish to know what slowed it down. A static page is 10 times faster. I 
know phpgroupware is very complicated, and each page are displayed after 
complicated process, so is the CPU too slow? Or is it the I/O problem? 
Or should I put the SQL server on another box? What is likely to be the 
slowest part?

I have a very old Pentium 200 box (compaq deskpro, years old but very 
good quanlity), if I let it run mysql server for phpgroupware, would it 
bring up the speed or actually slow it down?

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: seperating SQL and application server?

2003-11-16 Thread Vahric MUHTARYAN
Could you see any bottleneck on CPU or I/0 at this slow response ?!! 
You can see it when you run wmstat for example 

freebsd# vmstat 10
 procs  memory  pagedisks faults
cpu
 r b w avmfre  flt  re  pi  po  fr  sr ad0 ac0   in   sy  cs us
sy id
 1 0 0   99428 141268   57   0   0   0  52   0   0   0  3350 264  0
2 97
 0 0 0   99428 1412680   0   0   0   0   0   0   0  3310 250  0
1 99
 0 0 0   99428 1412680   0   0   0   0   0   0   0  3330 253  0
2 98

You can watch CPU and Disk Bottlenecek ?! 

CPU and RAM is more important for PHP ?!  
And if you read too much from the disk I suggest use RAID1 or RAID10 

Vahric 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Zhang Weiwu
Sent: Sunday, November 16, 2003 3:25 PM
To: [EMAIL PROTECTED]
Subject: seperating SQL and application server?

Hello. I am running apache + php + mysql on an PIII 800MHz server. 
Phpgroupware webpages takes several seconds to show up on a LAN (15 
seconds at max). I mean each webpage takes several seconds to show up, 
even if I am the only user to access the server, and the server have no 
other works to do.

I wish to know what slowed it down. A static page is 10 times faster. I 
know phpgroupware is very complicated, and each page are displayed after

complicated process, so is the CPU too slow? Or is it the I/O problem? 
Or should I put the SQL server on another box? What is likely to be the 
slowest part?

I have a very old Pentium 200 box (compaq deskpro, years old but very 
good quanlity), if I let it run mysql server for phpgroupware, would it 
bring up the speed or actually slow it down?

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
[EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: seperating SQL and application server?

2003-11-16 Thread Ryan Thompson
Zhang Weiwu wrote to [EMAIL PROTECTED]:

 Hello. I am running apache + php + mysql on an PIII 800MHz server.
 Phpgroupware webpages takes several seconds to show up on a LAN (15
 seconds at max). I mean each webpage takes several seconds to show up,
 even if I am the only user to access the server, and the server have no
 other works to do.

 I wish to know what slowed it down. A static page is 10 times faster. I
 know phpgroupware is very complicated, and each page are displayed after
 complicated process, so is the CPU too slow? Or is it the I/O problem?
 Or should I put the SQL server on another box? What is likely to be the
 slowest part?

As others have mentioned, running vmstat is a good way to get some idea
of where the bottleneck is. Also, you didn't say anything about RAM;
some web applications eat RAM for breakfast, especially if they cause a
lot of memory-intensive SQL queries like cross products and big joins.
Run top -ores while making a few queries to the web site, and look for
big http memory images. Also, if you have a significant amount of swap
in use (i.e., more than 5%), that's a sign that the server has started
paging, and that can slow things down by orders of magnitude.

Make sure you're using mod_php instead of the standalone PHP CGI
executable. This will save RAM *and* give you incredible performance
gains, especially with respect to load time, and the benefits associated
with SQL connection and query caching, which I hope phpgroupware takes
advantage of.

If you learn nothing this way, and think phpgroupware might be the
problem itself, you might want to try some smaller examples of PHP and
profile those... turn off output buffering, and create a small PHP
application that writes incremental progress to the browser (or, write
timestamps to a local logfile, although this will add to the request
time and affect your results slightly), so you can see which components
of the application-layer processing take the most time. Then you can
work on optimizing.

 I have a very old Pentium 200 box (compaq deskpro, years old but very
 good quanlity), if I let it run mysql server for phpgroupware, would
 it bring up the speed or actually slow it down?

Separating MySQL and Apache is usually a good idea, but benefits usually
only appear when both are under some load.  I don't think load is your
issue, especially if the server can't handle one concurrent request in a
reasonable amount of time.

Hope this helps,
- Ryan

-- 
  Ryan Thompson [EMAIL PROTECTED]

  SaskNow Technologies - http://www.sasknow.com
  901-1st Avenue North - Saskatoon, SK - S7K 1Y4

Tel: 306-664-3600   Fax: 306-244-7037   Saskatoon
  Toll-Free: 877-727-5669 (877-SASKNOW) North America

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]