FreeBSD Bugzilla – Attachment 162257 Details for
Bug 203900
Can not increase above 32K max open files descriptor per PID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Load file which is generated by dummyFileGenerator.py
dummyFileLoader.py (text/plain), 1.74 KB, created by
Rizal Muhammad Nur
on 2015-10-20 18:00:24 UTC
(
hide
)
Description:
Load file which is generated by dummyFileGenerator.py
Filename:
MIME Type:
Creator:
Rizal Muhammad Nur
Created:
2015-10-20 18:00:24 UTC
Size:
1.74 KB
patch
obsolete
>#!/usr/bin/env python ># How to use ># > python genFileDummy.py -r 1 -d /data/ -n 100000 ># file structure will be like: ># /data/aa/bb/cc/dd > >import argparse >import time >import sys >import os > >i = 0xffffffff+1 >f = [] > >def get_args_parser(): > parser = argparse.ArgumentParser(add_help=False) > parser.add_argument( > "-n", "--number", > default=False, > nargs='?', > type=int, > help="Number files is generated (max 2^32)") > parser.add_argument( > "-d", "--dir", > default='.', > nargs='?', > type=str, > help="Directory base") > parser.add_argument( > "-r", "--report", > default=0, > nargs='?', > type=int, > help="Print report every r second") > parser.add_argument( > "--help", > default=False, > action='store_true', > help="Show this help") > return parser > >def openfile(n): > tmpfile = None > hexstr = format(n,'x') > level1 = hexstr[1:3] > level2 = hexstr[3:5] > level3 = hexstr[5:7] > level4 = hexstr[7:9] > path = args.dir+'/'+level1+'/'+level2+'/'+level3 > try: > tmpfile = open(path+'/'+level4, 'w') > except: > print "retry openfile "+str(n-i+1) > tmpfile = open(path+'/'+level4, 'w') > return tmpfile > >if __name__ == '__main__': > parser = get_args_parser() > args = parser.parse_args() > if args.help or not args.number or args.number > i: > parser.print_help() > parser.exit() > sys.exit() > if not os.path.exists(args.dir): > print "Base directory "+args.dir+" doesn't exist" > sys.exit() > t = time.time() > for j in range(i,i+args.number): > f.append(openfile(j)) > if args.report: > if time.time() - t > args.report: > t = time.time() > print "open file number: "+str(j-i+1) > print "open file number: "+str(j-i+1) > while 1: > print time.time() > time.sleep(1) > sys.exit()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 203900
:
162256
| 162257