I'm altering a huge db table, disk utilization raises up to 90-100%.
Static content is being served fast as usual by NGINX, but PHP pages are loading for 10-20 seconds instead of a usual 0.2 seconds.
I have
echo 'Generated in ' . microtime( true ) - $start . ' sec.';
at the end of every page and it shows that the page was generated in 0.1 seconds, while its loading took 10+ seconds:
Request sent 0.22 ms
Waiting (TTFB) 12.84 s
Content Download 59.33 ms
Average page size is 30-40 kb, and NGINX buffers are:
fastcgi_buffers 32 32k;
fastcgi_buffer_size 64k;
So NGINX shouldn't use disk to serve the page.
Why could this happen? Is there some NGINX or PHP-FPM settings that forced them to use disk instead of keeping data in memory?