[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linuxperf] Re: FW: "high performance web server"
From the apache development mailing list.
Perhaps there's something there for
http://www.nl.linux.org/linuxperf/
- Dan
Randy Terbush wrote:
>
> Would someone like to see if there is anything that is not in our high
> performance tuning pages?
>
> -----Original Message-----
> From: Pete Vogel - Systems Administration [mailto:root@vvd.com]
> Sent: Friday, May 21, 1999 4:56 AM
> To: apache@apache.org
> Subject: "high performance web server"
>
> Hi.
>
> I just noticed that you guys didn't have any significant
> information regarding performance tuning Linux to be a high
> performance
> web server.
>
> Until the last year, I couldn't honestly say I've run anything
> substantial, but recently I've gotten some practice in.. :)
>
> I administer several adult sites, including Voyeurweb.com,
> RedClouds.com, and Watchcams.com.
>
> Today, Voyeurweb.com and Redclouds.com by themselves are taking
> just over 60Mb/s (almost 1 1/2 T3's {grin}).. Those sites are served
> from
> 10 Linux machines. In all reality, it's 9 machines. The 10th one
> only
> handles banner rotation, and a couple other little CGI's... Previous
> to
> their current encarnation, the site was run from 2 Linux, 2 BSDI, and
> 1
> Sun machine. I was only responsbile for the Linux machine, the
> other's
> were someone elses problem.
>
> In any case, my machines see no less than 2 million requests/day,
> according to the /server-status .. I absolutely *LOVE* apache, and
> love
> the way it works on Linux.. I was given open choice to what OS and
> server
> to run every time a new project comes up, and I always choose Linux
> and
> Apache..
>
> So, enough ass-kissing.. :) I thought you might want to share
> some of this information with other Apache users, so they can make the
> most of their machines.. That, and I'd love to see something I wrote
> distributed before the masses... :)
>
> I don't take credit for everything. It's all pretty easy, and I
> stole a bit from posting in newsgroups (praise DejaNews!)... Hell, I
> barely claim to be a programmer.. I just get *real* lucky.. :)
>
> ----------------------------------------------------------------
>
> Kernel mods. It helps keep the machine happy if it isn't limited
> in it's resources... I always suggest using the newest available (and
> stable) kernel..
>
> Also, remember to make a *GOOD* kernel... Get rid of the
> unnecessary drivers, and add the good options.. I needed an UDMA
> patch
> for my motherboard, to use the full performance of the IDE drives..
> (Yes,
> 2 million requests/day on IDE drives)
>
> ---------- Linux 2.0.35 kernel changes --------------------------
>
> These notes pertain to Linux 2.0.35. Comparable changes
> should apply to future versions...
> (works in 2.0.36)
>
> /usr/src/linux/
>
> include/linux/fs.h
> Change NR_OPEN from 256 to 1024
> Change NR_INODE from 3072 to 16383
> Change NR_FILE from 1024 to 4096
>
> include/linux/limits.h
> Change NR_OPEN from 256 to 1024
> Change OPEN_MAX from 256 to 1024
>
> include/linux/tasks.h
> Change NR_TASKS rom 512 to 2048
> Change MIN_TASKS_LEFT_FOR_ROOT 24
>
> For multiprocessors:
>
> Makefile
> Uncomment line "SMP = 1" and "SMP_PROF = 1"
>
> ---------- End Linux kernel changes -------------------------------
>
> ---------- Linux 2.2.5 kernel changes -----------------------------
> (works in 2.2.9)
>
> /usr/src/linux
>
> include/linux/tasks.h
> Change NR_TASKS from 512 to 3072
> Change MIN_TASKS_LEFT_FOR_ROOT from 4 to 24
>
> ---------- End Linux kernel changes -------------------------------
>
> (mental note: /usr/bin/top doesn't work quite right with over 1024
> tasks
> running simultanious.. Don't panic. {grin})
>
> ---------- Apache changes -------------------------------
> /usr/src/apache/src/include/httpd.h
>
> Change HARD_SERVER_LIMIT from 256 to 1024
>
> ---------------------------------------------------------
>
> So you guys know, I wrote a little program to open ports, and
> request files as fast as possible.. I successfully ran through 1500
> simultanious connections without failure.. I stopped because I ran
> out of
> memory..
>
> For reference, the hardware in these machines resemble:
>
> Asus P5A-B
> AMD K6/2 450
> 256MB RAM
> WD UDMA hard drive
>
> And software?
> Slackware Linux 4.0 (upgraded to 2.2.9 kernel)
> Apache 1.3.6
>
> No other significant mods.. Hmmm.. Actually, no other mods.. :)
> Remember, these are web servers, not anything else, so I killed
> *EVERYTHING* that didn't need to be running.. I have sshd and httpd
> running, and then all the little system things..
>
> Oh.. This might help. Here's my httpd.conf. It could probably
> use some help, but it's pretty good as is...
>
> ------- httpd.conf ---- (combined file)
>
> #
> # Igormania httpd configuration
> # (c) Igormania, 1999
> # 4/16/1999 - pv
> #
> #
> ### Machine Specific settings
> #Listen 207.239.93.191
> #NameVirtualHost 207.239.93.191
> ServerName voy01.voyeurweb.com
>
> ### Section 1: Global Environment
> #
> ServerType standalone
> ServerRoot "/host/httpd"
> LockFile logs/accept.lock
> PidFile logs/httpd.pid
> ScoreBoardFile logs/apache_runtime_status
> ResourceConfig /dev/null
> AccessConfig /dev/null
> Timeout 20
> KeepAlive Off
> MaxKeepAliveRequests 64
> KeepAliveTimeout 10
> MinSpareServers 100
> MaxSpareServers 200
> StartServers 150
> MaxClients 750
> MaxRequestsPerChild 15
> #BindAddress *
> ExtendedStatus On
>
> #
> # Igormania httpd configuration
> # (c) Igormania, 1999
> # 4/16/1999 - pv
> #
> #
> ### Machine Specific settings
> #Listen 207.239.93.191
> #NameVirtualHost 207.239.93.191
> ServerName voy01.voyeurweb.com
>
> ### Section 1: Global Environment
> #
> ServerType standalone
> ServerRoot "/host/httpd"
> LockFile logs/accept.lock
> PidFile logs/httpd.pid
> ScoreBoardFile logs/apache_runtime_status
> ResourceConfig /dev/null
> AccessConfig /dev/null
> Timeout 20
> KeepAlive Off
> MaxKeepAliveRequests 64
> KeepAliveTimeout 10
> MinSpareServers 100
> MaxSpareServers 200
> StartServers 150
> MaxClients 750
> MaxRequestsPerChild 15
> #BindAddress *
> ExtendedStatus On
>
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> </Directory>
>
> <Directory "/host/users/">
> Options All
> AllowOverride All
> Order allow,deny
> Allow from all
> </Directory>
>
> <Files .htaccess>
> Order allow,deny
> Deny from all
> </Files>
>
> <Directory "/host/httpd/icons">
> Options Indexes MultiViews
> AllowOverride None
> Order allow,deny
> Allow from all
> </Directory>
>
> <Directory "/host/httpd/cgi-bin">
> AllowOverride None
> Options None
> Order allow,deny
> Allow from all
> </Directory>
>
> <Location /server-status>
> SetHandler server-status
> Order deny,allow
> Deny from all
> Allow from xxx.xxx.xxx.
> </Location>
>
> <Location /server-info>
> SetHandler server-info
> Order deny,allow
> Deny from all
> Allow from xxx.xxx.xxx.
> </Location>
>
> IndexOptions FancyIndexing
> AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
> AddIconByType (TXT,/icons/text.gif) text/*
> AddIconByType (IMG,/icons/image2.gif) image/*
> AddIconByType (SND,/icons/sound2.gif) audio/*
> AddIconByType (VID,/icons/movie.gif) video/*
> AddIcon /icons/binary.gif .bin .exe
> AddIcon /icons/binhex.gif .hqx
> AddIcon /icons/tar.gif .tar
> AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
> AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
> AddIcon /icons/a.gif .ps .ai .eps
> AddIcon /icons/layout.gif .html .shtml .htm .pdf
> AddIcon /icons/text.gif .txt
> AddIcon /icons/c.gif .c
> AddIcon /icons/p.gif .pl .py
> AddIcon /icons/f.gif .for
> AddIcon /icons/dvi.gif .dvi
> AddIcon /icons/uuencoded.gif .uu
> AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
> AddIcon /icons/tex.gif .tex
> AddIcon /icons/bomb.gif core
> AddIcon /icons/back.gif ..
> AddIcon /icons/hand.right.gif README
> AddIcon /icons/folder.gif ^^DIRECTORY^^
> AddIcon /icons/blank.gif ^^BLANKICON^^
> DefaultIcon /icons/unknown.gif
> #AddDescription "GZIP compressed document" .gz
> #AddDescription "tar archive" .tar
> #AddDescription "GZIP compressed tar archive" .tgz
> ReadmeName README
> HeaderName HEADER
> IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
> AddEncoding x-compress Z
> AddEncoding x-gzip gz
> AddLanguage en .en
> AddLanguage fr .fr
> AddLanguage de .de
> AddLanguage da .da
> AddLanguage el .el
> AddLanguage it .it
> LanguagePriority en fr de
> #AddType application/x-httpd-php3 .php3
> #AddType application/x-httpd-php3-source .phps
> AddHandler cgi-script .cgi
> AddType text/html .shtml
> AddHandler server-parsed .shtml
> ErrorDocument 404 /missing.html
> BrowserMatch "Mozilla/2" nokeepalive
> BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0
> force-response-1.0
> BrowserMatch "RealPlayer 4\.0" force-response-1.0
> BrowserMatch "Java/1\.0" force-response-1.0
> BrowserMatch "JDK/1\.0" force-response-1.0
>
> ### Section 3: Virtual Hosts
> <VirtualHost xxx.xxx.xxx.xxx>
> ServerAdmin webmaster@xxxxxxxxxx.xxx
> DocumentRoot /host/users/www.xxxxxxxxxx/
> ScriptAlias /cgi-bin/ "/host/users/www.xxxxxxxxxx/cgi-bin/"
> ServerName www.xxxxxxxxxx.com
> </VirtualHost>
>
> ----- end httpd.conf
>
> So, what's all that get me? Some pretty high traffic machines..
> :) From what I understand, adult web sites do more traffic than
> mainstream sites.. And we're one of the highest trafficed adult sites
> in
> the world... Have a look at our site sometime, and consider how fast
> it
> really is, with this much traffic... :)
>
> --- begin server status
> Apache Server Status for xxxxx.xxxxxxxxxx.xxx
>
> Server Version: Apache/1.3.6 (Unix)
> Server Built: Apr 17 1999 06:36:05
>
> Current Time: Friday, 21-May-1999 05:29:22 EDT
> Restart Time: Wednesday, 19-May-1999 16:47:39 EDT
> Parent Server Generation: 0
> Server uptime: 1 day 12 hours 41 minutes 43 seconds
> Total accesses: 5638485 - Total Traffic: 81.4 GB
> CPU Usage: u3.54 s31.84 cu0 cs0 - .0268% CPU load
> 42.7 requests/sec - 0.6 MB/second - 15.1 kB/request
> 35 requests currently being processed, 113 idle servers
> --- end server status
>
> Something very odd. Maybe a bug with server-status, or maybe an
> improvement in Apache? I'm still telling everyone that it's because
> we're
> running better software on better hardware than ever before. :) The
> "requests currently being processed" was *ALWAYS* between 500 and 1000
> on
> the old machines (running BSDI2.1 and Apache 1.2.x or Linux 2.0.35 and
> Apache 1.3.x).. The same traffic is spread roughly the same (very
> roughly,
> but we won't talk about that), and now my requests are down under 100
> all
> the time.. I'm thinking it's because requests are being handled
> faster,
> but I'm not sure.. Any opinions? I don't think it's anything bad.
> The
> site loads faster than ever before, and HitBox (WebSideStory) reports
> more
> unique visitors than ever before..
>
> Anyways, I'd really love to see this information in the next
> release and/or up on your site.. I don't know how many people even
> read
> the documentation, but there are some of us who crawl all over it on
> occasion for that obscure bit of information.. I'm still trying to
> really
> understand the mod_rewrite. :) I haven't done documentation writing
> in
> quite a while, and didn't even attempt to format this.. If you put
> this
> up, you may want to remove references to what site it is. I tried to
> remember to take it out while I was writing this, but I probably
> missed
> pieces..
>
> Thanks for your time. You guys do a great job!
>
> Now I'm off to try to understand why mod_auth_dbm doesn't work
> right with gdbm, or why apache seg faults on the auth requests...
>
> Pete
> Systems Administration
> IgorMania
-
Linuxperf: Working list for the Linux Performance tuning site
Archive: http://mail.nl.linux.org/lists/
Web site: http://www.nl.linux.org/linuxperf/