LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-09-2009, 10:17 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
How to determine the actual open files?


I installed iPlanet Web-Server on RH-Linux. When I send ws-request to the application on Jboss via this web-server I will get sometimes (not always) error as follow.

Code:
...
Tue Sep  8 11:32:42 2009 Temp Post File name = [/tmp/_wl_proxy/_post__28832_77]
Tue Sep  8 11:32:42 2009 Could not open temp post file '/tmp/_wl_proxy/_post__28832_77' for POST of size 2306
Tue Sep  8 11:32:42 2009 *******Exception type [WRITE_ERROR_TO_FILE] (Cannot open TEMP file '/tmp/_wl_proxy/_post__28832_77' for POST of 2306 bytes
...
I use the ulimit -a to list the system setting and they look as follow:
Code:
[root@myserver root]# ulimit -a
core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) 4
max memory size       (kbytes, -m) unlimited
open files                    (-n) 1024
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 10240
cpu time             (seconds, -t) unlimited
max user processes            (-u) 7168
virtual memory        (kbytes, -v) unlimited
[root@myserver root]#
Here one can see the default max open files is 1024. I guess it's too small. But I want to know what is the actual open files so I can increase the max. open files number.
 
Old 09-09-2009, 10:26 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
On the server:

$ cat /proc/sys/fs/file-max

probably says 1024

as root, edit /etc/sysctl.conf

find the line that says:
fs.file-max = 1024
... and change it.

If it does not have one, append it.

# sysctl -p
 
Old 09-09-2009, 10:40 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
Hi Simon,

I haven't asked how to increase the max open file number but want to know how to get or determin the actual opened files.

Besides, I use the command you give me "$ cat /proc/sys/fs/file-max" and I got:

917504.

What does this mean? Does this mean I have to increase the max open file number to 950000?

Last edited by thomas2004ch; 09-09-2009 at 10:44 AM.
 
Old 09-09-2009, 10:44 AM   #4
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Quote:
But I want to know what is the actual open files
Taking this to mean "how do I find the number of open files for a particular user or system wide"
For user root:
Code:
lsof -u 0 | wc -l
For all:
Code:
lsof|wc -l

Last edited by TBC Cosmo; 09-09-2009 at 10:48 AM.
 
Old 09-09-2009, 10:46 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by TBC Cosmo View Post
For user root:
Code:
lsof -u 0 | wc -l
The result is : 1829.

Does this mean the system has at the moment 1829 opened files? Does this mean I should increase the max open file larger than 1829?
 
Old 09-09-2009, 10:49 AM   #6
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Means uid 0 has that many. What uid is the process mentioned in your O/P running under?
 
Old 09-09-2009, 10:57 AM   #7
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by TBC Cosmo View Post
Means uid 0 has that many. What uid is the process mentioned in your O/P running under?
uid is 'web'.

I use lsof -u web | wc -l to get the actual open file number from user 'web'. Is it correct?
 
Old 09-09-2009, 11:01 AM   #8
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Get web's uid or you can use it by name I suppose
Code:
id web
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Date/Time without actual files? - a real head scratcher tbeehler Linux - Software 17 07-25-2007 05:20 AM
Actual configuration files Red Barchetta Mandriva 4 05-12-2007 04:38 PM
Able to write files to MP3 player but no files written into actual device? olnex Linux - Hardware 0 11-11-2005 07:32 AM
Ports Open or Closed - How do I determine what... wcn Linux - Software 8 07-02-2004 08:52 AM
ssh -X to an actual open terminal lobo78 Linux - Networking 1 03-11-2004 01:55 PM


All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration