LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Measure load of ubuntu server (http://www.linuxquestions.org/questions/linux-general-1/measure-load-of-ubuntu-server-4175436916/)

Fajkowsky 11-13-2012 05:27 AM

Measure load of ubuntu server
 
I have Ubuntu server and apache2 installed on it. I want to benchmark it using ab tool from another machine. I want to know how measure load of this program. In top is showing this:

Code:

top - 06:02:19 up 3 min,  2 users,  load average: 0.28, 0.26, 0.12
Tasks:  94 total,  2 running,  92 sleeping,  0 stopped,  0 zombie
Cpu(s): 67.2%us,  5.5%sy,  0.0%ni, 26.3%id,  0.5%wa,  0.0%hi,  0.5%si,  0.0%st
Mem:    499320k total,  342028k used,  157292k free,    42504k buffers
Swap:  514044k total,        0k used,  514044k free,    71388k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1521 www-data  20  0 49180  22m 4144 S  23  4.6  0:00.68 apache2
 1520 www-data  20  0 49180  22m 4152 S  22  4.6  0:00.66 apache2
 1124 www-data  20  0 49180  22m 4152 S  22  4.6  0:00.70 apache2
 1519 www-data  20  0 49180  22m 4152 S  20  4.6  0:00.70 apache2
 1525 www-data  20  0 49180  22m 4144 S  16  4.6  0:00.47 apache2
 1123 www-data  20  0 49168  22m 4152 S    9  4.6  0:00.78 apache2
 1125 www-data  20  0 49168  22m 4152 S    9  4.6  0:00.77 apache2
 1126 www-data  20  0 49168  22m 4152 S    9  4.6  0:00.73 apache2
 1127 www-data  20  0 49168  22m 4152 S    9  4.6  0:00.74 apache2
 1523 www-data  20  0 42896  14m 3388 R    5  3.1  0:00.14 apache2
 1038 whoopsie  20  0 24476 3720 2856 S    0  0.7  0:00.01 whoopsie
 1089 root      20  0 34060 6988 3640 S    0  1.4  0:00.05 apache2
 1338 ubuntu    20  0  2832 1192  944 S    0  0.2  0:00.30 top
 1417 ubuntu    20  0  9652 1456  824 S    0  0.3  0:00.02 sshd
    1 root      20  0  3540 1876 1248 S    0  0.4  0:00.83 init
    2 root      20  0    0    0    0 S    0  0.0  0:00.00 kthreadd
    3 root      20  0    0    0    0 S    0  0.0  0:00.03 ksoftirqd/0
    4 root      20  0    0    0    0 S    0  0.0  0:00.00 kworker/0:0
    5 root      20  0    0    0    0 S    0  0.0  0:00.48 kworker/u:0
    6 root      RT  0    0    0    0 S    0  0.0  0:00.00 migration/0
    7 root      RT  0    0    0    0 S    0  0.0  0:00.00 watchdog/0
    8 root      RT  0    0    0    0 S    0  0.0  0:00.00 migration/1
    9 root      20  0    0    0    0 S    0  0.0  0:00.00 kworker/1:0
  10 root      20  0    0    0    0 S    0  0.0  0:00.01 ksoftirqd/1
  11 root      20  0    0    0    0 S    0  0.0  0:00.17 kworker/0:1
  12 root      RT  0    0    0    0 S    0  0.0  0:00.00 watchdog/1
  13 root      0 -20    0    0    0 S    0  0.0  0:00.00 cpuset
  14 root      0 -20    0    0    0 S    0  0.0  0:00.00 khelper
  15 root      20  0    0    0    0 S    0  0.0  0:00.00 kdevtmpfs
  16 root      0 -20    0    0    0 S    0  0.0  0:00.00 netns
  17 root      20  0    0    0    0 S    0  0.0  0:00.32 kworker/u:1
  18 root      20  0    0    0    0 S    0  0.0  0:00.00 sync_supers
  19 root      20  0    0    0    0 S    0  0.0  0:00.00 bdi-default
  20 root      0 -20    0    0    0 S    0  0.0  0:00.00 kintegrityd
  21 root      0 -20    0    0    0 S    0  0.0  0:00.00 kblockd
  22 root      0 -20    0    0    0 S    0  0.0  0:00.00 ata_sff
  23 root      20  0    0    0    0 S    0  0.0  0:00.00 khubd

So its difficult to do it without any script or program. How can I do this?

acid_kewpie 11-13-2012 06:19 AM

generally the load average value would be good enough: "load average: 0.28, 0.26, 0.12" this shows the 1m 5m and 15m load averages

Fajkowsky 11-13-2012 06:50 AM

But I want measure load only for specific time not all uptime of srver.

acid_kewpie 11-13-2012 07:01 AM

why is that a but? did you read my reply??

Fajkowsky 11-13-2012 12:39 PM

Thanks sorry I was reading in hurry. But this can't help me make charts.

Habitual 11-13-2012 01:33 PM

Quote:

Originally Posted by Fajkowsky (Post 4828307)
But I want measure load only for specific time not all uptime of srver.

sar is a tool that can do as you are asking. In the package sysstat.

NOTE: default install values only collect data every Ten Minutes for 7 days.
During that time, you can inspect the CPU Load for any 10 minute time period by issuing a
Code:

sar -f /var/log/sysstat/sann -q
where nn in /var/log/sysstat/sann above is one of the last 7 days log file.

Getting a "window" of CPU activity Report using sar on a system on the 5th between 3am and 5am is:
Code:

sar -f /var/log/sysstat/sa05 -q -s 03:00:00 -e 05:00:00
and spits out
Code:

Linux 2.6.31-302-ec2 (mysql12)    11/05/2012    _x86_64_    (8 CPU)

03:05:01 AM  runq-sz  plist-sz  ldavg-1  ldavg-5  ldavg-15  blocked
03:15:01 AM        24      318    12.86    15.39    15.03        0
03:25:01 AM        7      274      7.25      7.13    11.13        0
03:35:01 AM        20      274      3.34      5.17      8.33        0
03:45:01 AM        5      282      2.67      3.55      6.00        0
03:55:01 AM        8      278      0.32      0.92      3.50        0
04:05:01 AM        4      281      0.25      0.41      2.04        0
04:15:01 AM        4      280      0.89      3.69      3.44        0
04:25:01 AM        26      307    10.98      7.64      5.06        0
04:35:01 AM        27      317      5.85      8.40      7.18        0
04:45:01 AM        3      268      1.87      3.82      5.43        1
04:55:01 AM        15      296      1.83      3.01      4.35        0
Average:          13      289      4.37      5.38      6.50        0

Code:

sudo apt-get install sysstat
I documented some of the various switches that seemed important for Reports here...

I hope that is helpful,

JJ

NOTE0:
Code:

Package isag - Interactive System Activity Grapher for sysstat

acid_kewpie 11-13-2012 04:27 PM

Quote:

Originally Posted by Fajkowsky (Post 4828571)
Thanks sorry I was reading in hurry. But this can't help me make charts.

If you wanted to chart it, why didn't you say so? It certainly CAN help you chart things, but depends on what other tools or frameworks you're working within.

markseger 11-17-2012 06:29 AM

benchmark is in interesting term as it can mean a lot of things to a lot of people.

as previously mentioned loadavg can produce interesting numbers but if you don't really understand what it's telling you it can be more misleading than anything else. I first found this when it was reporting a load of over 80 on a perfectly normal running nfs server.

sar can be helpful but not at a 10 minute interval. personally I think to get an accurate picture of what an application is doing to your system you want to look at everything from cpu, to disk, to memory to network and perhaps other things as well like the number of sockets in use, files open, etc... probably plot them over a reasonable period of time. then you run your application (whatever that means) for some period of time and take measurements and plot them again to compare the two. Also, if the application does some sort of transaction processing, or reading/processig of data, etc, of course you want to load it and see where it falls over. this can all be very complex.

of course I use collectl which I designed for this very type of thing and then pump its output through colplot to get very detailed plots. I use it every day and collect data samples once a second on a ton of servers and make the data available as text through collectl's cli as well as graphics via colplot.

-mark

syg00 11-17-2012 07:00 AM

Is this not veering a little off-track maybe ?.
Quote:

Originally Posted by Fajkowsky (Post 4828262)
I have Ubuntu server and apache2 installed on it. I want to benchmark it using ab tool from another machine.

Not knowing the least about apache, a quick search found this little gem
Quote:

ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
The loadavg thing is a bit of a side-track here - possibly true of all loadavg discussions.


All times are GMT -5. The time now is 07:53 AM.