Irish SEO,  Marketing & Webmaster Discussion
 
Affiliates get Paid On Results, Click Here!
 

Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Server / Technical Administration Tips and Queries


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 27-06-2007, 12:46 AM
Wannabe Geek
 
Join Date: Sep 2006
Posts: 189
dude will become famous soon enough
Default More powerful server... how much faster will my SQL queries be?

Hello

I run a couple of websites which do complex "like '%word%'" SQL queries (such as this: Jobseeker - Jobs )

Some of my queries are a bit slow.

My server is a fairly basic celeron (can't remember the exact spec, but I think it's 1.8 Ghz with 512 MB ram.)

If I were to upgrade to say... a Xeon 2.8 Ghz with 1 Gig ram, would my SQL queries run much faster?

Or is there a smarter way to speed up my queries?

Any advice appreciated. Thanks!
Reply With Quote
  #2 (permalink)  
Old 27-06-2007, 12:57 AM
blacknight's Avatar
Web Slave
Recent Blog: Jaiku Back Online
 
Join Date: Jan 2006
Location: Ireland
Posts: 5,891
blacknight is just really niceblacknight is just really niceblacknight is just really niceblacknight is just really nice
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight
Default

Are you running the latest version of MySQL?

Have you optimised the setup?

Are you caching enough?

512MB of RAM doesn't sound like enough anyway ....
Reply With Quote
  #3 (permalink)  
Old 27-06-2007, 01:29 AM
Wannabe Geek
 
Join Date: Sep 2006
Posts: 189
dude will become famous soon enough
Default

Hi Blacknight

Thanks for the reply.

To answer your questions -

Are you running the latest version of MySQL?
MySQL version 4.0.27-standard. Pretty old I guess!

Have you optimised the setup?
No. I'm just running the queries. I could defo improve in this area...

Are you caching enough?
I don't think I'm caching at all...

Hmmm. Any advice?

Thanks
Reply With Quote
  #4 (permalink)  
Old 27-06-2007, 01:32 AM
blacknight's Avatar
Web Slave
Recent Blog: Jaiku Back Online
 
Join Date: Jan 2006
Location: Ireland
Posts: 5,891
blacknight is just really niceblacknight is just really niceblacknight is just really niceblacknight is just really nice
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight
Default

A newer version of mysql might help

You could also look into some of the caching / optimisation tips that you'll find online eg. caching the php could help with the overall performance

If you have a look at some of the MySQL blogs you should get some suggestions, though I'm sure someone on here will have suggestions
Reply With Quote
  #5 (permalink)  
Old 27-06-2007, 01:52 AM
Wannabe Geek
 
Join Date: Sep 2006
Posts: 189
dude will become famous soon enough
Default

Thank you. I'll look into your suggestions.

Cheers.
Reply With Quote
  #6 (permalink)  
Old 27-06-2007, 03:48 PM
Wannabe Geek
 
Join Date: Feb 2007
Posts: 188
hosting365 will become famous soon enough
Default

More RAM always helps, and a bigger cache on the CPU will help any database functions.
Reply With Quote
  #7 (permalink)  
Old 27-06-2007, 04:16 PM
blacknight's Avatar
Web Slave
Recent Blog: Jaiku Back Online
 
Join Date: Jan 2006
Location: Ireland
Posts: 5,891
blacknight is just really niceblacknight is just really niceblacknight is just really niceblacknight is just really nice
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight
Default

Quote:
Originally Posted by dude View Post
Thank you. I'll look into your suggestions.

Cheers.
Here's a few links:

MySQL Optimization

Michele Neylon :: Pensieri Mobile Edition - there's some useful stuff in the comments

MySQL's Query Cache
Reply With Quote
  #8 (permalink)  
Old 27-06-2007, 05:25 PM
Wannabe Geek
 
Join Date: Sep 2006
Posts: 189
dude will become famous soon enough
Default

Great Thanks again.
Reply With Quote
  #9 (permalink)  
Old 27-06-2007, 09:00 PM
blacknight's Avatar
Web Slave
Recent Blog: Jaiku Back Online
 
Join Date: Jan 2006
Location: Ireland
Posts: 5,891
blacknight is just really niceblacknight is just really niceblacknight is just really niceblacknight is just really nice
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight
Default

Quote:
Originally Posted by dude View Post
Great Thanks again.
No problem - let us know how you get on
Reply With Quote
  #10 (permalink)  
Old 05-07-2007, 12:58 PM
Dan Dan is offline
Frontpage User
 
Join Date: Jan 2007
Posts: 10
Dan will become famous soon enough
Default

You'll know if you need more RAM by looking at your own server statistics. Are you swapping to disk at all?

Basic indexing can help hugely too - with MySQL you can log all your slow queries (say ones that took longer than 2 seconds to run) to a file and then use EXPLAIN to see how they are running.

So imagine your query is something like
Code:
SELECT * FROM jobs WHERE Location like '%word%';
running an explain plan is as simple as putting EXPLAIN beforehand.

Code:
EXPLAIN SELECT * FROM jobs WHERE Location like '%word%';
It'll give you some pointers as to whether its expecting an index, or doing something manky like creating a temporary table. Sometimes, due to the fact that MySQL does funny things internally with its optimiser, even rephrasing your queries to return the same results can help.

Lastly, if you are looking at full text searching mysql, its nasty. Take a look at Sphinx Search - its pretty good if you put a bit of work into it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script Installation, Server Administration bizhat Marketplace Offers 2 10-03-2008 11:29 AM


All times are GMT +1. The time now is 09:14 PM.


Powered by: vBulletin Version 3.7.2, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.

Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56