number of sql queries high

Support for IntegraMOD 141

Moderator: Integra Moderator

number of sql queries high

PostAuthor: Rosey » Wed Jun 20, 2007 4:23 am

I noticed something that might be the issue of my slowness on my forum.

The number of sql queries is outrageously high (5000+). It wasn't always like that but we moved to a new server.

I did optimize the db. Anything else I can do?

[Page generation time: 20.8045s (PHP: 17% | SQL: 83%) | SQL queries: 5829 | GZIP enabled | Debug off]
Last edited by Rosey on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Rosey
Newbie
Newbie
 
Posts: 24
Likes: 0 post
Liked in: 0 post
Joined: Wed Oct 11, 2006 6:59 am
Cash on hand: 0.00

Re: number of sql queries high

PostAuthor: BobT » Fri Jun 22, 2007 9:29 am

Sorry i do not have a fix but i do share your problem but not as severe. I am in the 800+ range.

When i first moved my server and files to a new host, queries were normal, then out of the blue i was hitting 800 queries. The slowness of the server might be linked to your server hitting your limit if you are a shared server. I was experiencing this and it was the reason for my move to a dedicated server. On my site ( http://www.nycichlids.com ) my loading time are OK even with the 800+queries ... on my shared server loading times were 20 sec or more ... a 15 sec loading time was great .. hehehe.

It has been suggested to me that sql and php are in a loop and your 5000 queries are the same hits ... I am still in php/sql 101 ... Good luck finding a fix, i will be looking at this thread closely.
Last edited by BobT on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

BobT
Newbie
Newbie
 
Posts: 27
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 8:27 am
Cash on hand: 0.00

PostAuthor: Rosey » Fri Jun 22, 2007 5:52 pm

in a loop because of the host or the board?
Last edited by Rosey on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Rosey
Newbie
Newbie
 
Posts: 24
Likes: 0 post
Liked in: 0 post
Joined: Wed Oct 11, 2006 6:59 am
Cash on hand: 0.00

PostAuthor: binh.tang » Sat Jan 12, 2008 1:04 pm

Rosey,

I had that problem for quite some time but luckily as I was a dedicated server, didn't make too much of an impact (though still slow on my site too).

I found the biggest problem was some tables in the database didn't have any INDEX on them, so it make the queries slower as it had no index on that table to search for information so it had to go through the whole table. If you have a large table with thousands or records, this could take awhile.

I'm no database guru, but since going through all the tables from myphpadmin and creating at least one index on that table has made a huge difference.

Hopefully that helps.
Last edited by binh.tang on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
binh.tang
Members
Members
 
Posts: 43
Likes: 0 post
Liked in: 0 post
Joined: Tue Feb 06, 2007 1:11 pm
Cash on hand: 0.00


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]