Identify cause of high resource usage

hello all,

on linux servers sometimes any of these resources (cpu,memory,disk) get a spike when you are not in front of the server.

the duration of these spikes might be 5 mins or even whole weekend.

my question is there a good way of capturing the events that caused these issues ( cpu or memory) that can later be used to investigate and find a solution.

p.s am not talking about monitoring tools like caccti,nagios etc.

thanks

If this is only a problem when you are not in front of the server, you can either always stand in front of the server or you can tell us what you do while standing in front of the server that keeps the spikes from happening or being a problem. Then maybe we can help you write a script that would do what you do while standing in front of the server that keeps it from being a problem (even when you're not standing there).

Consider putting iostat, vmstat, mpstat in short intervals in file (like 15 seconds, every hour new file [15 240]). Be sure to take notice of disk space required.

Also, you might want to consider installing and configuring sysstat bundle on linux system, using various online resources.

Later on you can analyse those files to see possible problems using ploting for graphs, or perhaps loading into database.

Hope that helps
Regards
Peasant

1 Like

Hello Peasant.

Thanks for the solution.

whats the 240 ?

Tools like iostat, vmstat and alike offer to run in intervals.

iostat [options] 15 240 > /mypath/iostat_$(date "+%Y%m%d%H%M") will run iostat every 15 seconds 240 times, total of one hour, and write output into hourly files.

So if you put your script into cron to run every hour, you will have hourly report files with 15 seconds measure intervals.

Hope that helps
Regards
Peasant.

1 Like

hello peasant,

thanks for the advice

am going to install this and play with it.

regards,
coolatt