MaxClients

apache 소스 디렉토리에서
/httpd-2.2.17/server/mpm
[root@localhost mpm]# ll
drwxr-xr-x 2 master master 4096 12월 12 15:50 prefork/
drwxr-xr-x 3 master master 4096 12월 31 10:42 worker/
위의 두 디렉토리를 확인 할 수 있다

1) prefork 방식의경우
[root@localhost mpm]# vi prefork/prefork.c
#ifndef DEFAULT_SERVER_LIMIT
#define DEFAULT_SERVER_LIMIT 1024 // 기본값은 256
#endif

/* Admin can’t tune ServerLimit beyond MAX_SERVER_LIMIT. We want
* some sort of compile-time limit to help catch typos.
*/
#ifndef MAX_SERVER_LIMIT
#define MAX_SERVER_LIMIT 200000
#endif

#ifndef HARD_THREAD_LIMIT
#define HARD_THREAD_LIMIT 1
#endif

2) worker 방식의경우 ( 수정된값 64*64 = 최대 접속자수)
[root@localhost mpm]# vi worker/worker.c
*/
#ifndef DEFAULT_SERVER_LIMIT
#define DEFAULT_SERVER_LIMIT 64
#endif

/* Admin can’t tune ServerLimit beyond MAX_SERVER_LIMIT. We want
* some sort of compile-time limit to help catch typos.
*/
#ifndef MAX_SERVER_LIMIT
#define MAX_SERVER_LIMIT 20000
#endif

/* Limit on the threads per process. Clients will be locked out if more than
* this * server_limit are needed.
*
* We keep this for one reason it keeps the size of the scoreboard file small
* enough that we can read the whole thing without worrying too much about
* the overhead.
*/
#ifndef DEFAULT_THREAD_LIMIT
#define DEFAULT_THREAD_LIMIT 64
#endif

Leave your Comment

Your email address will not be published. Required fields are marked *