0

Server: ubuntu 14.04lts nginx(v1.10) server is showing older content when i have already changed the file,the changes are seen after 3-6 minutes. the document root directory is mounted from nfs share. the changes in the file is seen when i read/cat the file instantly but the same cant be seen on browser. I also tried to disable nginx sendfile off but the behaviour is random some time the change canbe seen and some time it shows older php result.

Note: i have cleared the browser cache and phpopcache is disabled the average latency between nfs and nginx is less than 0.3ms. No caching server/client is done

below is my nfs mount options on client side

mount -t nfs
10.10.17.45:/www/public_html on /www/public_html type nfs (rw,noatime,nolock,bg,intr,tcp,actimeo=1800,addr=10.10.17.45

below is export conf in the nfs server

/www/public_html 10.10.17.40(rw,fsid=0,async,no_root_squash,no_subtree_check)

for example:- I have a file called showme.php with below content

<?php $var1="abc" echo $var1; ?> 

and if i change it to

<?php $var1="xyz" echo $var1; ?> 

this is not reflected on browser

sherpaurgen
  • 616
  • 6
  • 10
  • 26
  • corrected $var1 in question and ubuntuu/nginx versions are correct, i think i found the culprit here. In nfs mount option "actimeo=1800" in fstab,i have set it to actimeo=1.the changes are reflected instantly <2 seconds now – sherpaurgen Jan 14 '17 at 14:44

1 Answers1

0

Depending on what version of php and what your settings are for php-fpm, this is probably an issue of PHP caching / compiling your PHP file and then refreshing it when one of the FPM processes dies off after serving the maximum number of requests. You can always just:

sudo service php-fpm restart

or

sudo systemctl restart php-fpm

To pick up the file change immediately.

2ps
  • 1,106
  • 8
  • 14