Page 1 of 1

CPU usage details?

Posted: Wed Apr 05, 2006 2:20 am
by jager
Hi,
Is there any way to see where the router uses the most of its CPU power, on what task?
We are suffering from very high CPU load, and it will be very useful if I could somewhere see what on earth is eating the CPU....

Posted: Wed Apr 05, 2006 3:21 pm
by cmit
Not possible right now.
This effectively is the question to provide something like "top" for MikroTik - which has been asked for several times here in the forum.

Would come in VERY handy for debugging purposes...

Best regards,
Christian Meis

Posted: Wed Apr 05, 2006 11:41 pm
by jager
Yes, it will be nice feature to have...
But, IMHO, if you setup a router on linux, even with "top" you can`t separately see things that are executed by kernel. Bandwidth limiting (cbq), firewall (iptables), etc will not be shown as separate tasks....
Maybe this is the main reason why such feature still not exist on Mtik?

Posted: Thu Apr 06, 2006 8:56 am
by normis
jager is right, plus RouterOS has a lot of programs that would not mean anything to anyone. programs that are responsible for many features indirectly etc.

Posted: Thu Apr 06, 2006 11:57 am
by cmit
Yeah, I know that of course. That's why I wrote "something like top for MikroTik" (perhaps this wasn't clear enough). Of course this would only make sense if it could output something like:
script "check_dhcpleases" 0.6% CPU, 823 kB mem
PPPoE server "pppoe-server1" 48.3% CPU, 2569kB mem
or the like (please ignore dumb demo values ;) )...

Best regards,
Christian Meis

Posted: Thu Apr 06, 2006 12:09 pm
by normis
there simply is no such information, we can't just invent it :) if a program runs, and does multiple tasks, even we can't tell for sure what exactly takes up resources. even in Top if you see `httpd`, can you tell what exactly it does now and why is it taking up resources? some programs are responsible for all kinds of stuff, and their names will not be self-explainatory. No use for us or you. You think that we have some super program that shows us everything, and we are just hiding it from you? Not exactly :) This is not easy stuff

Posted: Thu Apr 06, 2006 12:14 pm
by cmit
I know all of that. And I never said it was easy :D.

But I SUPPOSE it could be accomplished for at least some parts. So I suppose it would be possible to display resource usage for each running script.

Yesterday night I tried to debug a fairly complex script, and the CPU on the system went to 90% quite often. I thought it was the script, but it turned out to be something else after a few hours.

If I could have seen the script isn't actually using much CPU, I could have saved some hours ripping out my hair (because there are _no_ debugging possibilities for scripts in RouterOS) and find the problem earlier...

But, after all, I suppose we just won't get such a feature, I fear.

Best regards,
Christian Meis

Posted: Thu Apr 06, 2006 12:17 pm
by normis
if it would be easy, it would have been made already. maybe we will come up with something in 2.10

Posted: Thu Apr 06, 2006 12:20 pm
by cmit
Fine - but there certainly are more important things to put your work into!

Best regards,
Christian Meis

Posted: Thu Apr 06, 2006 10:20 pm
by eflanery
Systemtap may be worth keeping an eye on (http://sourceware.org/systemtap/), once it matures a bit, it could likely provide much of this info.

Or, if someone were to do a dtrace port.... :twisted:

--Eric