POST大原始数据时,PHP是否正在将磁盘写入磁盘?
问题描述:
我注意到当我发布原始数据(〜100KB)时,php-fpm正在向磁盘写一些东西.该应用程序为空白:
I have noticed that php-fpm is writing something to the disk when I post raw data (~100KB). The application is blank:
<?php exit; ?>
PHP如何处理帖子数据?是保存在内存中还是写入磁盘?
How PHP handles post data? Is it kept in memory or it writes to the disk?
答
答案是肯定的. PHP将数据写入POST请求的upload_tmp_dir中.
Turns out the answer is YES. PHP writes data into upload_tmp_dir for POST requests.
要避免PHP将数据写入磁盘,可以使用ram驱动器(在FreeBSD上为tmpfs).
To avoid PHP writing to the disk you can use ram drive (tmpfs on FreeBSD).