Skip to ContentSkip to Footer
Start of content
- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- How can we access process info
General
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-02-2001 09:09 PM
10-02-2001 09:09 PM
Hi,
In Linux, How can we find out number of threads in a process? In SPARC, We can use /proc file commands. How can we do in LINUX?
In Linux, How can we find out number of threads in a process? In SPARC, We can use /proc file commands. How can we do in LINUX?
We make the difference
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-03-2001 12:44 AM
10-03-2001 12:44 AM
Solution
Hi Sudheer,
you should try in your favorite linux distribution the ps command with the "-m" or "m" switch. I tried it out in redhat 7.1, but I get a "ps: error: Thread display not implemented" error message. Maybe it is implemented in your distrib though...
if you want the thread details of a C program of your own, then you should compile it with the "-g" option, execute it under gdb & you will be able to get thread information with the "info threads" command.
hope this helps
you should try in your favorite linux distribution the ps command with the "-m" or "m" switch. I tried it out in redhat 7.1, but I get a "ps: error: Thread display not implemented" error message. Maybe it is implemented in your distrib though...
if you want the thread details of a C program of your own, then you should compile it with the "-g" option, execute it under gdb & you will be able to get thread information with the "info threads" command.
hope this helps
"This is how the world works: all energy flows according to the wills of the great magnet... What a fool was I to defy him!" (Johnny Depp/Fear+Loathing In Las Vegas)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-03-2001 07:31 AM
10-03-2001 07:31 AM
Re: How can we access process info
Top Command
To allow users to increase their file descriptor limits, change the following configuration files:
In /etc/security/limits.conf, add the lines:
* soft nofile 1024
* hard nofile 4096
In /etc/pam.d/login, add:
session required /lib/security/pam_limits.so
To increase the system-wide file descriptor limit, add the following three lines to the /etc/rc.d/rc.local startup script:
# Increase system-wide file descriptor limit.
echo 8192 > /proc/sys/fs/file-max
echo 24576 > /proc/sys/fs/inode-max
#######################################
Limitations on threads are tightly tied to both file descriptor limits, and process limits.
Under Linux, threads are counted as processes, so any limits to the number of processes also applies to threads. In a heavily threaded app like a threaded TCP engine, or a java server, you can quickly run out of threads.
For starters, you want to get an idea how many threads you can open. The `thread-limit` util mentioned in the Tuning Utilities section is probabaly as good as any.
The first step to increasing the possible number of threads is to make sure you have boosted any process limits
To allow users to increase their file descriptor limits, change the following configuration files:
In /etc/security/limits.conf, add the lines:
* soft nofile 1024
* hard nofile 4096
In /etc/pam.d/login, add:
session required /lib/security/pam_limits.so
To increase the system-wide file descriptor limit, add the following three lines to the /etc/rc.d/rc.local startup script:
# Increase system-wide file descriptor limit.
echo 8192 > /proc/sys/fs/file-max
echo 24576 > /proc/sys/fs/inode-max
#######################################
Limitations on threads are tightly tied to both file descriptor limits, and process limits.
Under Linux, threads are counted as processes, so any limits to the number of processes also applies to threads. In a heavily threaded app like a threaded TCP engine, or a java server, you can quickly run out of threads.
For starters, you want to get an idea how many threads you can open. The `thread-limit` util mentioned in the Tuning Utilities section is probabaly as good as any.
The first step to increasing the possible number of threads is to make sure you have boosted any process limits
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
End of content
United States
Hewlett Packard Enterprise International
Communities
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP