Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Apache hangs the machine with iowait - config help?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
Ravenium
n00b
n00b
Posts: 19
Joined: Mon Mar 22, 2004 4:53 pm

Apache hangs the machine with iowait - config help?

  • Quote

Post by Ravenium » Wed Sep 08, 2004 2:05 pm

Hello again,

I recently helped in setting up an ad content server for a gaming website. It's a fairly busy server (I have to prune the log about once a day or it fills to 2 gig, so it gets hit a bit). Luckily, the box is a hyperthreaded dual 2.8 xeon with 2 gigs of ram.

However, about once every few days, the box pretty much slows to a crawl/lock. All processors are shown with 1-2% active cpu, 70-90% iowait. Now, I'm positive that this is disk bound, and upon observations I saw that nearly all of the 2 gigs of swap was in use. Most of the resources seem to be used by httpd (apache 2.0.49), nearly 200-500 threads. Each proc/thread only takes 5-10 meg of mem/swap, but it of course adds up.

I have a distinct suspicion that one of my co-sysadmins has been toying with the apache config in a well-meaning effort to "speed up" the box, and it's having counterproductive results.

My question is this: What should I look for and/or be doing in terms of apache config to remedy this issue? Even if the ad content is slower, I'd rather have it as such than lock the box.

Any suggestions would be greatly appreciated!

-Barry
Top
adaptr
Watchman
Watchman
User avatar
Posts: 6730
Joined: Sun Oct 06, 2002 1:28 pm
Location: Rotterdam, Netherlands

  • Quote

Post by adaptr » Wed Sep 08, 2004 2:45 pm

Step 1: LART the person responsible - hard.
Step 2: stop apache
Step 3: copy the apache config
Step 4: re-instate the original (outofthebox) config and run it.

Now you can start comparing the MPM settings between the original config and the fecked up one.

Standard prefork settings are 5-10 servers, 150 threads per server, unlimited client requests per thread.
For a high-load server it may be wise to configure this, so each thread gets killed after, say, 10K requests.

That should stop those processes from running away with resources.

5MB of unique memory per process is way to much.
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Top
Ravenium
n00b
n00b
Posts: 19
Joined: Mon Mar 22, 2004 4:53 pm

  • Quote

Post by Ravenium » Wed Sep 08, 2004 7:34 pm

Well, so far, so good. No runaway Apache. I've pretty much reverted back to vanilla settings, minus setting threads to die after 10k requests (when in doubt, I figure try the proposed suggestion first!).

Now while responses are up, response time is rather sluggish. Apache's grabbing about 40-60% of active cpu (thankfully very little of this is iowait).

Is it a sign of the apocalypse, or have I missed something that I might end up LARTing myself over? (naaah...when in doubt, blame those who touched it before you)

-Barry
Top
adaptr
Watchman
Watchman
User avatar
Posts: 6730
Joined: Sun Oct 06, 2002 1:28 pm
Location: Rotterdam, Netherlands

  • Quote

Post by adaptr » Thu Sep 09, 2004 12:01 am

Well, you can run the apachebench program included with apache (called ab2 in apache 2) and simulate runs with exactly the conditions you want.

I'd strongly recommend you do that to get a "feel" for what exactly are the peak conditions for this particular server.
If you get any useful numbers out of it you can then either adjust or upgrade to suit.
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Top
Post Reply

4 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic