테스트 사이트 - 개발 중인 베타 버전입니다

aws 서버에 올라간 것과 개발 서버에 올라간 사이트의 동작이 다릅니다.

벨틱 1년 전 조회 1,123

설정이나 모든 부분이 동일한데 aws에 올라간 사이트는 정상적으로 동작을 안하고 

개발서버에 올라간 사이트는 정상 동작합니다. 어떤게 문제일까요?
문제가 G5_IS_MOBILE 세팅하는 부분을 주석 처리하면 동작하고 주석 처리 안하면 동작을 안하는데, aws와 그누보드와 연관이 있을까요? ㅠㅠㅠ
 

[ENV]
Cloud Server: AWS EC2 t3.large
DB: RDS MariaDB t3.small
Reverse Proxy: ELB

OS: Ubuntu 20.04 (Docker Image)
php: php fpm 7.4
nginx: 1.18.0

[Error]
1. php7.4-fpm.log 파일에서 확인.
=============================================================
NOTICE: systemd monitor interval set to 10000ms
WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
=============================================================

fpm/pool.d/www.conf 파일 수정.
pm.max_children = 5
에서 10으로 변경했지만 동일 증상.

=============================================================
NOTICE: systemd monitor interval set to 10000ms
WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
=============================================================

2. nginx error.log 파일에서 확인
=============================================================
[error] 23#23: *2 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 회사내부IP, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "www.~~.com"
------------------------------------------------------------------------------------------------
[error] 23#23: *506 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 회사내부IP, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "www.~~.com"
------------------------------------------------------------------------------------------------
[crit] 23#23: *444 connect() to unix:/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 회사내부IP, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "www.~~.com"
=============================================================

nginx conf 파일 수정.

------------------------------------------------------------------------------------------------
location ~ \.php$ {
   fastcgi_pass unix:/run/php/php7.4-fpm.sock;
   fastcgi_index index.php;
   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
   include fastcgi_params;
}
------------------------------------------------------------------------------------------------

해당 location 내부에 아래 설정값 추가.
fastcgi_connect_timeout   300;
fastcgi_send_timeout   300;
fastcgi_read_timeout   300;

3. DB Too Many Connection
============
화면에 표시됨
============
RDS Parameter Custom

DB에 여러 개의 Spring Boot 프로젝트가 붙어 있어,
기본적으로 커넥션이 50 ~ 80 사이로 유지되는 중.

max_connections: default → 171
wait_timeout: default → 180
max_allowed_packet: default → 67108864
interactive_timeout: default → 180

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

1년 전

unix:/run/php/php7.4-fpm.sock failed 
가 핵심 오류일 가능성이 높습니다.

 

www.conf 에 
listen = /run/php/php7.4-fpm.sock
구문 체크하여 이렇게 수정하거나, 없다면 추가해주면 됩니다.

 

이후 재시작

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

벨틱
1년 전
listen = /run/php/php7.4-fpm.sock 부분도 확인해 보았고요, 소켓통신 문제인가 해서 ip로 변경해서 테스트도 진행했지만 동일하네요.
마르스컴퍼니
1년 전
https://dongwoning.tistory.com/entry/laravel-php-fpm-nginx-docker-4-php-fpmsock%EC%9D%84-%EC%B0%BE%EC%95%84%EC%84%9C

sock 파일의 소유자 관련 문제일 수 있습니다.
www.conf 의 user, group 설정을 같이 확인해보는 것이 좋습니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인