<div dir="ltr"><div><div><div><div>oooppp sorry found the cause "client_body_in_file_only on" changed it to clean and it's doing it's job.<br><br></div>but am i missing something on PHP side or config side as it seems i am getting the same response time using php-fpm without the accelerated support settings<br>
</div>and also using php-cgi, response time is the same for all scenarios.<br><br><br></div>with accelerated support using php-fpm:<br>10.254.12.84 - - [15/Aug/2013:10:26:05 +0800] "POST /curlupload.php HTTP/1.1" 200 359 "-" "-" "-" 33.404 1.342 .<br>
10.254.12.84 - - [15/Aug/2013:10:26:51 +0800] "POST /curlupload.php HTTP/1.1" 200 359 "-" "-" "-" 32.168 1.216 .<br><br></div>without accelerated support using php-fpm:<br><div>10.254.12.84 - - [15/Aug/2013:11:02:58 +0800] "POST /curlupload.php HTTP/1.1" 200 359 "-" "-" "-" 32.182 1.229 .<br>
10.254.12.84 - - [15/Aug/2013:11:03:32 +0800] "POST /curlupload.php HTTP/1.1" 200 359 "-" "-" "-" 33.218 1.208 .<br><br></div><div>using php-cgi<br>10.254.12.84 - - [15/Aug/2013:11:48:57 +0800] "POST /curlupload.php HTTP/1.1" 200 359 "-" "-" "-" 32.371 1.418 .<br>
10.254.12.84 - - [15/Aug/2013:11:49:30 +0800] "POST /curlupload.php HTTP/1.1" 200 359 "-" "-" "-" 33.093 1.308 .<br><br></div><div><br><div>TIA<br><br></div><div>Regards,<br>Ron<br>
</div><div><br><br><br><br><br><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 14, 2013 at 7:19 PM, ron ramos <span dir="ltr"><<a href="mailto:nhadie@gmail.com" target="_blank">nhadie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi All,<br><br></div>I am trying to test accelerated upload on nginx/php-fpm/php-cgi setup and comparing different scenarios<br>
</div>e.g one where /temp is a tmpfs, one where it is a disk partition and you will also notice where in i test using php-cgi. as i need to understand which can handle file uploads faster.<br>
<div><br><br> location ~ \.php$ {<br> include fastcgi_params;<br><br> client_body_temp_path /temp;<br> fastcgi_pass_request_body off;<br> client_body_in_file_only on;<br>
fastcgi_param REQUEST_BODY_FILE $request_body_file;<br><br> #use php-cgi<br> #fastcgi_pass <a href="http://127.0.0.1:10005" target="_blank">127.0.0.1:10005</a>;<br><br> #use php-fpm<br>
fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br><br> fastcgi_index $dir_index;<br> fastcgi_param DOCUMENT_ROOT $doc_root;<br> fastcgi_split_path_info ^(.+?\.php)(/.*)$;<br>
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br> }<br><br></div><div>i encountered one issue where in the /temp is a tmpfs (size is just 1GB), after uploading a couple of files i encountered this: *58 pwrite() "/temp/0000000053" failed (28: No space left on device)<br>
<br></div><div>shouldn't it be flushed once the upload is done? or do i need to add some config to flush it automatic?<br></div><div><br><br></div><div>Im using a php script that uses curl to do the uploading, here's the script that manages the upload (curlupload.php)<br>
<br><?php<br>$uploadfile = "upload/" . basename($_FILES['file_contents']['name']);<br> if (move_uploaded_file($_FILES['file_contents']['tmp_name'], $uploadfile)) {<br> echo "File is valid, and was successfully uploaded.\n";<br>
unlink($uploadfile);<br> } else {<br> echo "Possible file upload attack!\n";<br> }<br> print_r($_FILES);<br> print_r($_POST);<br>?><br><br></div><div>
i removed the file after it is uploaded so i can run this script in loop, the script that uploads the file: (testupload.php)<br><br><?php<br> $target_url = '<a href="http://10.254.12.160/curlupload.php" target="_blank">http://10.254.12.160/curlupload.php</a>';<br>
<br> $file_name_with_full_path = realpath('./test.exe');<br><br> $post = array('extra_info' => '123456','file_contents'=>'@'.$file_name_with_full_path);<br><br>
$ch = curl_init();<br>
curl_setopt($ch, CURLOPT_URL,$target_url);<br> curl_setopt($ch, CURLOPT_POST,1);<br> curl_setopt($ch, CURLOPT_POSTFIELDS, $post);<br> $result=curl_exec ($ch);<br> curl_close ($ch);<br>
echo $result;<br>
?><br><br></div><div>Another thing i noticed is that when not using tmpfs, I/O is high the server when this is set:<br><br> client_body_temp_path /temp;<br>fastcgi_pass_request_body off;<br>client_body_in_file_only on;<br>
fastcgi_param REQUEST_BODY_FILE $request_body_file;<br><br></div><div>Thank You in advance, any help or idea would be appreciated.<br><br></div><div>Regards,<br></div><div>Ron<br></div><div><br><br></div><div><br><br><br>
</div></div>
</blockquote></div><br></div>