Berkeley CSUA MOTD:Entry 10403
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2003/10/1-2 [Computer/SW/OS/Solaris] UID:10403 Activity:nil
10/1    I'm on solaris and trying to increase the number of open file descriptors
        my processes can have. I've used limit and ulimit under zsh and bash,
        respectively, to set these to say, 400. limit and ulimit -a apparently
        confirm these changes. But when I write a program to test this out,
        it still fails after the default of 256 open files. Any idea what I
        might be doing wrong? Thanks.
        \_ The number 256 should've clued you in on what's going on.
           \_ umm, duh. the question is why is it still at 256...
              \_ yes, and you apparently missed the boat by a mile. 256 is
              2^8. You're calling a clib function. Think about it. It's not
              that hard....
                 \_ umm, again, no. you're probably missing the boat by
                    several miles then. do you even know c? or perhaps you're
                    just way over my head, in which case you should explain
                    to mere mortals what gems can be found in your seemingly
                    idiotic comments.
                    \_ Each time a file is opened space is allocated for
                    a new file descriptor. The descriptors are in an array.
                    In order to find an empty slot in the descriptor array the
                    kernel has to traverse the list. During the early days of SunOS
                    this was found to be rather expensive. So instead a bit field was devised
                    in order to determine used and open descriptor slots.
                    And guess what they used for the bit field, a byte.
                    Since process info has to be stored in kernel memory,
                    this was seen as saving space, so each process had
                    an associated bit field for the descriptor array.
                    Hence the 256 limit.
                       \_ welcome to a new century. the default hard limit is
                          now 1024. see below, limit is 256 only for standard
                          library functions, and this is removed on 64 bit
                          solaris 7. go figure. and i did say solaris, not
                          old SunOS.
        \_ Solaris max is 256 for 32-bit apps. See rlim_fd_max in
           http://docs.sun.com/db/doc/816-0607/6m735r5ev?a=view
           \_ grr. well, that's not quite true. it turns out to be 256 for
              standard library calls, like fopen. you can do 1024 using open().
              unfortunately, python seems to use fopen.
2025/05/24 [General] UID:1000 Activity:popular
5/24    

You may also be interested in these entries...
2010/2/8-18 [Computer/SW/Apps/Media, Computer/SW/Apps] UID:53695 Activity:kinda low
2/5     I like Adobe Flash. When written correctly, it scales along
        with your browser size. It looks consistent on every single
        browser. It is predictable. On the other hand, I'm not a big
        fan of CSS/HTML, which for the most part, look wildly different
        between browsers, and don't even work consistently or
        correctly at times. So why do so many people (like Steve Jobs)
	...
2009/10/27-11/3 [Computer/SW/Unix] UID:53475 Activity:nil
10/27   http://www.maxgames.com/play/flash-mind-reader.html
        how does this work?
        \_ sh -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j-(\
$i+$j)" | bc; done ; done' | uniq
        \_ bash -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j\
-($i+$j)" | bc; done ; done' | uniq
	...
2009/4/20-23 [Computer/SW/Database] UID:52876 Activity:nil
4/19    ORCL u SUNW = ORCL.
        What is Larry Ellison thinking? What is he going to do with a bunch of
        legacy Sun hardware that no one uses anymore, its fading workstation
        customer base, and open source Sun MySQL that doesn't even generate
        revenue? I really don't get all this acquisition business.
        \_ A lot of big companies still use big, fat Sun hardware. Or use
	...
2009/1/15-23 [Computer/SW/OS/OsX] UID:52398 Activity:nil
1/15    can any serious development be done on OSX that is not *for OSX*.
        i'll grant that ruby on rails has excellent tutorials for the mac.
        discuss:
        \_ What kind of serious development?  If you want to use the standard
           OSX ui then your ui code will be pretty much useless elsewhere,
           but that's why concepts like MVC are so important.  Otherwise
	...
2008/11/29-12/6 [Computer/SW/OS/FreeBSD, Computer/SW/OS/VM] UID:52129 Activity:moderate
11/29   I'm experimenting with virtualization, and as a poor college student
        I'm wondering what the best alternatives for virtualization are, and
        how best to cut my teeth on messing with non-linux platforms (or I
        guess interesting stuff on Linux would work too). Right now I've got
        FreeBSD7 running on KVM on my home computer (on a Core 2 Quad), and am
        somewhat at a loss as to how to use it. (More details: bridged
	...
2008/11/14-26 [Computer/SW/Languages/Java, Computer/SW/OS/Solaris] UID:51970 Activity:moderate
11/13   http://sfgate.com/cgi-bin/article.cgi?f=/n/a/2008/11/14/financial/f051352S72.DTL
        http://preview.tinyurl.com/6nngpm
        Sun Microsystems Inc. plans to cut up to 6,000 jobs, or 18 percent of
        its global work force, as sales of its high-end computer servers have
        collapsed.  The drastic move announced Friday highlights Sun's
        desperation to cut costs and survive as an independent company. Sun's
	...
2008/11/14-26 [Computer/SW/OS/Linux, Computer/SW/OS/Solaris] UID:51989 Activity:moderate
11/14   lulz why doesn't GOOG buy JAVA i mean SUN i mean whatever the hell they
        are these days.
        \_ Even GOOG isn't THAT stupid
           \_ Sorry, but WHY would Google do something like that? They
              run 99.2% Linux servers on the backend. They don't use
              Solaris for development. I mean, what does Sun have to
	...
2008/9/24-29 [Computer/SW/OS/Windows, Computer/SW/OS/Solaris] UID:51283 Activity:nil
9/24    Why is nscd going crazy?  DoS?
        \- back in the solaris say 2.5-2.6 era, it had both some bugs
           (some malformed nis maps made it go crazy) and architectural
           flaws in the IPC/door+threading mechanism. if you are running
           OS-recent, dunno, but you can trace it.
           \_ Yeah, I think it's just buggy.  I've restarted it, and it seems
	...
2008/4/3-9 [Computer/SW/Languages/Misc, Computer/SW/OS/Solaris] UID:49658 Activity:nil
4/3     Solaris experts: I've never played with ZFS. Does it have a native
        dump command a la ufsdump?
        \_ This might be what you are looking for:
           http://preview.tinyurl.com/2xqkda [sun - bigadmin]
	...
2008/3/30-4/6 [Computer/SW/OS/Solaris] UID:49614 Activity:nil
3/30    Question: I just deleted 60 GB of files from an 80 GB disk. The
        disk activity lights were blinking like crazy and I could hear the
        drive crunch while the data was deleted. This is under Solaris.
        Anyway, I think UNIX uses unlink() when files are deleted. Shouldn't
        it just update the free list on the superblock and call it a day?
        What is all the crunching about?
	...
2007/11/27-30 [Computer/SW/Languages/C_Cplusplus, Computer/SW/OS/Solaris] UID:48701 Activity:high
11/27   I'm using select to do a nonblocking check to see if a single socket
        has anything to read off it.  Problem is, I can have up to 12228
        file descriptors, and Linux fd_set only supports up to 4096.  Any idea
        what I can do about this?  (Or a better solution?) -jrleek
        \- 1. who are you
           2. i am busy this week and you didnt mention language
	...
Cache (6925 bytes)
docs.sun.com/db/doc/816-0607/6m735r5ev?a=view
Chapter 1 Overview of Solaris System Tuning This section provides overview information about the format of the tuning information in this manual. Tuning a Solaris System Tuning Format Tuning the Solaris Kernel Tuning a Solaris System Solaris is a multi-threaded, scalable UNIX TM operating environment running on SPARC and Intel processors. This guide provides details about the officially supported kernel tuning options available for the Solaris environment. The Solaris kernel is composed of a core portion, which is always loaded, and a number of loadable modules that are loaded as references are made to them. Many of the variables referred to in the kernel portion of this guide are in the core portion, but a few are located in loadable modules. A key consideration in system tuning is that setting various system variables is often the least effective thing that can be done to improve performance. Changing the behavior of the application is generally the most effective tuning aid available. Adding more physical memory and balancing disk I/O patterns are also useful. In a few rare cases, changing one of the variables described in this guide will have a substantial effect on system performance. Another thing to remember is that one systems /etc/system settings might not be applicable, either wholly or in part, to another environment. Carefully consider the values in the file with respect to the environment in which they will be applied. Make sure that you understand the behavior of a system before attempting to apply changes to the system variables described here. Caution The variables described here and their meanings can and do change from release to release. A release is either a Solaris Update release or a new version such as Solaris 8. Publication of these variables and their description does not preclude changes to the variables and descriptions without notice. Tuning Format The format for the description of each variable follows: Variable-Name Description Data Type Default Units Range Dynamic? Validation Implicit When to Change Commitment Level Change History Changes From Previous Release Variable-Name Variable-Name is the exact name that would be typed in the /etc/system file, or found in the /etc/default/ facility file. Most names are of the form variable where the variable name does not contain a colon : . If the name does contain a colon, the characters to the left of the colon reference the name of a loadable module. The name of the variable within the module consists of the characters to the right of the colon. Description This section briefly describes what the variable does or controls. Data Type Signed or unsigned short or long integer with the following distinctions: On a system running a 32-bit kernel, a long is the same size as an integer. On a system running a 64-bit kernel, a long is twice the width in bits as an integer. For example, an unsigned integer 32 bits, an unsigned long 64 bits. Range Possible range allowed by system validation or the bounds of the data type. MAXINT A shorthand description for the maximum value of a signed integer 2,147,483,647. MAXUINT A shorthand description for the maximum value of an unsigned integer 4,294,967,295. Yes, if it can be changed on a running system with the adb , mdb , or kadb debuggers. Validation Identifies checks the system applies to the value of the variable either as entered from the /etc/system file or the default value, as well as when the validation is applied. Implicit Optional Unstated constraints that might exist on the variable, especially in relation to other variables. When to Change Why someone might want to change this value including error messages or return codes. Many of the parameters in this manual are still evolving and are classified as unstable. Change History If applicable, contains a link to the Change History appendix, which describes parameter changes from release to release. Changes From Previous Release If applicable, contains a link to the Revision History appendix, which describes corrections from release to release. Tuning the Solaris Kernel The table below describes the different ways tuning parameters can be applied. Values specified in this file are read at boot time and are applied. Any changes made to the file are not applied to the operating system until the system is rebooted. Prior to the Solaris 8 release, /etc/system entries that set the values of system variables were applied in two phases: The first phase obtains various bootstrap variables for example, maxusers to initialize key system parameters. The second phase calculates the base configuration by using the bootstrap variables, and all values entered in the /etc/system file are applied. In the case of the bootstrap variables, reapplied values replace the values calculated or reset in the initialization phase. The second phase sometimes caused confusion to users and administrators by setting variables to values that seem to be impermissible or assigning values to variables for example, max_nprocs that have a value overridden during the initial configuration. In the Solaris 8 release, one pass is made to set all the values before the configuration parameters are calculated. ExampleSetting a Parameter in /etc/system The following /etc/system entry sets the number of read-ahead blocks that are read for file systems mounted using NFS version 2 software. Replace maxusers with the actual address of the item to be changed as well as the value the variable is to be set to. See the Solaris Modular Debugger Guide for more information on using the modular debugger. When using adb , kadb , and mdb , the module name prefix is not required because after a module is loaded, its symbols form a common name space with the core kernel symbols and any other previously loaded module symbols. For example, ufs:ufs_WRITES would be accessed as ufs_WRITES in each of the debuggers assuming the UFS module is loaded, but would require the ufs: prefix when set in the /etc/system file. Including the module name prefix using adb or kadb results in an undefined symbol message. Special Structures Solaris tuning variables come in a variety of forms. After the kernel is initialized, all references to values of these variables are found in the appropriate field of the tune structure. Various documents for example, previous versions of Solaris System Administration Guide, Volume 2 have stated that the proper way to set variables in the tune structure is to use the syntax, tune: field-name where field name is replaced by the actual variable name listed above. The proper way to set variables for this structure at boot time is to initialize the special variable corresponding to the desired field name. The system initialization process then loads these values into the tune structure. A second structure into which various tuning parameters are placed is the var structure named v .