I decided to make php scripts non-blocking, which means that all data posted to script is read to memory, before script runs. While all data sent by script is also cached to memory, and transfered to client after script finishes successfully.
So, outputting 500kb from php consumes 500kb of memory. I will change this behaviour at later point => then output exceeding the memory buffer will be cached to file instead.
|