Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So I have a few WordPress sites running on my VPS (Ubuntu 12.10, Nginx, php-fpm 5.4)

The sites are all on seperate vhosts and use their own config files (albeit similar to each other) and vary in complexity. One is very simple and uses minimal plugins.

When I try to update core on any site via the admin area I click the "Update Now" button (which should run the script in wp-admin/update-core.php the page hangs for a minute or two before going to a blank admin page (i.e. the wp-admin menu bars and header bar are there but there is no content in the body of the page). Visiting another admin page via the still menu bar reveals that the core has not been updated.

Checking the error log I see this entry:

2013/10/29 23:20:48 [error] 9384#0: *5318248 upstream timed out (110: Connection timed out) while reading upstream, client: --.---.--.---, server: www.mysite.com, request: "POST /wp-admin/update-core.php?action=do-core-upgrade HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mysite.com", referrer: "http://mysite.com/wp-admin/update-core.php"

This didn't happen in the past on older updates and the rest of the site including updating plugins works fine.

Any ideas? Could it be as simple as a time-out error? I find that unlikely as the server should munch though a wp upgrade in seconds.

share|improve this question
    
Try to strace a PHP upgrade process to find what could be causing the issue, could it be a network related timeout, or there is something else in play. –  Tabiko Oct 30 '13 at 10:07
    
I don't think it's network related as the rest of the site works fine and updating plugins works too. How would I trace a php upgrade process? –  harryg Oct 30 '13 at 11:07
add comment

2 Answers 2

up vote 0 down vote accepted

WordPress update is a slow process.

Add

request_terminate_timeout = 300s

to your www.conf

You need to increase fastcgi read timeout in your nginx vhost file

fastcgi_read_timeout 300s

Also, check your execution time in php ini, or redefine it in www.conf for php-fpm

php_admin_value[execution_time] = 300
share|improve this answer
    
Can we clarify which www.conf we are talking about. I am still confused as to what config files apply to what. I thought nginx.conf is Nginx's and php-fpm's is called php-fpm.conf... –  harryg Nov 3 '13 at 15:07
    
OK I increased the timeout in the vhost config file, went to update and it updated in about 2 seconds. Very strange, but it works! –  harryg Nov 3 '13 at 15:19
add comment

Two things you'd want to check with WP updates from my experience.

  • network problems, do a netstat on server to see if there are some connections from php process that is updating and an external server. some servers are slower than others.
  • limited number of php-fpm workers, I've seen WP updates calling themselves via HTTP so it locks all available workers.

try:

  • php-fpm's slowlog
  • higher nginx's side timeout on fastcgi
  • strace is the best thing next to nutella. use it.
share|improve this answer
    
I'm having trouble with the slowlog. When I edit /etc/php5/fpm/pool.d/www.conf and uncomment the slowlog lines I get a 502 bad gateway error –  harryg Oct 31 '13 at 14:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.