This forum is in permanent archive mode. Our new active community can be found here.

PHP 5.3

edited April 2013 in Technology
This past week I upgraded my PHP form 5.2 to 5.3 and have seen horrible performance.

Has anyone else made this jump and experienced problems? If so how did you fix them?

One such problem originally was apache going from using about 500MB of RAM to gobbling up all 16GB!!! I made some adjustments and now it stays under 2GB but it seems like there are always ten or twenty httpd's running at 75-100% of CPU.

Any thoughts or ideas? The only change on the server was upgrading php, it ran fine before.

Comments

  • I've been looking at NginX recently, as well as the PHP modifications people have made to specialise for it.
  • When you say it was gobbling up all 16, was it just Malloc'ing almost all available resources? We moved to 5.3 on our development environment without any noticable issues other than some old outdated code. I've had similar problems with Tomcat however on a Java api server we use that grabs ~75% of all available memory for itself (and still runs into OOM problems due to shoddy handling and garbage collection).
  • PHP
    There's your problem...

    I kid, I kid... but PHP is pretty much a hack job held together by duct-tape and chewing gum when it comes to web development. It works, but it's not pretty and not very good (from a computer science point of view -- this isn't to say that you couldn't produce decent software using PHP).
  • @cream - not sure. I got a call from a client complaining of no web access and when I was finally able to log into the server apache was hogging 99% of the system RAM. This was less than 24 hours after the upgrade. Later in the day I found it as high as 6GB with hundreds off null entries (server-status) on threads.

    This same client had some custom php code that was throwing errors after the upgrade. Once those errors were fixed apache stopped gobbling up RAM but in continues to show httpd (under top) running threads using near 100% CPU.

    One problem I fixed early was setting the network port in the kernel to 100mbit (was set to 10mbit) and that helped a lot. It made everything faster and load stayed under five. After a few days of this load continues to creep upwards until I restart apache and then it holds good for about 48 hours.

    I am thinking that something on this clients custom php site is not liking the new php. All other sites using open source and have not shown any problems.
  • I'd be looking at the specific client's code if that was permissible just to grok if there's something really obviously wrong there.
  • I just downgraded to PHP 5.2 and everything is running as it should be.
  • PHP
    There's your problem...

    I kid, I kid... but PHP is pretty much a hack job held together by duct-tape and chewing gum when it comes to web development. It works, but it's not pretty and not very good (from a computer science point of view -- this isn't to say that you couldn't produce decent software using PHP).
    My only interactions with PHP has been making modifications to Wordpress but one of my coworkers has used it pretty extensively in his previous job and he did not have nice things to say about it.
  • edited April 2013
    Having worked extensively with PHP I can tell you quite a few reasons it sucks. That said, it's a pretty useful tool for what it should be used for: basic low volume web content. Setting up a LAMP stack is so trivial in the modern era, and that's all "most" random web projects need. A generic CMS is also a totally reasonable solution for the vast majority of small client webpages.

    It's getting people to adapt to things once you pass that threshold that's frustrating.

    To be fair, I also hate just about every language when it's used as a hammer for a problem it doesn't quite fit.
    Post edited by Anthony Heman on
Sign In or Register to comment.