Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running Jack2 with Pianoteq-5 on two core laptop running 64bit ubuntu-14.04. Such configurations are very sensitive to realtime performance because of low-latency requirements. At first I heard constant clicks which basically gone away when I tweaked /etc/security/limits.conf to enable RR capability to audio group.

So now both Jack and Pianoteq have threads with SCHED_FIFO scheduling class. I can run jack with buffer of size 128 samples and it runs smoothly most of time. I say 'most' because every couple minutes or so something destroys the paradise. I hear a whole cluster of terrible cracks. I suspect it's the result of some high priority activity starting on the background. But how to track down who is the guilty?

share|improve this question
    
Looks like finally I've found the main culprit. That was knetwork manager triggering periodical wifi networks discovery or something like so. I didn't inverstigate it further, but switching wifi off helps tremendously. –  Dmitry Vyal Jul 21 at 18:26

1 Answer 1

Here is one way to do it. Generates a LOT of files, but I can't think of another way to do it.

Assuming you're not around to see when the server gets busy, you have to use sysstat to capture your historical resource data.

First way: use sysstat and collect stats every 5 minutes (will take up about 8mb a day). Your cron entry would look something like 5 * * * * /usr/lib/sa/sa1
or 5 * * * * /usr/lib64/sa/sa1

sysstat will keep up to a month of data. But you can always copy the files and archive them as well.

You would use the "sar" command to look back through historical data to see what time your server got busy.

Now that you have historical data on your server, you also need to capture process output so you can see what is running at the time. You can use "ps" or "top" for this

So every 5 minutes you can also capture the output of top and ps auxww so you can see all processes that are running. I would create two subdirs "toparchive" and "psarchive" and then put these as my cron jobs.

5 * * * * top -b -n 1 > /root/toparchive/top.`date +"%Y%m%d_%H%M%S"`

or

5 * * * * ps auxww > /root/psarchive/ps.`date +"%Y%m%d_%H%M%S"`

(that will be a lot of files, alternatively you can script it so you have additional subdirs with a datestamp, like /root/toparchive/20140701/)

But basically watch your sysstat and you can find out when your server gets busy, then check the appropriate top or ps output you've captured to see what took up your space

If the process is hogging memory, you can additionally use "pmap" and "pgrep" to look at current processes and actual memory usage as well.

share|improve this answer
    
Well, since it's a workstation and I observe this behaviour almost every minute probably a regular watch would suffice. Thanks for an idea! –  Dmitry Vyal Jul 1 at 17:20
    
Using top would be the first part and you can get a good idea of what resources are being the most heavily used. You can still use sar to see if the bottleneck is CPU, memory, IO, etc. Most likely if something is crunching your server, when you use "top" you'll see that process at the top of "top" ;) Good luck! –  ben Jul 1 at 17:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.