LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to determine when my server is maxed out? (https://www.linuxquestions.org/questions/linux-general-1/how-to-determine-when-my-server-is-maxed-out-494932/)

sneakyimp 10-23-2006 03:47 PM

how to determine when my server is maxed out?
 
I have a website that's been running for about a year. We ironed out some of the last really annoying bugs this month and so we've seen steadily increasing traffic. I'm wondering if we might need to upgrade the server soon but don't really know how to tell.

How can I tell if my server is approaching its performance limits?

I know a few commands that can give us a hint.

There's 'w':
Code:

[root@mybox html]# w
 15:23:06  up 145 days,  3:46,  1 user,  load average: 0.22, 0.24, 0.30
USER    TTY      FROM              LOGIN@  IDLE  JCPU  PCPU  WHAT
root    pts/0    studiocity-motor  2:32pm  0.00s  0.11s  0.09s  -bash
[root@mybox html]#

and 'free':
Code:

[root@mybox html]# free
            total      used      free    shared    buffers    cached
Mem:        765520    740868      24652          0      92300    342252
-/+ buffers/cache:    306316    459204
Swap:      1052248      96352    955896

It's a fedora linux box with 2ghz celeron processor and 768 MB RAM running a LAMP stack. I was hoping to wire up a PHP script that can check the vitals - perhaps using 'w' - and email me if a critical level is reached. i'm not certain at all what a critical level might be.

trickykid 10-23-2006 04:12 PM

w literally tells you nothing about server performance.

free is kind of worthless to. It only tells you or displays current memory and process usage.

If you really want to test your server to see if it needs an upgrade, grab some benchmark tests for apache and possibly mysql. Also install some type of graphing tool (cacti.net or opennms.org) to record statistics over a period of days or weeks. This will give you details of peek performance times on the server and graph it's usage. I'd say if you just see a steady climb of services used, swap is used more often than it should, cpu usage and load is steady at higher than normal rates, then upgrade. Other than that, it's a web server and usually those can run on very minimal servers with no problems. It's not til you start getting some intensive requests that involve a database or what not that you may need to start thinking about upgrading.

sneakyimp 10-23-2006 04:22 PM

my site is *quite* database intensive and in some cases does some intense number crunching in php too.

the reason i was using 'w' is that it provides the 1/5/15 minute load average which does seem like a useful measurement of server load.

and i don't really know what it means to say that 'swap is used more often than it should'. my only indicator of how much it is used so far is 'free' which is why i was considering that too. i also don't know what a 'normal' rates is for my cpu.

i'll go check out those graphing tools but i am not sure that it will help me detect any bottlenecks. I already have a pretty good idea of traffic peaks from some webalizer graphs. i'd like to more specifically determine whether my server is overloaded at any time during the day - not just see graphs that only resolve detail by the hour.

trickykid 10-23-2006 05:52 PM

Quote:

Originally Posted by sneakyimp
the reason i was using 'w' is that it provides the 1/5/15 minute load average which does seem like a useful measurement of server load.

uptime does as well, so does top.

Quote:

Originally Posted by sneakyimp
and i don't really know what it means to say that 'swap is used more often than it should'. my only indicator of how much it is used so far is 'free' which is why i was considering that too. i also don't know what a 'normal' rates is for my cpu.

top mentioned before will show you both, free is a little more verbose though.

Quote:

Originally Posted by sneakyimp
i'll go check out those graphing tools but i am not sure that it will help me detect any bottlenecks. I already have a pretty good idea of traffic peaks from some webalizer graphs. i'd like to more specifically determine whether my server is overloaded at any time during the day - not just see graphs that only resolve detail by the hour.

Webalizer sucks and is only a traffic tool to see how many hits, visitors, etc you get on a website. A good graphing tool will give you output of not only traffic but CPU, Memory, Swap usage and so on during those times. It will graph it out and keep record. You can get 1,000 hits a day an never exceed a tremendous amount of resource usage.

I mentioned using these tools so you can determine when it's overloaded, how much it is and if it's enough to warrant a whole new server upgrade.

Also I mentioned getting some benchmark tests to run against the server so that will give you an idea of when things start breaking, unresponsive, etc. Put the tools together and see if they ever reach that mark when running the benchmarks, etc.

If it comes down to your server being more DB intensive, instead of piling all of your eggs in one basket, get an equally or more powerful server that will run the DB itself, then you can have both a WWW server and a Database server. The database being separate will keep take the load off the server so other applications not using the DB will remain normal, etc.


All times are GMT -5. The time now is 11:01 AM.