Jump to content

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
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.
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.
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?
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.
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?
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.