Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
System activity monitoring tools - top, iotop, ntop, sar, collectl, etc - may be a good reference to judge the system activity when the system transitions to sleep state.
But if I make the system transition to sleep state when i/o activity is zero during 15 minutes, for example, it won't sleep forever because slight i/o by daemons, etc occurs continuously even if no user i/o.
So how can I judge the system activity to change the state by using those tools?
Normally you're not going to be performing detailed system monitoring on a machine that you expect to enter a "sleep state" (which to me implies a laptop or desktop). Can you talk more about the specifics of what you are trying to accomplish?
I'm going to write a power saving tool which change a machine (laptop or desktop) to sleep state.
The state will be changed automatically when no system activity during some periods, and a problem is how to judge the system activity.
What I'm thinking are
cpu/memory activity
i/o activity
and network activity
,and there are several monitoring tools for each.
So I'm trying to judge the system activity through such a tool, that is, if both i/o read and i/o write are zero during some periods that results from "sar", for example, the power saving tool judge the system is inactive and change it to a sleep state.
But output from "sar" says that both i/o read and i/o write are always not zero. This is because slight i/o by daemons, etc occurs continuously even if no user i/o.
Cpu/memory and network activity are also similar.
I wonder how can I determine the system activity by using such a tool.
This is indeed a tricky one because if your tool is running on the system IT will be generating system activity. Running something like collectl would let you look at a lot of things but it too would generate activity. I'm wondering if looking at the interrupts might help? Of course there are always clock interrupts even on an idle system and other things would also generate noise as well, so this may prove to be an impossible task, or at least a very complex one.
-mark
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.