# I'm using nginx + php-fpm, but there is abnormal load on /tmp when no files are noted in /tmp at all

**URL:** <https://www.ruby-forum.com/t/im-using-nginx-php-fpm-but-there-is-abnormal-load-on-tmp-when-no-files-are-noted-in-tmp-at-all/203314>\
**Category:** NGINX\
**Created:** [February 17, 2011, 4:55pm UTC](https://www.ruby-forum.com/t/im-using-nginx-php-fpm-but-there-is-abnormal-load-on-tmp-when-no-files-are-noted-in-tmp-at-all/203314 "2011-02-17T16:55:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 17, 2011, 4:55pm UTC](https://www.ruby-forum.com/t/im-using-nginx-php-fpm-but-there-is-abnormal-load-on-tmp-when-no-files-are-noted-in-tmp-at-all/203314/1 "2011-02-17T16:55:46Z")

</div>

I’m using CentOS release 5.5 (Final)  
nginx-0.9.3  
remi yum rpms for php-fpm, php, and php-apc

My php-fpm setting are near default except for spawn child numbers.

The server is used for no other purpose other than niginx + php-fpm and  
gets  
about 2 millions hits on a very heavy duty php script per day.  
(DB server is seperate)

iostat shows  
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz  
avgqu-sz await svctm %util  
sda 0.00 107.40 0.00 175.80 0.00 2268.80 12.91  
110.18 632.36 5.69 100.04  
…  
sda5 0.00 104.60 0.00 174.40 0.00 2233.60 12.81  
109.25 631.62 5.74 100.04  
…  
sdb 0.00 85.40 0.00 2.20 0.00 700.80 318.55  
0.01 3.18 0.82 0.18  
sdb1 0.00 85.40 0.00 2.20 0.00 700.80 318.55  
0.01 3.18 0.82 0.18

sdb is the hard drive with the web files and sda5 is /tmp

ls -alh /tmp  
total 40K  
drwxrwxrwt 5 root root 4.0K Feb 18 00:21 .  
drwxr-xr-x 24 root root 4.0K Feb 15 02:27 …  
drwxrwxrwt 2 root root 4.0K Jan 18 01:58 .font-unix  
drwxrwxrwt 2 root root 4.0K Jan 18 01:58 .ICE-unix  
drwx------ 2 root root 16K Aug 26 2009 lost+found

If nginx is stopped the load on sda5 goes away.

Is there any reason /tmp should have such a heavy write load without any  
files in it?

nginx virtual host conf  
location ~ .(php|html|htm)$ {  
proxy\_read\_timeout 180;  
proxy\_connect\_timeout 120;  
proxy\_send\_timeout 180;  
proxy\_buffers 32 4k;  
proxy\_max\_temp\_file\_size 0;  
fastcgi\_pass 127.0.0.1:9000;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME /[DELETED MY  
HOME]$fastcgi\_script\_name;  
include /usr/local/nginx/conf/fastcgi\_params;  
}  
fastcgi\_params  
default values with the following  
fastcgi\_connect\_timeout 60;  
fastcgi\_send\_timeout 180;  
fastcgi\_read\_timeout 180;  
fastcgi\_buffer\_size 128k;  
fastcgi\_buffers 4 256k;  
fastcgi\_busy\_buffers\_size 256k;  
fastcgi\_temp\_file\_write\_size 256k;  
fastcgi\_intercept\_errors on;  
fastcgi\_max\_temp\_file\_size 0;

Thanks.

My question was :  
Is there any reason /tmp should have such a heavy write load without any  
files in it?

---

<div class="post-metadata">

**Author:** ![Runner\_Up](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@Runner\_Up](https://www.ruby-forum.com/u/Runner_Up)\
**Post date:** [February 17, 2011, 5:19pm UTC](https://www.ruby-forum.com/t/im-using-nginx-php-fpm-but-there-is-abnormal-load-on-tmp-when-no-files-are-noted-in-tmp-at-all/203314/2 "2011-02-17T17:19:37Z")

</div>

On Fri, Feb 18, 2011 at 12:54:10AM +0900, Runner Up wrote:

Hi there,

> Is there any reason /tmp should have such a heavy write load without any  
> files in it?

A convenient way of using temporary files is to open and delete them. It  
removes the filename, which hides it from “ls”, among other things.

See ngx\_open\_tempfile in the source, for an example.

Try “lsof /tmp” to see what open filehandles are in that directory.

Good luck with it,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
