I'm using nginx and spawnf-cgi with apc and memcache enabled.I'm getting 502 bad gate way on browser and this error on error log.
2013/01/07 06:55:46 [error] 90799#0: *53 upstream prematurely closed connection while reading response header from upstream, client: a.b.c.d, server: www.mysite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/fcgi.sock:", host: "www.mysite.com"