网站首页 | 网页制作 | 网络编程 | 图形图象 | 冲浪宝典 | 操作系统 | 软件教学 | 网络安全 | 认证考试 | 下载中心 | 游戏下载
| 操作系统首页|Windowns2003|Windowns2000|WindownsXP|Linux|FreeBSD|Unix|DOS|Solaris|SCO_Unix|HP-Unix|注册表|经验技巧 |
您现在的位置: 超人气学院 >> 操作系统 >> Solaris >> 文章正文 用户登录 新用户注册
[分享]Maximum number of open files           
[分享]Maximum number of open files
作者:未知 文章来源:网络收集 点击数: 更新时间:2006-3-24 13:32:19

http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=ffaqs%2F01406&zone_32=solaris9

SYNOPSIS: Maximum number of open files 

DATE APPROVED: 6/24/02 

DOCUMENT ID: 01406 

SYNOPSIS: Maximum number of open files 

OS: Solaris[tm] Operating Environment (OE) 

PLATFORM: All 

OS VERSION: Solaris 5.x OE 

TECH AREA: OS 

PRODUCT: Kernel 

KEYWORDS:  open(2), fopen(3C), cc, rlim_fd_cur, rlim_fd_max, Sys calls 
  

The following TechNotes may contain actual software programs in source code form. This source code is made available for developers to use as needed, pursuant to the terms and conditions of this license. 
  

DESCRIPTION: 

The maximum number of open files a process can have is limited by various factors. Many parameters can be adjusted. Also, the Solaris 9 OE greatly increases the absolute maximum number of files. 

SOLUTION: 

Most programs do not work near the limits of open files but when a limit is reached, it can be a confusing situation. The most common applications with large numbers of open files are network servers which are connected to large numbers of clients at the same time. This TechNote should help developers understand file limits and how to adjust them properly. 

There are system limits on the number of files a process can keep open at any given time. The limit varies by user environment settings, the release of the Solaris OE in use, and the current kernel configuration. The kernel variable rlim_fd_max is an absolute limit which is set in the kernel. The kernel variable rlim_fd_cur sets the default process soft limit. The shell inherits the default limits which can be retrieved and modified by the ulimit command. The remainder of this TechNote examines the different limitations and how to adjust them. 

open() and fopen() limitations 

There are a number of ways for a programmer to open files from C code. Two of the common methods are the system call open(2) and the stdio library call fopen(3C). Each of these calls is limited to the number of opens they can perform, but fopen(3C) has a harsh stdio library limit. 

Both open(2) and fopen(3C) use file descriptors which are taken from the total number of file descriptors allowed by the environment. If a program uses open(2) exclusively, then the program will be able to open as many files as the current soft limit allows. The soft limit defines how many files a process can open. There are actually two environmental limits. The soft limit and the hard limit. The soft limit is the number of files a process can open by default. The hard limit is the maximum number of files a process can open if it increases the soft limit (example following). 

fopen(3C) has another type of&n

[1] [2] [3] [4] 下一页

[ 收藏此页到: 天天|和讯|博采|ViVi|狐摘|我摘|天极 ] 文章录入:kinda    责任编辑:kinda 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    专 题 栏 目
    最 新 热 门
  • 此栏目下没有热点文章
  • 相 关 文 章
    轻松取消Windows2000默认共
    随心所欲的设置Windows200
    轻松清除Windows2000的系统
    轻松清除Windows 2000的系
    随心所欲的设置Windows 20
    工作中的学习,与大家共享
    [分享]informix-4gl 7.2编
    通用线程 -- sed 实例,第
    通用线程 -- sed 实例,第
    分享IBM225上安装SCO5.0.6
    U盘备份shell 1.2.1版for中
    [分享]在SCO UNIX上 利用C
    【分享】发一个批量FTP的s
    第 8 部分:安全 shell 及
    [分享]在Solaris上实现Tom
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)