Solved

Apache22

Posted on 2010-11-08
6
79 Views
Last Modified: 2016-02-10
Hello,

I'm using apache 2.2 with freeBSD. The problem is that the load of the servers are always above 3. I wonder if I can reduce this load, or at least know if my problem is hardware.

Thanks,

Armando
0
Comment
Question by:amsouza
6 Comments
 
LVL 11

Accepted Solution

by:
Pieter Jordaan earned 500 total points
Comment Utility
Hi

Are you talking about the system 'load average'?

FreeBSD has awesome built-in tools for system monitoring.

use the systat command to monitor the CPU load.

This will show you the other options available.
:help
ifstat and iostat is also helpfull to find bottlenecks.
to use them, type :ifstat or :iostat inside systat.

A good way to monitor your apache is to enable mod_status.
http://httpd.apache.org/docs/current/mod/mod_status.html

Then you can connect to your webserver and see the amount of active connections and apache load by using http://server.domain/server-status

Monitoring tools like xymon can use the apache mod_status to build graphs of the workers and load, which can draw a nice picture of your server usage over a period of time.

I hope that helps.
0
 
LVL 4

Expert Comment

by:frankcheong
Comment Utility
Before you can reduce the load, you have to have an idea on which program is generating the load and what kind of loading are you facing.

For you can use the top program to monitor which program consume most CPU and memory resources.
0
 
LVL 25

Expert Comment

by:madunix
Comment Utility
Root cause of high usage could be looping process, application performing cpu intensive operation(s), paging due to process size exceeding resident memory (RAM), excessive logging..etc.
On unix system run the commands "vmstat, top, iostat, free, sar"  to give you a top like display of memory totals, paging amount, swap numbers, interrupts per second and much more. they are useful to determine where the performance bottleneck is on a machine.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Expert Comment

by:ReN501
Comment Utility
mad unix is correct about the commands , as freebsd is damn good out of the box , the following command would probably give you the best chance to find out whats causing it "top" will tell you current memory/swap usage, also whcih processes are using the most resources, "netstat -na" tell you all current running processes, also a great one for bandwidth usage is "iftop" even get back to us with output of the above commands.
0
 
LVL 26

Expert Comment

by:skullnobrains
Comment Utility
i will assume apache is the cause of the load

- a load of 3 is not that high on machines with 4 CPUs or more
unless the site is really slow, and the top shows 0% idle time processor, you may not need to bother

- if the idle is not 0, the load is probably liked to weird connectivity or io shortage. use gstat to determine wether your disk is limiting or not. if it is, adding some ram to help the cache might be an idea, switching to a raid array might be as well (forget raid5, use zfs if you have 4G of RAM or more and your system is amd64, otherwise, stick to geom)

- if you have connectivity problems, i guess you already saw symptoms

- if you run modphp modperl modruby or whatever server-side scripting as an apache module, your script is probably the cause of the load. you probably want to check the site offline in order to findout which page is provoking the load.

- apache will perform better using both prefork and threading mixed together. the number of running processes should be about 2.5 the number of CPUs, but they may have many threads. obviously, if you do not need apache-specific features, try one of the fast webservers out there such as lighttpd

can't help more if you do not tell us more
0
 
LVL 26

Expert Comment

by:skullnobrains
Comment Utility
i just forgot to point out as this is obvious, but if your system swaps, forget about any of my or others comment and tune your soft or add ram to correct the problem. you should probably still have about 20 or 25% of the ram free during high loads
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now