用一段时间,nginx 占CPU 就会飙升100, 重启nginx 又可正常一断时间,
进程跟踪发现是ngx_mpegts_gop_cache这个函数吃CPU 太历害了
![IMG_20200625_143732](https://user-images.githubusercontent.com/67410215/85675920-b56a2b00-b6f8-11ea-955c-f1766c4213e0.jpg)
nginx version :1.17.3
nginx 错误日志记录 大部多是如下面这样
2020/06/25 15:01:31 [error] 125972#125972: *1539 gop, current gop pos is NULL, skip to new postion [pos 1 last 1] 1441, client: unix:, server: 0.0.0.0:1935, session: 00007F26D1426B40, stream: 000/live/2
2020/06/25 15:01:31 [error] 125972#125972: *32 gop, current gop pos is NULL, skip to new postion [pos 1 last 1] 1441, client: unix:, server: 0.0.0.0:1935, session: 00007F26D117C080, stream: 000/live/2
2020/06/25 15:01:31 [error] 125972#125972: *1539 gop, current gop pos is NULL, skip to new postion [pos 1 last 3] 3, client: unix:, server: 0.0.0.0:1935, session: 00007F26D1426B40, stream: 000/live/2
2020/06/25 15:01:31 [error] 125972#125972: *32 gop, current gop pos is NULL, skip to new postion [pos 1 last 3] 3, client: unix:, server: 0.0.0.0:1935, session: 00007F26D117C080, stream: 000/live/2
2020/06/25 15:01:31 [error] 125972#125972: *1666 mpegts-gop: link| current gop pos is NULL, skip to new postion [pos 0 last 1] 1439, server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:31 [error] 125977#125977: *105 gop, current gop pos is NULL, skip to new postion [pos 1 last 1] 1441, client: unix:, server: 0.0.0.0:1935, session: 00007F26D0B9A7C0, stream: 000/live/3
2020/06/25 15:01:31 [error] 125977#125977: *105 gop, current gop pos is NULL, skip to new postion [pos 1 last 3] 3, client: unix:, server: 0.0.0.0:1935, session: 00007F26D0B9A7C0, stream: 000/live/3
2020/06/25 15:01:36 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:36 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:37 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:37 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:38 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:38 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:38 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:39 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2
2020/06/25 15:01:39 [error] 125972#125972: *1666 hls_http: write_handler| send error (32: Broken pipe), server: 0.0.0.0:1935, session: 00007F26B8DA7C00, stream: 000/live/2