프로그렘에서
SELECT count(*) 절이 250개
update 문이 45개 정도 됩니다.
프로그램 돌리면 돌리는 순간 show processlist 확인해보면
한 쿼리당 1초 , 2초 정도씩 한줄 한줄 쿼리문을 실행하는걸 볼수 있습니다.
어떤경우에는 5분정도뒤에 페이지에 결과 값이 나옵니다.
문제는 "페이지를 찾을수 없습니다"라고 나오는 경우가 많다는거구요..
이렇게 되다 안되다 하는걸 php튜닝을 받아보라느는 말을 하시는 분도 계시구요,
슬로우쿼리 로그를 살펴보면 해당 쿼리에는 크게 문제 없습니다.
될때도 있고 안될때도 있는건 mysql 문제가 아닐런지해서 질문 합니다.
따뜻한 답변 부탁 드립니다.
리눅스 버전확인~
[root@happycall var]# vi /etc/redhat-release
커널 버전 확인
[root@happycall happycall]# uname -a
Linux happycall.co.kr 2.6.9-78.0.1.EL #1 Tue Aug 5 10:49:42 EDT 2008 i686 i686 i386 GNU/Linux
mysql 버젼 확인
[root@happycall man]# /usr/local/mysql/bin/mysql -V
/usr/local/mysql/bin/mysql Ver 12.22 Distrib 4.0.25, for pc-linux-gnu (i686)
프로그램 실행시 메모리 체크 값입니다.
[root@happycall ~]# free -m
total used free shared buffers cached
Mem: 495 447 48 0 56 297
-/+ buffers/cache: 94 401
Swap: 1027 3 1024
# vi /etc/my.cnf (mysql 설정파일 일부 입니다.)
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
skip-name-resolve
key_buffer = 384M
max_connections = 1024
max_allowed_packet = 1M
table_cache = 1024
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
제가 볼때 아래 sleep 가 계속 증가하는게 문제가 아닐런지 해서요...
루트 접속후 확인결과 sleep이 계속 증가 하고 있네요..
mysql> show processlist;
+-------+-----------+-----------+-----------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+-----------+-----------+-----------+---------+------+-------+------------------+
| 10440 | root | localhost | NULL | Query | 0 | NULL | show processlist |
| 12628 | happycall | localhost | happycall | Sleep | 1692 | | NULL |
그런데 happycall.co.kr.err 로그에는 별거 없는것 같은데요...
/usr/local/mysql/libexec/mysqld: ready for connections.
Version: '4.0.25-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
080919 17:28:40 /usr/local/mysql/libexec/mysqld: Normal shutdown
080919 17:28:41 InnoDB: Starting shutdown...
080919 17:28:43 InnoDB: Shutdown completed
080919 17:28:43 /usr/local/mysql/libexec/mysqld: Shutdown Complete
080919 17:28:43 mysqld ended
080919 17:29:31 mysqld started
080919 17:29:31 InnoDB: Started
/usr/local/mysql/libexec/mysqld: ready for connections.
Version: '4.0.25-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
|