시스템관리자의 쉼터 커피닉스 커피향이 나는 *NIX
커피닉스
시스템/네트웍/보안을 다루는 곳
 FAQFAQ   검색검색   멤버리스트멤버리스트   사용자 그룹사용자 그룹   사용자 등록하기사용자 등록하기 
 개인 정보개인 정보   비공개 메시지를 확인하려면 로그인하십시오비공개 메시지를 확인하려면 로그인하십시오   로그인로그인 

가입없이 누구나 글을 쓸 수 있습니다. 공지사항에 대한 댓글까지도..




BBS >> 설치, 운영 Q&A | 네트웍, 보안 Q&A | 일반 Q&A || 정보마당 | AWS || 자유게시판 | 구인구직 || 공지사항 | 의견제시
mysql 데몬이 다운이 됩니다...ㅠ,,ㅠ

 
글 쓰기   답변 달기    커피닉스, 시스템 엔지니어의 쉼터 게시판 인덱스 -> 시스템 설치 및 운영
이전 주제 보기 :: 다음 주제 보기  
글쓴이 메시지
mysql 최적화
손님





올리기올려짐: 2005.3.10 목, 5:54 pm    주제: mysql 데몬이 다운이 됩니다...ㅠ,,ㅠ 인용과 함께 답변 글 편집/삭제

현재 웹서버 6대 / 디비서버 1대 로 로드발란싱을 하면서 서비스를 운영하고 있습니다.
많은 접속자로 디비가 처리를 제대로 하지 못하면서 데몬이 자주 다운이 됩니다.
나름대로 튜닝을 하고 있지만 죄대로 되지를 않습니다.
그래서 도움을 받고자 이렇게 글을 올립니다.
아래의 내용을 보시고 도움을 주셨으면 합니다.
그리구 디비서버를 2-3대로 운영할수 있는 방안이 있는지... 궁금합니다.
감사합니다.
------------------------------------------------------------------------------------------------
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=1073741824
read_buffer_size=16773120
max_used_connections=922
max_connections=1500
threads_connected=750
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 2287748 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

You seem to be running 32-bit Linux and have 750 concurrent connections.
If you have not changed STACK_SIZE in LinuxThreads and built the binary
yourself, LinuxThreads is quite likely to steal a part of the global heap for
the thread stack. Please read http://www.mysql.com/doc/L/i/Linux.html

thd=0x87097988
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x8c7fe988, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x808b47a
0x82c7680
0x80e5468
0x80b93f9
0x80b3285
0x80b1ebd
0x8097ea0
0x809c30d
0x8096fc9
0x8096b60
0x80964c1
0x82c2ecd
0x82f7967
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x90ffcd8 = select code from goods where (vflag='y' and maker='a') and (gtype=131 or gtype2=131 or gtype3=131 or gtype4=131) and (gtype<710 or gtype>719) order by ordnum DESC
thd->thread_id=1052422
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
------------------------------------------------------------------------------------------------
위로
재윤아빠
손님





올리기올려짐: 2005.3.11 금, 10:48 am    주제: 설정파일도 첨부하시면 더욱 좋겠네요. 인용과 함께 답변 글 편집/삭제

/etc/my.cnf 파일의 내용을 첨부하시는게
답변을 받기에 빠를듯 보이네요.

제 경험상으로도 저 got signal 11은 지겨워서.. ㅡ.ㅡ;;;;;

또한 binlog, SlowQueryLog를 살펴보세요.

그리고 가장 중요한거.. mysql이 실행권한 유저가 뭐냐에 따라 저렇게 에러나면서 바로바로 사망하던 데몬이 정상적으로 돌아가네요... ㅡ.ㅡ;;;;
위로
손님






올리기올려짐: 2005.3.12 토, 11:36 am    주제: my.cnf 설정 첨부 인용과 함께 답변 글 편집/삭제

my.cnf 첨부 해드립니다.
서버사양은 아래의 정보를 참조해 드립니다.
----------------------------------------------------------------------
cpu: Intel(R) Xeon(TM) MP CPU 2.50GHz * 4
mem:4gb
swap: 3gb
----------------------------------------------------------------------
[mysqld]
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/mysql/data
skip-locking
set-variable = key_buffer=1024M
set-variable = max_allowed_packet=1M
set-variable = table_cache=4096
set-variable = sort_buffer=64M
set-variable = record_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = thread_cache=24
set-variable = max_connections=5000
set-variable = wait_timeout=30
# Try number of CPU's*2 for thread_concurrency
set-variable = thread_concurrency=24
set-variable = max_connect_errors=5000
----------------------------------------------------------------------
위로
truefeel
카페 관리자


가입: 2003년 7월 24일
올린 글: 1277
위치: 대한민국

올리기올려짐: 2005.3.14 월, 11:16 pm    주제: Re: my.cnf 설정 첨부 인용과 함께 답변

Anonymous 씀:
my.cnf 첨부 해드립니다.
서버사양은 아래의 정보를 참조해 드립니다.
----------------------------------------------------------------------
cpu: Intel(R) Xeon(TM) MP CPU 2.50GHz * 4
mem:4gb
swap: 3gb
----------------------------------------------------------------------
[mysqld]
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/mysql/data
skip-locking
set-variable = key_buffer=1024M
set-variable = max_allowed_packet=1M
set-variable = table_cache=4096
set-variable = sort_buffer=64M
set-variable = record_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = thread_cache=24
set-variable = max_connections=5000
set-variable = wait_timeout=30
# Try number of CPU's*2 for thread_concurrency
set-variable = thread_concurrency=24
set-variable = max_connect_errors=5000
----------------------------------------------------------------------



H/W 사양은 님과 비슷하게
MEM 4G, SWAP 4G,
Xeon 2.8GHz x 4 에 다음과 형태의 설정을 사용하고 있습니다.
단, OS가 FreeBSD입니다.

인용:

key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
max_connections=2048
max_connect_errors=100
wait_timeout=30
connect_timeout=5
record_buffer=4M


초당 쿼리는 약 300~1000개 정도 되구요,
MySQL이 죽는 경우 없습니다.

그리고, 위의 에러 메시지에 나온 문서들을 찾아서 시도는 해보신거죠?

인용:

그리구 디비서버를 2-3대로 운영할수 있는 방안이 있는지... 궁금합니다.


1. 용도별로 나누기

DB를 1대에서 2-3대로 운영을 한다면, 용도별로 DB서버를 나누는게 좋을 것 같습니다.
웹서비스나 DB 쿼리에서 큰 부분을 차지하는게 어떤 것인지 파악을 하세요.
이를테면 회원 DB, 게시판 DB, 기타 자료 등등...
용도에 따라 분산을 하면 하나의 웹페이지에서 여러 DB서버에 query를 날려
한 DB서버당 초당 쿼리가 줄어들겠지요.

물론 slow query등을 잘 파악하여 DB 설계 변경하는 것은 물론이구요.

2. MySQL Replication 사용

DB 서버가 2대라고 할 때 1대는 Master, 나머지 1대는 Slave로 설정을 하면
Master 에 I/U/D가 적용되면 Slave에서도 같은 data결과가 저장됩니다.
즉, 같은 내용의 DB가 2대가 생기는 겁니다.
그래서, Insert/U/D/S는 Master에서 Slave에서는 Select만을 하여
query를 분산할 수 있습니다.

이에 대해서는
http://coffeenix.net/index.php?cata_code=45
http://dev.mysql.com/doc/mysql/en/replication.html

에서 찾아 읽어보세요.
위로
사용자 정보 보기 비밀 메시지 보내기 글 올린이의 웹사이트 방문
이전 글 표시:   
글 쓰기   답변 달기    커피닉스, 시스템 엔지니어의 쉼터 게시판 인덱스 -> 시스템 설치 및 운영 시간대: GMT + 9 시간(한국)
페이지 1 중 1

 
건너뛰기:  
새로운 주제를 올릴 수 없습니다
답글을 올릴 수 없습니다
주제를 수정할 수 있습니다
올린 글을 삭제할 수 없습니다
투표를 할 수 없습니다


Powered by phpBB © 2001, 2005 phpBB Group