Korea FreeBSD Users Group News, Internal, Projects, Home
Software, Support, Documentation

Re: Ä¿³ÎÄÄÆÄÀÏ¿¡¼­



[ ³¯Â¥¼ø »öÀÎ ] [ ´ñ±Û¼ø »öÀÎ ] [ ÃÖ»óÀ§ »öÀÎ]

[ÀÌÀü ±Û] [´ÙÀ½ ±Û] [ÀÌÀü ´ñ±Û] [´ÙÀ½ ´ñ±Û]


>>>>> "q" == questions:114  <KFUG> writes:

    q> ù¹øÂ° Áú¹®: maxusersÀÇ ÃÖ´ë°ªÀº ¾ó¸¶±îÁö ÀԴϱî?
    q>             maxusers 1000000 µµ °¡´ÉÇմϱî?
    q>             Á¦»ý°¢¿¡´Â 32768À» ³ÑÁö ¸øÇÒ°Í °°°Åµç¿ä.

¿Ö 32768À̶ó°í »ý°¢ÇϽÃÁÒ?

param.c¿¡ º¸¸é

#define NPROC (20 + 16 * MAXUSERS)
#define MAXFILES (NPROC*2)
int     maxproc = NPROC;               /* # of processes */
int     maxprocperuid = NPROC-1;       /* maximum # of processes per us
er */
int     maxfiles = MAXFILES;           /* system wide open files limit */
int     maxfilesperproc = MAXFILES;    /* per-process open files limit */

¿¡ ³ª¿ÍÀÖÀ¸´Ï±î.... Ä¿³Î Å×À̺íÀº º¸Åë ½º¿ÒÇÏÁö ¾Ê´Â ¸Þ¸ð¸® »ó¿¡¼­
»ç¿ëÇÏ´Ï±î ±× Á¦ÇÑ À̳»¿¡¼­ ÇÒ´çÇÏ´Â °ÍÀº °¡´ÉÇÒ °ÍÀÔ´Ï´Ù. ÀÌ Å×À̺íÀº
sysctl¿¡ ÀÇÇØ Á¶Á¤µÉ ¼ö ÀÖÀ¸¹Ç·Î(Áï µ¿ÀûÀ̹ǷÎ) ±×¶§±×¶§ »ý¼ºÇؼ­
»ç¿ëÇϴϱî, ÇöÀç Ä¿³Î¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ¸Þ¸ð¸®ÀÇ ¾ç¿¡ µû¶ó Á¿ìµÉ
°Ì´Ï´Ù.

    q> µÎ¹øÂ° Áú¹®: getrlimit(RLIMIT_NPROC,&rlim);À» »ç¿ëÇßÀ»¶§
    q>             rlim.rlim_cur=64, rlim.rlim_max=0ÀÇ °ªÀÌ ³ª¿À´Âµ¥
    q>             maxusers¿¡¼­ °ªÀ» ´Ã¸®¸é À§Àǰªµµ ´Ã¾î³ª¾ß ÇÏÁö ¾Ê³ª¿ä?

limit¿¡´Â ¼ÒÇÁÆ® Á¦ÇѰú Çϵå Á¦ÇÑÀÌ ÀÖ½À´Ï´Ù. (man getrlimit)

     A resource limit is specified as a soft limit and a hard limit.  When a
     soft limit is exceeded a process may receive a signal (for example, if
     the cpu time or file size is exceeded), but it will be allowed to contin-
     ue execution until it reaches the hard limit (or modifies its resource
     limit).  The rlimit structure is used to specify the hard and soft limits
     on a resource,

MAXUSERSÀÇ °ªÀº Ä¿³Î¿¡¼­ Çã¿ëÇÒ ¼ö ÀÖ´Ù´Â °ªÀ̰í, ½ÇÁ¦ÀÇ Á¦ÇÑÀº À̺¸´Ù
ÀÛ½À´Ï´Ù. ÇÊ¿äÇÏ´Ù¸é MAXUSERS¿¡ ±â¹ÝÇÑ °è»ê½Ä(À§ ¼Ò½º)ÀÇ Çѵµ ³»¿¡¼­
ÀÌµé °ªÀ» ÁöÁ¤ÇÒ ¼ö°¡ ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î 

#!/bin/sh
sh this-script

¶ó´Â ÆÄÀÏÀ» this-script¶ó´Â À̸§À¸·Î ÀúÀåÇÏ¿© ½ÇÇàÇÏ¸é ¹«ÇÑÈ÷
fork()ÇÏ°Ô µÇ´Âµ¥, ÀÌ·¯¸é ½Ã½ºÅÛÀÌ ´Ù¿îµÇ¾î ¹ö¸®¹Ç·Î ÇÑ ÇÁ·Î¼¼½º
³»¿¡¼­ ¸¸µé ¼ö ÀÖ´Â childÀÇ ¼ö µîÀ» Á¦ÇÑÇϵµ·Ï µÇ¾î ÀÖ½À´Ï´Ù. ÇÊ¿äÇϸé
Ç®¾î³õ°í »ç¿ëÇÏ½Ã¸é µÇ°ÚÁÒ(man sysctl).

    q> ¼¼¹ö° Áú¹®: CHILD_MAX ¿Í OPEN_MAX ÀÇ °ªÀº ¹«¾ùÀ» ÀǹÌÇմϱî?
    q> Àú´Â ºÎ¸ðÇÁ·Î¼¼½º¸¦ Çϳª ½ÇÇàÇÑÈÄ¿¡ ¾à16000°³¿¡¼­ 32000°³ÀÇ
    q> ÀÚ½ÄÇÁ·Î¼¼½º¸¦ ¸¸µé·Á°í Çϰŵç¿ä.
    q> °¨»çÇÕ´Ï´Ù...

    q> # Under some circumstances it is convenient to increase the defaults
    q> # for the maximum number of processes per user and the maximum number
    q> # of open files files per user.  E.g., (1) in a large news server, user
    q> # `news' may need more than 100 concurrent processes.  (2) a user may
    q> # need lots of windows under X.  In both cases, it may be inconvenient

    q> # to start all the processes from a parent whose soft rlimit on the
    q> # number of processes is large enough.  The following options work by
    q> # changing the soft rlimits for init.
    q> #
    q> options         CHILD_MAX=128
    q> options         OPEN_MAX=128

À§ÀÇ ¼³¸í ±×´ë·Î, CHILD_MAX´Â ÇÑ ÇÁ·Î¼¼½º°¡ fork()ÇÒ ¼ö ÀÖ´Â ÃÖ´ë
ÇÁ·Î¼¼½º °¹¼ö, OPEN_MAX´Â ÇÑ ÇÁ·Î¼¼½ºÀÇ ÆÄÀÏ µð½ºÅ©¸³ÅÍ Å×À̺íÀÇ ÃÖ´ë
°¹¼ö°ÚÁÒ. Áï ÇÑ ÇÁ·Î±×·¥¿¡¼­ 128°³ ÆÄÀÏ ÀÌ»óÀ» µ¿½Ã¿¡ ¿­ ¼ö ¾ø´Ù´Â °Ì´Ï´Ù.

¸»¾¸µå·ÈÁö¸¸ ÇÑ ½Ã½ºÅÛ¿¡¼­ ¿­ ¼ö ÀÖ´Â ÇÁ·Î¼¼½º °¹¼ö´Â ±×·¸°Ô ¸¹Áö
¾Ê½À´Ï´Ù. Å×À̺íÀ» ¾Æ¹«¸® ´Ã·Áµµ, 486Á¤µµ¸é 10000°³°¡ ¾Æ´Ï¶ó 2000°³¸¸
³Ñ¾îµµ ½Ã½ºÅÛÀÌ °ÅÀÇ ¸À°¥ °Ì´Ï´Ù. (¿£ÅÍŰ Ä¡¸é 5ºÐ ÀÖ´Ù ÇÁ·ÒÇÁÆ®°¡
³ª¿Â´Ùµç°¡) Çѹø ÇØº¸¼¼¿ä. :) ÆæÆ¼¾ö II 400MHZ µÎ°³Â¥¸® SMPÁ¤µµ¶ó¸é ´õ
¸¹ÀÌ ¸¸µé ¼ö ÀÖ°ÚÁÒ(ÇÑ 5000°³?) Á¤È®È÷´Â Àß ¸ð¸£°Ú½À´Ï´Ù.

-- 
 ----Cool FreeBSD!----MSX Forever!---J.U.N.K.E.R/Beat Snatchers!----
  CHOI Junho <junker@jazz.snu.ac.kr>  http://jazz.snu.ac.kr/~junker
 Distributed Computing System Lab,CS Dept.,Seoul National Univ., ROK



[ ³¯Â¥¼ø »öÀÎ ] [ ´ñ±Û¼ø »öÀÎ ] [ ÃÖ»óÀ§ »öÀÎ]

Copyright © 1998-2005 Korea FreeBSD Users Group.
All rights reserved. webmaster at kr.FreeBSD.org
$Date: 2002/03/26 13:38:29 $
Powered by FreeBSD