Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tengine 2.5.1 print log bug #1607

Closed
liketic opened this issue Jan 13, 2022 · 2 comments
Closed

Tengine 2.5.1 print log bug #1607

liketic opened this issue Jan 13, 2022 · 2 comments
Assignees

Comments

@liketic
Copy link

liketic commented Jan 13, 2022

Ⅰ. Issue Description

msg:490#490: *978936 write() to "log file" failed (11: Resource temporarily unavailable) while logging request, client: 11.199.94.62, server: , request: "POST / HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/fcgi.sock", host: "xxx"

Ⅱ. Describe what happened

从错误时间看,可以确定和日志轮转有关。

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

Ⅴ. Anything else we need to know?

  1. If applicable, add nginx debug log doc.

Ⅵ. Environment:

  • Tengine version (use sbin/nginx -V):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Others:
@yangyingda2020
Copy link

I encountered the same issue using Tengine 2.5.4.

I can confirm no relate with logrotate

@drawing drawing self-assigned this Nov 14, 2024
@drawing
Copy link
Collaborator

drawing commented Nov 14, 2024

tengine worker进程通过管道写入日志rollback进程,滚动时删除文件可能导致rollback进程卡顿导致,导致管道写满日志丢失。由于异步写入,无法绝对避免此问题:

缓解此问题方案:

  1. 通过 add change pipe size command #1965 增加设置pipe大小指令,通过适当调大管道大小,可以在rollback进程卡顿时缓解问题
  2. 通过第三方程序如 crontab 脚本定时删除一段时间内无写入的日志文件,通过外部进程异步删除文件,不会导致rollback卡顿
  3. 如要保证完全不丢失日志,只能改为同步写文件,但是会导致磁盘卡顿时影响 worker 进程,不推荐使用

@drawing drawing closed this as completed Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants