MySQL(4.0.16)이 자꾸 죽습니다. -_- 에러가...

GoodWolf의 이미지

며칠전부터 mysql이 자꾸 죽네요. +_+
..
로그 크기나 기타 등등을 살펴봤는데도, 이상은 없는듯 한데요,
..
파일시스템도 여유 있고요,
..
아래 로그가 남아 있네요,,

현재 4.0.16 이고 아파치는 2.0.x 입니다.. +_+ php 는 4.3.6이구요. +_+
..
에러중 일부를 가지고 구글링 해봐도 별 아웃풋은 못찾겠습니다. ㅡㅜ
..
비슷한 경험 있으신 분들의 조언 부탁드릴께요. +_+/
..

mysqld got signal 10;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=1
max_connections=100
threads_connected=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

-e
Number of processes running now: 0
060912 02:39:35 mysqld restarted
/usr/local/mysql/libexec/mysqld: Out of memory (Needed 32704 bytes)
/usr/local/mysql/libexec/mysqld: Can't read dir of '/var/tmp/' (Errcode: 11)
InnoDB: Fatal error: cannot allocate 440000 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 264 bytes. Operating system errno: 11
InnoDB: Cannot continue operation!
InnoDB: Check if you should increase the swap file or
InnoDB: ulimits of your operating system.
InnoDB: On FreeBSD check you have compiled the OS with
InnoDB: a big enough maximum process size.
InnoDB: We now intentionally generate a seg fault so that
InnoDB: on Linux we get a stack trace.
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=0
max_connections=100
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

060912 02:39:37 mysqld ended

dormael의 이미지

Number of processes running now: 0
060912 02:39:35 mysqld restarted
/usr/local/mysql/libexec/mysqld: Out of memory (Needed 32704 bytes)
/usr/local/mysql/libexec/mysqld: Can't read dir of '/var/tmp/' (Errcode: 11)

위의 메시지만 보면 재시작 하려다가 메모리가 부족해서 마지막에 실패한것 처럼 보입니다.
우선 할당 메모리를 좀 줄여서 해보시는건 어떨까요?

-- Signature --
青い空大好き。
蒼井ソラもっと好き。
파란 하늘 너무 좋아.
아오이 소라 더좋아.

GoodWolf의 이미지

지켜보니까
.
어느순간에 메모리사용량이 쭈우욱~ 올라가더라구요. +_+
..
그러다가 죽는데. ㅡㅡ;
..
일련의 과정들을 좀더 세밀히 모니터링 하고 싶은데..
..
내공이 부족하여... 마땅한 방법을 모르겠네요. ㅜㅜ
..
(아마도 아파치 프로세스가 늘어나는듯 보였는데요. ㅡㅡ;;)
..

No pains! No gains!

No pains! No gains!

dormael의 이미지

우선 공유버퍼들(MyISAM의 키버퍼, InnoDB의 버퍼, 쿼리캐시의 버퍼등)은 할당된 크기에서 세션(쓰레드)이 많아지더라도 추가적인 메모리 할당이 없으므로 우선 논외로 하겠습니다.
하지만 이것들도 가용한 메모리보다 크게 잡힌다면 문제의 소지가 있습니다.

말씀하신대로 특정 순간에 메모리 사용량이 급증하고 죽게 되는 거라면 순간적으로 많은 세션이 생성되어 메모리가 부족하게 되었을 가능성이 크네요.
세션들이 사용하는 메모리들은 주로 소트관련 버퍼나 읽기관련 버퍼들이 있습니다.
임시 메모리 테이블의 버퍼도 있을수 있구요.
쓰레도 스택도 포함이 되겠네요.

우선 최대 연결 갯수를 이 버퍼들의 크기에 맞추어서 적절한 값으로 조절하셔야 할 것 같습니다.
갯수를 줄이기가 어려운 상황이라면 버퍼의 크기를 줄이셔야 하구요.

모니터링을 위한 적절한 툴은 mysql.com에서 MySQL Administrator를 다운받아서 이용하시면 될 듯 합니다.

우선 웹상에서 튜닝에 대한 기본적인 문서들을 참고하셔서 설정을 바꿔보시고 모니터링 하신 후에 다시 결과를 알려주시면 답해주실 분들이 계실듯 합니다.

위와 같은 현상이 주로 발생하는 이유는 유저가 느린 반응 때문에 여러번 요청을 날리는 경우 입니다.
근본적으로 이런 상황에 대처하지 못하는 어플리케이션이 대부분이고 이때 db서버가 계속되는 무거운(?) 요청으로 인해 무응답 상태가 되거나 메모리 부족으로 죽을때가 있습니다.
보통은 db튜닝으로 이런 상황을 개선하기는 하지만, 최소한 메모리 부족으로 재시작 되지는 않도록 조절은 하셔야 할 듯 합니다.

-- Signature --
青い空大好き。
蒼井ソラもっと好き。
파란 하늘 너무 좋아.
아오이 소라 더좋아.

GoodWolf의 이미지

아~ 감사합니다. ^^;
..
한번 해보겠습니다~
..

No pains! No gains!

No pains! No gains!

되세김의 이미지

innodb_buffer_pool_size 를 조정해 보심이 어떨지...

보통 H/W memory보다 낮게 잡아 주면 될듯~

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.