Hey guys,
at the moment I operate with a dedicated server which is serving many video streams (using NGINX 1.2.5 with MP4 module compiled).
The Server uses 4x 2 TB SATA3 Hard Drives with a RAID Controller, configured as RAID0 for maximum speed and space.
Usually, I have no problems, but when my network output speed reaches about 120mb/s and more, the server gets a high load average of 8.0 and this is still raising.
This is not caused by any process, like nginx, php or other. The average process load reaches on this load maximal 10%. Rather, I installed iotop and checked the I/O of my server.
NGINX uses up to 99 % of the IO and this leads to the server gets in a freezed / slow mode.
I searched the MP4 Module source code and found that the read of the MP4 File is done in the function ngx_http_mp4_read by calling
n = ngx_read_file(&mp4->file, mp4->buffer_start, mp4->buffer_size, mp4->offset); on line 909.
This uses the normal read() function of the system. Why are you not using AIO for this procedure ?
Like: n = ngx_file_aio_read(&mp4->file, mp4->buffer_start, mp4->buffer_size, mp4->offset, mp4->request->pool);
Or is there any reason why this is not implented ?
Also: have you some ideas to fix my high I/O problem ?
Thank you.