Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
We run Jboss app server that of course is all multithreaded under one JVM. I have couple of question regarding monitoring on per thread basis:
1. Is there a way to see which thread is bound to which CPU core?
2. Is there a way to see the CPU, Memory usage per thread? Something like prstat on Sun box which is real time and gives detailed information about threads per CPU
My own experience is that JBoss does a pretty good job of scheduling workloads across multiple CPUs.
The first thing you need to do is figure out *which* process is hogging CPU 0. It's very likely a specific process (rather than a bunch of different programs), but it *isn't* necessarily a JBoss-related process.
Your first task is to figure out what *process* is causing the problem (it might not be JBoss at all, and JBoss typically runs several different apps that use many different JVM processes). Here's a good place to start (you can easily Google for many other "Linux Performance Tuning 101" articles
PS:
In case the problem is your app server, JBoss is very rich in performance monitoring tools to help you home in on the precise problem(s) and correct it (them):
PPS:
What makes you think there's only one JVM for the whole app server? We use JBoss under Windows (it sounds like you're running under Linux), but our (Windows) JBoss definitely spawns multiple JVMs.
PPS:
Please double-check that you have an SMP version of Linux installed (running a uniprocess Linux might account for one CPU getting all the activity :-))
May be in your case you are running multiple App servers on one box. We run one app server which creates one Java process but of course it's all multi-threaded.
So going back to my question, could someone please tell me if there is any way in Linux to do this:
1. Is there a way to see which thread is bound to which CPU core?
2. Is there a way to see the CPU, Memory usage per thread? Something like prstat on Sun box which is real time and gives detailed information about threads per CPU
My experience with JBoss (multiple different versions of JBoss, in both development and production environments) is all on Windows (not Linux). Nevertheless, I am quite certain that JBoss should distribute workload well among multiple CPUs (or multiple cores) if your system is configured correctly (and if a JBoss app is even the source of your presumed CPU bottleneck).
Q: Have you looked at any of the performance monitoring links I sent you? Specifically, have you looked at any of "ps", "top" or the JBoss console?
I am specifically looking for answer to below questions:
1. Is there a way to see which thread is bound to which CPU core?
2. Is there a way to see the CPU, Memory usage per thread? Something like prstat on Sun box which is real time and gives detailed information about threads per CPU
You're a stubborn son-of-a-gun, aren't you ;-)? I sympathize - so am I.
In any case:
1. "prstat", as you know, is a Solaris tool.
You might be able to find a Linux port if you Google hard enough; you might even be able to write one yourself. But AFAIK, there isn't any standard version of "prstat" on non-Solaris platforms.
2. There are many ways to see if your OS is multiprocessor or not.
Two Pop Favorites are:
a) uname -a =>
Quote:
Linux gateway 2.6.22-1-mepis-smp #1 SMP PREEMPT Mon Feb 18 21:44:02 EST 2008 i686 GNU/Linux
<= You can tell by the letters "SMP" that this is a multi-CPU install
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4144 paulsm 15 0 32388 15m 12m S 3 0.8 0:34.77 kded
...
<= You can see performance statistics for each of the two cores in this laptop PC...
3. Linux (like most *nix, including, of course, Solaris) has a *wealth* of tools for performance monitoring and analysis. JBoss and Sun Java also have their own, rich, toolkits and resources.
I strongly urge you to familiarize yourself with some of them (if you haven't already) - they can definitely help you with this particular question.
In particular, I urge you to play with JBoss "jmx-console", and with Sun's free download "JConsole".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.