LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2014, 05:53 PM   #1
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 31
Monitor incoming / outgoing bandwidth by resource


I run a server out of my home and I'd like to know not just the total incoming bandwidth (much of which is requests from the server out to other resources), but a breakdown of that bandwidth by resource.

Setup: I have the home server set at a subdomain of a domain I own. All the sites it hosts are in sub-folders of that subdomain.

Now, one thing I have on that subdomain is a minecraft server, and another is a minecraft website (among many other things, but this will be a good example). I can distinguish incoming traffic to the minecraft server by port. Great. However, I can't tell how much of my general incoming web traffic is on the minecraft website resource by port. However, I can tell by the resource requested.

So what would be best (for me) is something that tells me the bandwidth usage of incoming and outgoing requests and the resource (and port) requested. I should be able to write a script to parse that information fairly easily if I can get access to those fields.

Most of the tools I've seen, though, only report total port usage.

Included in this question is the question of ssl. Some of my resources are behind https, so I can imagine some reports might have problems with that (though I'd figure the resource must still be in plaintext).

I've seen ways to gather total /port/ bandwidth and ways to gather total requests of resources, but not something that distinguishes them all. So I might know I have 800 requests to the minecraft website and 20 to my school thesis documents, but while I can /guess/ what the bandwidth of each request comes out to, I'd like to know for certain and automatically.

And again ... if the tool can even just generate a log of each request with the general information, I can parse it with a script and print out a web page for my own viewing pleasure.

Anyone have any recommendations? I haven't been able to find anything.
 
Old 03-02-2014, 08:53 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
The following are descriptions of just some of collectl's many features but are not intended as a tutorial of how and when to apply them:

Fine Grained, Non-Drifting Monitoring

If the Time:HiRes perl modules is installed, which you can verify with the command collectl -v, you will be able to run with non-integral sampling intervals. Whether integral or fractional, sample times will align extremely close to the whole second and will not drift as it the case with just about every other tool. You will also be able to use -om to have all times reported in msec.

Low Overhead

Collectl uses very little CPU. In fact it has been measured to use <0.1% when run as a daemon using the default sampling interval of 60 seconds for process and slab data and 10 seconds for everything else. The overhead can increase on systems which have dozens of disks or running hundreds processes so you may want to measure its effect on you own system if you are concerned.

Summary vs Detail Data
You can report aggregated performance numbers on many devices such as CPUs, Disks, interconnects such as Infiniband or Quadrics, Networks and even the Lustre file system. However you can also report on individual devices if you want to see how the aggregate load is being generated. Be sure to see the documentation for more details, particularly the examples and tutorials in the Getting Started section.

Brief vs Verbose Format
If is often more useful to see less data but for more devices and collectl recognizes this by providing brief format as a default interactive display format. This allows you to see what a number of subsystems are doing on a single line, making it much easier to spot inconsistencies in the data by scanning a column of numbers. If you want more detail and are willing to look at multiple lines per sample verbose format is what you want. In fact, if you collectl data in record you can play it back in both formats, first brief to look for problems and than again in verbose to see more of what is happening. This technique also applies to Summary and Detail data as well.

Plot Format
Althougy you can also display interactive output in plot format, this is really intended for its namesake, plotting. By generating output (or simply playing back recorded data) in this format, you can then feed the resultant files into plotting tools that recognize delimiter separtated fields such as gnuplot, Excel or even OpenOffice. If you need data with non-space separated data which is the default, you can even change it via the --sep switch.

Aligned Monitoring Intervals
If you've installed Time::HiRes and are using an integral sampling interval, by default collectl will align its sampling on integral second boundaries. In interactive mode samples will be taken as close as possible to the nearest second and when run as a daemon, samples will align to the top of the minute. In the latter case this means if you're running on a cluster with synchronized clocks, all instances of collectl will collectl their samples within a few msec of each other, making it much easier to correlate events across the cluster.

Process and Slab Monitoring
Both ot these are higher overhead activities, but collectl provides a secondary interval so they can be gathered at a lower frequency. In addition one can specify a number of filters to select processes by pid, parent, owner, or even name. One can also request process threads be included. As for slabs, here too one can filter by name and during interactive display can request that only slabs that have changed in value be displayed, significantly reducing the output and enhancing the readability.

Collectl also has the ability to display process and slab data in a way similar to the top and slabtop commands, each with a number of sorting options including the ability to sort processes by the top I/O users and slabs by the changes in allocated memory, neither of which are currently available in any existing utilities.

Process I/O
New to the 2.4.0 release is the monitoring of process i/o statistics. See this page for more details

Interrupt Reporting by CPU
New to the 2.5.0 release you can now report interrupts at the CPU level and even examine them changing in more detail at the individual interrupt levels.

Socket Communications
Rather than dispay its output on the terminal or write it to a file, collectl can send its data over a socket as well, making it possible to integrate it with other programs.

Exportable data formats
If you don't like the format of the data collectl presents, feel free to write your own using --export. There are 4 main ones that come with collectl for writing as S-Exporessionn, List Expressions and even exporting UDP data to ganglia and graphite. In the case of the first 2, this data can also be sent over the TCP socket interface as well.
Tested at scale within the HP Public Cloud
Running on all servers at a monitoring frequency of 1-second, collectl has been validated to run efficiently in some of the most strenuous of environments.

IPMI monitoring for fans and temperature sensors
The main reason this is experimental is because all vendors report IMPI sensor data differently, even within their own product lines. This is an attempt to table drive the parsing of the data in such a way that collectl can rationalize its display.

API for importing additonal data
If you've been a collectl user but wanted to import var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

should be something to investigate.
 
Old 03-02-2014, 12:03 PM   #3
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 240

Original Poster
Rep: Reputation: 31
That looks like a great tool in general, but I don't see where it lets me do TCP/IP monitoring of specific resources or resource folders. It can do socket monitoring, true, but it won't break it down into /which/ resources are being requested, which is entirely what I'm interested in monitoring.

Unless I'm missing something?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit incoming and outgoing bandwidth and latency in linux yzfr1 Linux - Networking 6 05-24-2013 06:36 AM
How to let incoming and outgoing in iptables revinking Linux - Networking 1 08-03-2008 07:35 AM
Network traffic -- monitor my incoming and outgoing ports bskrakes Linux - Networking 5 04-02-2008 08:44 AM
Limiting Bandwidth On Internet When Incoming/Outgoing Call newyorkrebell Linux - Networking 1 04-20-2006 07:15 AM
Incoming, but no Outgoing Access belorion Linux - General 4 05-09-2005 07:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration