Link to home
Start Free TrialLog in
Avatar of undy30
undy30

asked on

Server Performance Question

Sorry for posting this question here. It belongs in hardware I know, but I've posted there and they just cleanup spyware and deal with overclockning it seems. This is totally server based. And you sever gurus know hardware as well as the software i'm sure. So I apologize in advance.

My webserver seems to go slow. I want to do the most economical boost in performance.

I do a lot of server sided scripting. I host 5 sites, about 6000 pages, most dynamic with php scripting and mysql.
This is my entire setup.

3meg cable line (residential..I know) into a windows 2003 server. That server is my router/firewall/mysql server.
from there it goes to a cisco switch, which has my PCs and my webserver.
Win2k3 server is fairly good. 2.8GHz, 512mb, good enough for routing I'd say.
Plain cat5e for everything.
10/100mb nic in everything.

Webserver is a bit older.
Compaq Deskpro. 350mhz. 256mb ram. Pentium II I think. Original 6gb hard drive, single drive.
Webpages are slow to load, especially php ones. And if I try to browse my internal network it is fairly slow.
Linux, debian, apache, php. All command line.

So what would be the best upgrade? My network connection is obvious, but thats expensive for anything higher.

Would a better CPU orRam do it better? Or is it probably harddrive access, get a raid formation with atleast 7200rpm drives?

At work, large expensive servers, I can browse network shares like it's local folders. I would like something similar to that for the local network. And something to boost up my website loading times for external people as well.

Any suggestions? I can give lots more info.
Avatar of ahoffmann
ahoffmann
Flag of Germany image

if your low on money upgrade from 265mb to 512 or 1gb, stop all services you don't need, then check performance again

another option:
 switch hardware for router and web server, then move mysql to the web server machine too
 (256mb for routing and firewal is sufficient)

Avatar of undy30
undy30

ASKER

I was considering the switch. But then I'd have to reinstall both OS's. Windows 2k3 won't transfer over and I've never done it with linux so I probably will just reinstall.

I dont want to upgrade memory if it isn't needed.
What, with server-sided scripting, is the main resource hog? CPU, Memory, or HDD access time/data transfer. I was leaning towards hard drives because they are the slowest thing on a computer usually (except the user in most cases).
I guess that you php is the main problem. Did you enshure that it is mod_php and not CGI?
Avatar of undy30

ASKER

i don't know that much about it. or what to ensure what is mod_php or cgi.

If you mean the modules I load in the apache httpd.conf file then I do have:
AddModule mod_php4.c

as a line.

Also:
LoadModule php4_module        libexec/libphp4.so


The only references to CGI is:

<Directory />^M
    Options FollowSymLinks +ExecCGI^M
    AllowOverride None^M
</Directory>^M

    ScriptAlias /cgi-bin/ "/var/backhand/cgi-bin/"

    <Directory "/var/backhand/cgi-bin">^M
        AllowOverride None^M
        Options None^M
        Order allow,deny^M
        Allow from all^M
    </Directory>^


AddHandler cgi-script .cgi .pl


AddModule mod_cgi.c

Are these CGI calls in my httpd.conf file making PHP files load slower?

Which are safe to delete if so?
I meant if your .php pages are called as CGI, doesn't look like according your posted config
You may use ps ax  to see if there're php running, that should not be when mod_php is in use.
Avatar of undy30

ASKER

Everything is located in /var/backhand in regards to webpages.
Bin has the httpd file and apachetc1 file.
Htdocs has webpages
Conf has configs.


  PID   TTY   STAT  TIME COMMAND
    1  ?      S    0:06 init [2]
    3  ?      SW   0:08 [kupdate]
    4  ?      SW   0:00 [kswapd]
   45  ?      SW   0:00 [khubd]
  121  ?      S    0:00 /sbin/dhclient-2.2.x -q eth0
  190  ?      S    0:01 /sbin/syslogd
  193  ?      S    0:00 /sbin/klogd
  203  ?      S    0:00 /usr/sbin/inetd
  219  ?      S    0:08 /usr/sbin/nmbd -D
  221  ?      S    0:03 /usr/sbin/smbd -D
  233  ?      S    0:00 /usr/sbin/cron
  241   1     S    0:00 /sbin/getty 38400 tty1
  242   2     S    0:00 /sbin/getty 38400 tty2
  243   3     S    0:00 /sbin/getty 38400 tty3
  244   4     S    0:00 /sbin/getty 38400 tty4
  245   5     S    0:00 /sbin/getty 38400 tty5
  246   6     S    0:00 /sbin/getty 38400 tty6
  658  ?      S    0:00 /var/backhand/bin/httpd
16778  ?      S    0:00 /usr/sbin/pptpd
20506  ?      S    0:00 /usr/sbin/lpd
20899  ?      S    0:00 ps ax
  125  ?      S    0:00 /sbin/portmap
  230  ?      S    0:00 /usr/sbin/atd
  263  ?      S    0:00 /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/
  265  ?      S    0:00 /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/
  266  ?      S    0:00 /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/
  659  ?      S  228:31 /var/backhand/bin/httpd
  660  ?      S    0:06 /var/backhand/bin/httpd
  661  ?      S    0:03 /var/backhand/bin/httpd
  662  ?      S    0:22 /var/backhand/bin/httpd
  663  ?      S    0:26 /var/backhand/bin/httpd
  664  ?      S    1:00 /var/backhand/bin/httpd
  665  ?      S    0:50 /var/backhand/bin/httpd
  666  ?      S    1:03 /var/backhand/bin/httpd
  667  ?      S    1:16 /var/backhand/bin/httpd
  668  ?      S    1:13 /var/backhand/bin/httpd
  669  ?      S    0:48 /var/backhand/bin/httpd
check with top which process(es) are consuming time and/or memory
Avatar of undy30

ASKER

 PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
  659 nobody     7   0  2344 2344  2012 S     0.9  0.9 228:48 httpd
20938 root      13   0   944  944   748 R     0.9  0.3   0:00 top
20927 root       1   0  1988 1988  1708 S     0.3  0.7   0:03 sshd
    1 root       0   0   488  488   424 S     0.0  0.1   0:06 init
    2 root       0   0     0    0     0 SW    0.0  0.0   0:00 kflushd
    3 root       0   0     0    0     0 SW    0.0  0.0   0:08 kupdate
    4 root       0   0     0    0     0 SW    0.0  0.0   0:00 kswapd
    5 root       0   0     0    0     0 SW    0.0  0.0   0:00 keventd
   45 root       0   0     0    0     0 SW    0.0  0.0   0:00 khubd
  121 root       0   0   844  844   708 S     0.0  0.3   0:00 dhclient-2.2.x
  125 daemon     0   0   416  416   344 S     0.0  0.1   0:00 portmap
  190 root       0   0   792  792   664 S     0.0  0.3   0:01 syslogd
  193 root       0   0   904  904   408 S     0.0  0.3   0:00 klogd
  203 root       0   0   700  700   624 S     0.0  0.2   0:00 inetd
  219 root       0   0  1280 1280   820 S     0.0  0.4   0:08 nmbd
  221 root       0   0  1256 1256  1068 S     0.0  0.4   0:03 smbd
  227 root       0   0  1212 1212  1076 S     0.0  0.4   0:00 sshd
  230 daemon     0   0   584  584   504 S     0.0  0.2   0:00 atd
  233 root       0   0   684  684   564 S     0.0  0.2   0:00 cron
  237 root       0   0  1084 1084   896 S     0.0  0.4   0:00 safe_mysqld
  241 root       0   0   468  468   408 S     0.0  0.1   0:00 getty
  242 root       0   0   468  468   408 S     0.0  0.1   0:00 getty
  243 root       0   0   468  468   408 S     0.0  0.1   0:00 getty
  244 root       0   0   468  468   408 S     0.0  0.1   0:00 getty
  245 root       0   0   468  468   408 S     0.0  0.1   0:00 getty
  246 root       0   0   468  468   408 S     0.0  0.1   0:00 getty
  263 mysql      0   0  1116 1116   788 S     0.0  0.4   0:00 mysqld
  265 mysql      0   0  1116 1116   788 S     0.0  0.4   0:00 mysqld
  266 mysql      0   0  1116 1116   788 S     0.0  0.4   0:00 mysqld
  658 root       0   0  2120 2120  2032 S     0.0  0.8   0:00 httpd
  660 nobody     0   0  4192 4192  2600 S     0.0  1.6   0:06 httpd
  661 nobody     0   0  4256 4256  2608 S     0.0  1.6   0:03 httpd
  662 nobody     0   0  4532 4532  2668 S     0.0  1.7   0:22 httpd
  663 nobody     0   0  5088 5088  2668 S     0.0  1.9   0:27 httpd
  664 nobody     0   0  5220 5220  2700 S     0.0  2.0   1:01 httpd
  665 nobody     0   0  5088 5088  2672 S     0.0  1.9   0:50 httpd
nothing suspicious, what exactly is your problem (except PHP)?
Avatar of undy30

ASKER

I thought this was clear but it's more hardware.

What is the major thing needed for a fast websever, doing mainly php serving.

cpu
memory
fast hard drive
raid

or anything else. network can't be upgraded because it's much too expensive.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of undy30

ASKER

I really thought hard drive would make a large difference. Since I have a windows 2003 file server with a good cpu and lots of memory but browsing a network or serving files takes a very long time as well.

And the top command showed the cpu/memory were less than 1%.
But you're the expert.
> Since I have a windows 2003 file server ...
sorry, not an expert for that, useless attempt ...

with cpu+memory I meant the linux one 'cause Linux caches as much as possible in memory (you don't need to configure that;-)
Avatar of undy30

ASKER

Really?
Interesting, I never knew that.
Maybe I'll save up for a gig of ram and a P4 2.8Ghz CPU instead of the fast SCSI drives then huh?
Should be enough for an entry level webserver.
Probably will get a new hard drive, just a basic IDE 7200RPM, raided for redundancy. Since the drive I'm using now, 24x7 operation, is about 10 years old.

Thanks alot for the info.
> 10 years old ..
not that bad ;-)
good luck