简体   繁体   English

php-fpm冻结ffmpeg exec上的用户会话

[英]php-fpm freeze user session on ffmpeg exec

I'm have some problem with php-fpm and ffmpeg. 我对php-fpm和ffmpeg有一些问题。

If i'm launching encoding from php just with simple exec, then for this certain user who initiate encoding all other php responses seems like a frozen(timeout or ignored). 如果我只是使用简单的exec从php启动编码,那么对于这个对所有其他php响应进行编码的用户来说,这似乎是冻结的(超时或忽略)。 So for this user site becomes fully unresponsable. 因此对于这个用户站点变得完全不负责任。

If i'm launching encoding from php but with " & " on the end of command, then all comes fine, encoding still eats cpu but site fully responsible for user. 如果我从php启动编码,但命令末尾带有“ ”,则一切正常,编码仍然吃掉cpu,但网站完全负责用户。

So maybe there is some docs or info about this behavior so i'm can get why it work this way, so where exactly it gets stuck. 因此,也许有一些关于此行为的文档或信息,这样我就可以了解为什么它会以这种方式工作,从而准确地将其卡在哪里。

Thank you 谢谢

If you launch with & on end it detaches the process from the php-fpm process so they run separately. 如果您以&开头启动,则它将与php-fpm进程分开,因此它们分别运行。 Without it the php process waits on the ffmpeg to finish before returning anything. 没有它,php进程将在返回任何内容之前等待ffmpeg完成。

If ffmpeg is a long running process and you're using sessions be sure and write the session before running ffmpeg so session won't be locked waiting on this process. 如果ffmpeg是一个运行时间很长的进程,并且您正在使用会话,请确保在运行ffmpeg之前先编写该会话,这样就不会在等待该进程的情况下锁定会话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM