Jump to content

500 error when too many visitors running script


dagnasty

Recommended Posts

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
Link to comment
Share on other sites

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/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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.