원인은 알수 없어도 일단 mysqld 가 제대로 작업을 종료하고 나서 죽질 않고 있는 것 같습니다. 아마도 프로그래밍상의 문제가 아닐까 생각중입니다.
1. pconnect 를 사용한다면 모두 connect 로 바꾸어 주십시오. pconnect 는 접속 하나 마다 전용적인 connection 을 만들어 close 하지 않는한 지속적으로 오픈하고 있더군요.
2. 만약 그래도 계속 저런 현상이 생긴다면, table 을 이용하기 전후로 lock table; unlock table; 명령어를 이용하여 exclusive 한 사용권을 사용자에게 주는 방향으로 프로그래밍을 고쳐 보시기 바랍니다.
::정운성 님께서 쓰시길::
> 웹서버에 요즘 사용자가 많이 몰리고 있는데, 시스템이 버티질 못하고 자꾸
>
> 멈춰버립니다.
>
> P-III 550 dual에 256MB 메모리 4개를 쓰고 있습니다.
>
> "무슨일이 일어나고 있기에..?" 하는 생각에 접속을 하려고 하면,
>
> [wowmaster@wow3 wowmaster]$ su -
> Password:
> bash: fork: Resource temporarily unavailable
> bash#
>
> 와 같은 에러메시지와 함께 root로 들어갈수도 없구요 T_T
>
> 그래서 이것저것 해본 결과인데요.. 이걸 어찌해야 할지요.
>
> [wowmaster@wow3 wowmaster]$ ps -ef|grep sql|wc
> 2046 18415 165702
>
> [wowmaster@wow3 wowmaster]$ free
> total used free shared buffers cached
> Mem: 1036184 309740 726444 64688 147936 42396
> -/+ buffers/cache: 119408 916776
> Swap: 530104 0 530104
>
> [wowmaster@wow3 wowmaster]$ vmstat 5 5
> procs memory swap io system cpu
> r b w swpd free buff cache si so bi bo in cs us sy id
> 2 0 0 0 728468 147936 42396 0 0 0 3 430 375 10 16 74
> 2 0 0 0 728468 147936 42396 0 0 0 12 7643 157 8 92 0
> 3 0 0 0 727476 147936 42396 0 0 0 7 9154 177 9 91 0
> 2 0 0 0 728460 147936 42396 0 0 0 20 7953 167 9 91 0
> 2 0 0 0 728460 147936 42396 0 0 0 3 8750 159 8 92 0
>
>
> 그리고 mysql을 시작하는 스크립트는
>
> /usr/local/bin/mysqladmin shutdown
> /usr/local/bin/safe_mysqld -O max_connections=4096 -O max_connect_errors=999999999 &
>
> 입니다.
>
> 커널은 현재 2.2.14 버젼을 쓰고 있구요
>
> 마지막으로 이 화면을...
>
> [wowmaster@wow3 wowmaster]$ ps -ef|grep sql
> root 657 1 0 Aug03 pts/0 00:00:00 sh /usr/local/bin/safe_mysqld -O
> root 670 657 0 Aug03 pts/0 00:00:28 /usr/local/libexec/mysqld --base
> root 672 670 0 Aug03 pts/0 00:00:31 /usr/local/libexec/mysqld --base
> root 673 672 0 Aug03 pts/0 00:00:19 /usr/local/libexec/mysqld --base
> root 22428 672 95 07:20 pts/0 02:23:40 /usr/local/libexec/mysqld --base
> root 22429 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22430 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22431 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22432 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22433 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22434 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22435 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22436 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22440 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22441 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22442 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22443 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22445 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22446 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22453 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22454 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22455 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22457 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22460 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22465 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22467 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22469 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22470 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22471 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22472 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22474 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22476 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22477 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22478 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22479 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22480 672 0 07:20 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> root 22484 672 0 07:21 pts/0 00:00:00 /usr/local/libexec/mysqld --base
> .
> .
> .
> (계속)
>
> -_-;
>
> 그럼 무지한 저에게 빛을...
>
> 즐거운 하루되세요.
|