1

I have noticed that php-fpm is writing something to the disk when I post raw data (~100KB). The application is blank:

<?php exit; ?>

How PHP handles post data? Is it kept in memory or it writes to the disk?

edo888
  • 398
  • 2
  • 12
  • 2
    Since this question is more about the software/server behavior than actual programming, you could try asking over at [Server Fault](http://serverfault.com/) or [Super User](https://superuser.com/). – M. Eriksson Aug 23 '18 at 20:44
  • What is the "something" and where is it written? – Patrick Q Aug 23 '18 at 20:54
  • could be like `php://temp` which keeps 2MB in memory and if it exceeds that it puts it on disc? But I don't really know... :) – ArtisticPhoenix Aug 23 '18 at 20:56
  • When I check the process i/o using top I see that php-fpm process has writes and it is for sure not logging. – edo888 Aug 23 '18 at 20:57
  • 2
    How have you determined that it's writing and not reading? Also, you've basically posted the same question a few times since almost a year back. If you don't get enough answers, you should bump those questions instead of posting more or less duplicates. This one does have an answer which you haven't acknowledged: https://stackoverflow.com/questions/46597383/post-ing-to-php-fpm-increases-disk-i-o-writes. – M. Eriksson Aug 23 '18 at 21:04

1 Answers1

0

Turns out the answer is YES. PHP writes data into upload_tmp_dir for POST requests.

To avoid PHP writing to the disk you can use ram drive (tmpfs on FreeBSD).

edo888
  • 398
  • 2
  • 12