아파치 too many connection 으로 접속이 안될 경우 채택완료
아파치 설정을 어떻게 해야 최적이 될까요?
아파치의 apache2.conf은 아래와 같이 설정했습니다.
<IfModule mpm_prefork_module>
ServerLimit 4096
StartServers 15
MinSpareServers 5
MaxSpareServers 360
MaxClients 4096
MaxRequestsPerChild 0
</IfModule>
기본적으로 메모리를 늘려야 할듯하구요
아파치 설정이 아닌 다른 부분을 확인해봐야할까요?
답변 3개
우선 db의 max_connections 이 얼마나되는지 확인해 보시기 바랍니다.
쉘로 접속하여 db로 접속후 show variables like "max_connections"; 를 입력 하시면 아래 예를 들은 이미지처럼 출력될겁니다.
https://sir.kr/data/editor/1703/c4cd56f55d8d9c122ce0bab7304e99f4_1488854403_264.png">
그후 MySQL >
set</span><span class="pln"> global max_connections </span><span class="pun">=</span><span class="pln"> </span><span class="lit">200</span><span class="pun">;
또는 my.cnf 파일에서
[mysqld] 다음 칸에 max_connections=200 을 입력하고 저장 하시면 됩니다.
만약 예를 들은 숫자보다 크다면 더크게 적용해 주면 되겠죠....^^
답변에 대한 댓글 2개
댓글을 작성하려면 로그인이 필요합니다.
병목현상이 일어나는 원인부터 찾아보세요
에러 발생시 MySQL 프로세서수를 확인해 보세요.
slowlog 확인해시고 해당 쿼리들 모두 튜닝해보세요
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 256 |
+-----------------+-------+
1 row in set (0.05 sec)
현재 256 상태입니다.