- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ls and high CPU SYS load
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
- Report Inappropriate Content
07-11-2005 12:38 AM
07-11-2005 12:38 AM
ls and high CPU SYS load
I've a server with a CPU bottleneck on SYS CPU, I've been monitoring this and arrive to the conclusion that the cause for the high SYS CPU load is an huge amount of "ls" (more than 1000/min) that some user scripts execute on a filesystem with more than 100.000 files.
Is there a way to tune this from the OS side? How can I improve performance?
Thks
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:42 AM
07-11-2005 12:42 AM
Re: ls and high CPU SYS load
1000 'ls' command per minute on a filesystem with 100,000+ files is going to hamper performance.
The first step would be to look at what exactly those scripts are doing and see if there is a way to rewrite the scripts to be more efficient and much much much more frugal in the use of the 'ls' command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:51 AM
07-11-2005 12:51 AM
Re: ls and high CPU SYS load
If you are willing to accept a bit of staleness, you might be able to do something like this. Save the results of an ls to a cache file and let the scripts read from this file; a timestamp could be used to determine if the file is too old and if so refresh the cached version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 01:11 AM
07-11-2005 01:11 AM
Re: ls and high CPU SYS load
I believe you are going to have a hard time tuning this out. Might I ask if the files in this file system are created/deleted often? If so you may look at performing regular defragmentation of the file system (I assume vxfs).
fsadm -d -D -e -E /filesystem
Of course you should also look at limiting those 'ls' commands.
David
This could speed up performance in this case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 11:43 AM
07-11-2005 11:43 AM
Re: ls and high CPU SYS load
Old way: ls /bad_directory | grep *my*file*
Better way: echo /bad_directory/*my*file*
This allows the shell to do the searching. But in all cases, the rapid ls in a way-too-large set of files is crushing your system for no good reason. If you post relevent portions of some of these scripts, we can probably fix them up quite handily.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2005 02:47 AM
08-25-2005 02:47 AM
Re: ls and high CPU SYS load
Thank you all.
Enjoy :)
Pedro