Jump to content


Photo

500 error when too many visitors running script


  • Please log in to reply
8 replies to this topic

#1 dagnasty

dagnasty
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 11 September 2006 - 09:02 PM

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 server

Anyone have any ideas?

Much appreciated,
Brian

#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 11 September 2006 - 11:49 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 12 September 2006 - 12:25 AM

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 it
http://dev.mysql.com...lter-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.

#4 dagnasty

dagnasty
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 12 September 2006 - 06:02 PM

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?

#5 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 12 September 2006 - 06:15 PM

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.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#6 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 12 September 2006 - 06:46 PM

If it's not related to databases, then why do you use the word 'queries'?

I have a script that can take up to 10 seconds for certain queries

if it is not accessing a database, what exactly is it doing that takes 10 seconds?

#7 dagnasty

dagnasty
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 13 September 2006 - 04:55 PM

Whoops. Sorry about that.

It's a Torrent Search site that queries the major torrent indexing sites. With their permission, of course.

#8 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 13 September 2006 - 05:33 PM

I googled "500 internal server error cause php" and it seemed to have a lot of stuff you could try

#9 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 September 2006 - 07:17 PM

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.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users