그누보드 세션 문제? "Unable to clear session lock record in Unknown on line 0" 에러
본문
안녕하세요.
먼저 제 웹서버에서 매일같이 나오는 에러로그는 다음과 같습니다.
[root@test sites-enabled]# tail /var/log/nginx/error.log
2021/02/17 00:48:09 [error] 5751#5751: *13719 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.92, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&sop=and&stx=%ED%98%B8%EB%B9%B5%EB%A7%A8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/board.php?bo_table=gallery&wr_id=184813"
2021/02/17 00:48:09 [error] 5751#5751: *13693 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.92, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&sop=and&stx=%ED%98%B8%EB%B9%B5%EB%A7%A8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/board.php?bo_table=gallery&wr_id=184813"
2021/02/17 00:48:09 [error] 5751#5751: *13670 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.92, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&sop=and&stx=%ED%98%B8%EB%B9%B5%EB%A7%A8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/board.php?bo_table=gallery&wr_id=184813"
2021/02/17 00:48:10 [error] 5750#5750: *13699 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.92, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&sop=and&stx=%ED%98%B8%EB%B9%B5%EB%A7%A8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/board.php?bo_table=gallery&wr_id=184813"
2021/02/17 00:48:13 [error] 5751#5751: *13697 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.92, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&sop=and&stx=%ED%98%B8%EB%B9%B5%EB%A7%A8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/board.php?bo_table=gallery&wr_id=184813"
2021/02/17 00:48:16 [error] 5751#5751: *13762 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.92, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&sop=and&stx=%ED%98%B8%EB%B9%B5%EB%A7%A8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/board.php?bo_table=gallery&wr_id=184813"
2021/02/17 00:48:27 [error] 5750#5750: *13836 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.92, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&sop=and&stx=%ED%98%B8%EB%B9%B5%EB%A7%A8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/board.php?bo_table=gallery&wr_id=184813"
2021/02/17 00:48:48 [error] 5753#5753: *14823 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.250, server: my-domain.net, request: "GET /bbs/search.php?srows=10&sfl=wr_subject%7C%7Cwr_content&stx=%EC%9D%B4%EC%84%B1%EC%95%A0%EC%9E%90%EB%A1%9C HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/search.php?sfl=wr_subject%7C%7Cwr_content&stx=%EB%A7%8C%ED%99%94%EC%86%8D&sop=and&gr_id=&onetable=best"
2021/02/17 00:48:49 [error] 5750#5750: *15703 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.250, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&stx=%EB%A7%8C%ED%99%94%EC%86%8D&sop=and&gr_id= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/search.php?sfl=wr_subject%7C%7Cwr_content&stx=%EB%A7%8C%ED%99%94%EC%86%8D&sop=and&gr_id=&onetable=best"
2021/02/17 00:48:49 [error] 5748#5748: *15631 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to clear session lock record in Unknown on line 0" while reading response header from upstream, client: 162.158.118.250, server: my-domain.net, request: "GET /bbs/search.php?sfl=wr_subject%7C%7Cwr_content&stx=%EB%A7%8C%ED%99%94%EC%86%8D&sop=and&gr_id= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "my-domain.net", referrer: "https://my-domain.net/bbs/search.php?sfl=wr_subject%7C%7Cwr_content&stx=%EB%A7%8C%ED%99%94%EC%86%8D&sop=and&gr_id=&onetable=best"
해결방법을 찾으려고 다망히 노력했지만 단편적인 정보밖에 구할수 없었습니다.
어느 블로그에서 보기로는 memcache의 문제로, "그누보드는 세션폴더를 별도로 지정해서 쓰기 떄문에 에러가 난다" 라고 하시더라구요.
https://www.enteroa.com/tag/php-memcached/
접속자가 많아지면서 해당 에러가 수초 간격으로 계속 발생하니 서버에도 부하가 되는것 같습니다..ㅠ
부족한 영어로 구글링을 해보니 급격한 접속자 증가가 원인으로 최적화를 위해 php.ini에서 memcached 설정을 수정한다던가, lazy_write를 비활성화하면 된다던가 싶은 내용도 있었지만 뭔가 방법이 확실치가 않고 정보가 적어 시도하지 못하고 있습니다...
[root@test sites-enabled]# vi /etc/php.ini
[memcache]
extension_dir=/usr/lib64/php/modules/
extension=memcache.so
memcache.allow_failover=1
memcache.max_failover_attempts=100
memcache.chunk_size=32768
원인과 대처방법이 뭔가 있을까요?
memcache의 최적화를 한다면 수치를 정하는데 어떤 기준이 있을까요? (사이트 동접자는 1천명~2천명 사이입니다)
조언을 부탁드립니다.
!-->!-->답변 1
php.ini 에 [memchache] 하단에 session.lazy_write => Off 를 추가 하시고 아파치 재시동후 테스트 해 보세요.
그리고 그누보드 config.php 파일에 define('G5_USE_CACHE', true); // 최신글등에 cache 기능 사용 여부 이 있는데 이것도 false 로 수정해서 사용해 보세요.
답변을 작성하시기 전에 로그인 해주세요.