CancerMan Posted February 20, 2007 Share Posted February 20, 2007 Hello, I have been running a php web app on the below configuration for a few years now, all was fine and the server never went down. The server is set up with a lot of virtual hosts to allow customers to log into there own sites (all run off the same code and db however). Recently it was decided to spruce up the app and so a rewrite was undertaken by a prior employee. This was tested fairly thoroughly and then made live in parallel with the old system. This is when the problems started, the new system keeps hanging. About once a day any requests to the virtual hosts running the new system start to just time out. The old system remains unaffected however! OK I'm going to repeat myself just to make things clear. There are about 115 virtual hosts running on this server about 5 of which are running the new system. Only the new system ever goes down the old one is totally unaffected. When the new system goes down it takes down all the virtual hosts that are running it, even though one of those hosts its just a test system that's not in use. This test system uses a different copy of the code and a different db but yet still goes down. If anyone has had a similar problem or can offer some advise this would greatly appreciated. Apache: 1.3.33. PHP: 4.3.10. MySQL: 4.1.15 OS: Windows 2000 Quote Link to comment Share on other sites More sharing options...
trq Posted February 20, 2007 Share Posted February 20, 2007 I would suggest this is a code issue and not an Apache one. Sounds to me like the new system may be worse then the old system. Quote Link to comment Share on other sites More sharing options...
CancerMan Posted February 20, 2007 Author Share Posted February 20, 2007 But no matter how bad the code is it shouldn't just hang the server randomly should it? Quote Link to comment Share on other sites More sharing options...
trq Posted February 20, 2007 Share Posted February 20, 2007 It could. Maybe there is some sort of infinant loop? Have you searched the Apache logs? Quote Link to comment Share on other sites More sharing options...
CancerMan Posted February 20, 2007 Author Share Posted February 20, 2007 Yes I have looked though the logs there doesn't seam to be any error messages that coincide with the hangs, the problem is its not my code so hunting though it is pain full. It also appears to hang on lots of different pages. Quote Link to comment Share on other sites More sharing options...
trq Posted February 20, 2007 Share Posted February 20, 2007 Enable PHP error logging and see if anything shows up there. Quote Link to comment Share on other sites More sharing options...
CancerMan Posted February 20, 2007 Author Share Posted February 20, 2007 Some new facts, I can now replicate the hang which is kind of helpful. I have also discovered it has something to do with the db, both html and php pages are served OK during the hang but any page making db requests just sits there forever. It appears that rapid requests for certain pages or refreshes cause the problem. I'm thinking along the lines of maybe these pages are not closing there connections to MySQL properly. Any ideas on this? Quote Link to comment Share on other sites More sharing options...
effigy Posted February 20, 2007 Share Posted February 20, 2007 - Are the MySQL versions the same between the systems? - What table types are you using? InnoDB? If so, are you using transactions? - How are you connecting to the database? - Is there a limit on the number of connections? - Have you checked MySQL's error log? When the system hangs, use SHOW PROCESSLIST in mysql to see what is happening. Quote Link to comment Share on other sites More sharing options...
CancerMan Posted February 20, 2007 Author Share Posted February 20, 2007 1)Its the same instance of MySQL (so yes the same version). 2)Table types are MyISAM. 3)Using @mysql_connect to connect to MySQL and @mysql_select_db to select db. 4)Connection limit is 100 (have never seen it above about 10) although this does confuse me somewhat as I would have thought I would see more connections at times. 5)Yes I have checked the MySQL error log nothing in there of any use (no errors at all in the last couple of weaks) The php is using a bit of free code to make db interactions easier (ezSQL). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.