Hello!
On Wed, Apr 16, 2014 at 10:24 AM, Miguel Pousa Freire wrote:
> im trying to do some image processing in the content phase,
> the process is very long(16s more or less),
Don't do that. It blocks the nginx worker process's event loop for too long.
> I have check that the process runs fine on luajit alone,
> however when calling this trough openresty nginx closes the connection
> with no output error (the error log is empty), is this normal?
It's probably that the client is timed out. Also, ensure you've
configured the "error_log" directive properly (like using the right
file and a low level like "info").
> what is the thing to do when calling slow code, can I look for example at
> some file in https://github.com/agentzh/lua-resty-mysql that should clarify
> things?
>
It's not relevant. lua-resty-mysql is (usually) IO bound so while
mysql is busy, the nginx worker process is free to process other
concurrent requests and events. You use case is CPU bound and 16s
computation time can easily kill your server with even a tiny amount
of traffic. So better optimize your image processing code and
algorithms.
Regards,
-agentzh