php5 “Unable to fork” on Solaris
Thursday, Dec 6. 2007 – Category: Grommit, OpenSolaris
I was battling with inconsistent behaviour for grommit with PHP5 periodically (50% of the time, roughly) throwing the dreaded “Unable to fork” error (seen on both exec() & passthru() calls). Googling for it gives tons of great info for what causes this problem on Windows; but virtually none on Solaris.
Finally after some truss and DTrace-fu, I saw what was happening. exec() was calling open(), and since httpd is a 32 bit process, it was hitting the 256 file descriptor limit.
Booooooo.
A quick modification to /lib/svc/method/http-apache2 to do a:
ulimit -n 65535
LD_PRELOAD_32=/usr/lib/extendedFILE.so.1
export LD_PRELOAD_32
before the line calling apachectl at the end fixed the problem for me.
Seems like other people should have hit this problem though; which makes me curious why I don’t see any other hits on Google about it.
No Trackbacks to “php5 “Unable to fork” on Solaris”
9 Comments to “php5 “Unable to fork” on Solaris”
-
Darren Moffat Says:
December 6th, 2007 at 11:21It it wasn’t for the ulimit you could have done this in the much more supported (and not going to get blown away on upgrade) way of setting the environment variable using svccfg.
-
Stephen Lau Says:
December 6th, 2007 at 11:38Yeah – I looked at trying to do it with smf properties and svccfg – but couldn’t figure out how because of the ulimit.
-
Geoff Arnold Says:
December 6th, 2007 at 12:02So is this the explanation for WordPress not consistently sending email notifications of blog events?
-
heavygirl Says:
December 6th, 2007 at 12:35Ugh, 256 default FD limit in a multithreaded, “modern” and “advanced” OS in 2007. Isn’t this silly?
-
Stephen Lau Says:
December 6th, 2007 at 13:21@Geoff: It could be, yeah. Depends if WordPress was trying to do it all within PHP using sockets & SMTP, or if it was making an exec() call to /usr/lib/sendmail.
@heavygirl: Nope, don’t blame Solaris. Blame POSIX.
-
richlowe Says:
December 6th, 2007 at 14:16the standards define FILE to be opaque, posix shouldn’t care.
I seem to recall the issue is that FILE would change size on applications.
(I also vaguely recall this only being an issue for the 32bit ISAs?)
-
Chris Josephes Says:
December 6th, 2007 at 16:12I saw this issue a lot. I worked at a place that served webpages that literally had 200+ server side includes, and opened dozens of logfiles. Back then the only solution was to upgrade to 64 bit.
-
Stephen Lau Says:
December 6th, 2007 at 16:19Sadly /usr/apache2/bin/apachectl and httpd are delivered as 32-bit only.
-
Vladimir Kotal Says:
January 2nd, 2008 at 03:05upgrade to latest Nevada, it has 64-bit apache in:
Leave a Reply
Recent posts
- Gesture Lock
(Saturday, Nov 13. 2010 – 12 Comments) - ConnectIn 1.1.1 & HTC Sense UI
(Tuesday, Sep 28. 2010 – 38 Comments) - ConnectIn
(Saturday, Sep 25. 2010 – 62 Comments) - Proguard, Android, Ant, and 3rd party external JARs
(Wednesday, Sep 22. 2010 – 18 Comments)
Categories
- Android
- Cars
- ChinaBlog
- Code
- Computers
- Development
- Food
- Football
- Grommit
- Linkage
- Movies&TV
- Music
- Musings
- OpenSolaris
- OpenSource
- Outdoors
- Pets
- Photos
- Quotage
- Rdio
- Songbird
- Sun
- Travel
Grommit
Mozilla
OpenSolaris
- alan burlison
- bonnie corwin
- eric boutilier
- glynn foster
- jim grisanzio
- mark nelson
- mike kupfer
- planet opensolaris
- stephen hahn
Songbird
Archives
- November 2010
- September 2010
- August 2010
- June 2010
- May 2010
- February 2010
- January 2010
- December 2009
- October 2009
- September 2009
- August 2009
- June 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003
- August 2003
- July 2003
- June 2003
- May 2003
- April 2003
- March 2003
- February 2003
- January 2003
- December 2002
- November 2002
- October 2002
- September 2002
- August 2002
- July 2002
- June 2002
- May 2002
- April 2002
- March 2002
