Process to use open files

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Process to use open files
# 1  
Old 01-27-2016
Process to use open files

I would like to test open files usage in my system, if I want to create a process ( or script ) that can use a certain amount ( eg. 1000 ) of open files , is it possible to create such process ( or script ) ?
# 2  
Old 01-27-2016
Try ulimit -u first and see if that does not meet your needs.
Chack back with us if that will not do. But. Be forewarned:

Code:
1. some command line utilities like awk may have  predefined limits on open files, so you may have to write C, or C++ code to "test".

2. You are going to create lots of worthless files in order to test, 
   files that you need to clean up later, depending on how you write code
   or what tool you use.

3. Assume ulimit shows 4096
   you will need to try to open more files than that and look for an error
   and print the step (number of files) when it bombs

# 3  
Old 01-27-2016
Quote:
Originally Posted by jim mcnamara
Try ulimit -u first and see if that does not meet your needs.
Chack back with us if that will not do. But. Be forewarned:

Code:
1. some command line utilities like awk may have  predefined limits on open files, so you may have to write C, or C++ code to "test".

2. You are going to create lots of worthless files in order to test, 
   files that you need to clean up later, depending on how you write code
   or what tool you use.

3. Assume ulimit shows 4096
   you will need to try to open more files than that and look for an error
   and print the step (number of files) when it bombs

thanks reply ,

thanks reply ,

what I want to have a process that use open files up to a certain amount .

in my case , I have set the ulimit -u to 2048 in my system , I would like to have a process that will use the open files up to a certain amount eg. 1000 , that I can test my application when the current open files is at the amount of 1000 .

may I know if use a script which have a loop to open file continously , is it work ?

thanks
# 4  
Old 01-28-2016
Do you trink that one process can steal file descriptors from another process??
It cannot. Each process has its own 1024 (or 2048 if set with ulimit) descriptors.
This User Gave Thanks to MadeInGermany For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cannot make pipe for process substitution: Too many open files

Hi, I've came across an issue with a script I've been writing to check DHCP addresses on an Solaris system, the script has been running reasonably well, until it hit the following problem: ./sub_mon_v2: redirection error: cannot duplicate fd: Too many open files ./sub_mon_v2: cannot make... (3 Replies)
Discussion started by: CiCa
3 Replies

2. SCO

sco unix backward compatibility on "max open file per process"

Hi How to increase maximum number of open file in "sco xenix binary" running in "sco unix openserver 5.0.7" ? I have changed "NOFILES" kernel parameter to 512, but xenix binray can't open more than 60. tnx (4 Replies)
Discussion started by: javad1_maroofi
4 Replies

3. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

4. Solaris

file open/read/write/close/access by process

Hi want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris. Purpose : while running perf. test, needs to find where is the bottleneck. We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies

5. OS X (Apple)

Open Files for a process

I am having a client/server application which will download files from server. If server has directories, it will create directories/sub directories and then download files. In this process, I observed that number of open files are more than 400 (which is approxmately same as number of dir/subdir... (1 Reply)
Discussion started by: satyam90
1 Replies

6. Shell Programming and Scripting

Reading a file that is already open by another process

hi, I'm using HP unix tru64 & Win XP. i'm download a file from winxp to unix using ftp. how to know whether a remote file is currently being used by the process or not? (my loaction unix server) (7 Replies)
Discussion started by: Tlg13team
7 Replies

7. Shell Programming and Scripting

Monitor open file handles used by a process

We have a process that is running out of file handles. Is there some command line way to determine this that we can include into a cron script? Please let me know JAK (3 Replies)
Discussion started by: jakSun8
3 Replies

8. UNIX for Advanced & Expert Users

Max No of Open File Descriptors in a process

I have set the maximum no of file descriptors open in a process to the value 8192 using the following lines set rlim_fd_max=8192 set rlim_fd_cur=8192 in the /etc/system file. I rebooted the machine and the command ulimit -n / -Hn both display the limits as 8192. However when I run my... (2 Replies)
Discussion started by: lakshmankumar12
2 Replies

9. UNIX for Dummies Questions & Answers

Should a UNIX daemon process close open fds?

I have a UNIX daemon process that's been started by a parent process, an application server. The behavior of this daemon process is to inherit and use the app server's file descriptors (ports/sockets). When I shutdown the app server, the daemon continues to run, because there may be other... (1 Reply)
Discussion started by: kunalashar
1 Replies

10. Programming

transfer an open file description between two process

How can I transfer an open file description between two process? (1 Reply)
Discussion started by: xu_wen_dong
1 Replies
Login or Register to Ask a Question