dagnasty Posted September 11, 2006 Share Posted September 11, 2006 I have a script that can take up to 10 seconds for certain queries. During busy times of the day when a lot of people are using it, the server shoots out 500 internal server errors even on pages unrelated to the script. I'm guessing it has something to do with too many concurrent connections or something related to cpu? Apache serverAnyone have any ideas?Much appreciated,Brian Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/ Share on other sites More sharing options...
Ninjakreborn Posted September 11, 2006 Share Posted September 11, 2006 YOu can always work on the performance of your script, do some optimization to it, post it here, maybe we can help you cut it down a couple of lines or something. Either that or switch to a more powerful host, and hope they can handle the load, or a dedicated ip. Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-90116 Share on other sites More sharing options...
mainewoods Posted September 12, 2006 Share Posted September 12, 2006 One thing I've had amazing speed increasing results from sometimes is by creating some extra indexes on my db tables. For instance, if you frequently use an sql statement with a clause like: "WHERE city='cityname'", and you have about 20 cities in your database, then adding an index to that field in that table can greatly speed up all queries that use that "WHERE" clause! I once used that technique to speed up dozens of preexisting programs written by previous programmers - and did it all in one afternoon! I didn't even have to touch any of the preexisting code and they all ran faster. -use this page to guide you on how to add an index to an existing table without destroying ithttp://dev.mysql.com/doc/refman/5.0/en/alter-table.html--just create a small php page to add the new indexes to the tables or use a mysql administration program to make the changes. No changes will have to be made to any of your other pages for this to work and potentially greatly speed up your pages. the new indexes will be automatically considered in the 'query optimization engine' of mysql. Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-90136 Share on other sites More sharing options...
dagnasty Posted September 12, 2006 Author Share Posted September 12, 2006 I appreciate the help and optimization tips but it's not related to MySQL at all, or any database for that matter. Since my host 1and1(I know, they suck) doesn't have error logs, I am only guessing as to what the problem is. Anyone have any idea? Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-90575 Share on other sites More sharing options...
redbullmarky Posted September 12, 2006 Share Posted September 12, 2006 as you don't have any logs, i'd ask your host to try and find out what's going on, as 500 errors for me normally occur from misconfiguration of apache config file and/or htaccess files, and never as a result of too much traffic or database load. Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-90580 Share on other sites More sharing options...
mainewoods Posted September 12, 2006 Share Posted September 12, 2006 If it's not related to databases, then why do you use the word 'queries'?[quote]I have a script that can take up to 10 seconds for certain queries[/quote]if it is not accessing a database, what exactly is it doing that takes 10 seconds? Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-90604 Share on other sites More sharing options...
dagnasty Posted September 13, 2006 Author Share Posted September 13, 2006 Whoops. Sorry about that. It's a [url=http://www.scrapetorrent.com]Torrent Search[/url] site that queries the major torrent indexing sites. With their permission, of course. Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-91189 Share on other sites More sharing options...
mainewoods Posted September 13, 2006 Share Posted September 13, 2006 I googled "500 internal server error cause php" and it seemed to have a lot of stuff you could try Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-91211 Share on other sites More sharing options...
redarrow Posted September 13, 2006 Share Posted September 13, 2006 its apache configration setup on the host side tell your host.the reason for goole to coume up with loads and loads of those errors becouse to meny hosts that can not set there servers up properly. Quote Link to comment https://forums.phpfreaks.com/topic/20430-500-error-when-too-many-visitors-running-script/#findComment-91277 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.