Results 1 to 9 of 9

Thread: Site loads fast, search results very slow...

  1. #1
    Join Date
    Oct 2004
    Posts
    385

    Default Site loads fast, search results very slow...

    I've this test site where the home page takes 1 second to load while the searchresults.html takes about 25 seconds to display the 18 cars I've in.

    If then I click on the car thumbnail its dedicated listing page opens in 1 second too.

    So I guess the problem is with the search function in the mysql database.

    I've used the dbutils addon to optimize the database with no luck.

    Has anyone ever experienced the same situation, if yes how it has been solved?

    Do you have any tip or help you can provide to me...

    Help please!!!!

    Thanks and regards.

    Andrea

  2. #2
    Join Date
    Oct 2007
    Posts
    8

    Default Re: Site loads fast, search results very slow...

    I was having a problem where the search was either killing the MYSQL db or slowing it way down. It was due to the sort by Price. If changed the sort to be random, the issue went away. Of course that was not a good solution.

    The real solution, was that I was running mySQL version 4, and upgrading to version 5, fixed the problem.

    Likely examining the search query more closely would also work?!

  3. #3
    Join Date
    Oct 2004
    Posts
    385

    Default Re: Site loads fast, search results very slow...

    Quote Originally Posted by jessedw View Post
    The real solution, was that I was running mySQL version 4, and upgrading to version 5, fixed the problem.
    Jesse, that might be the problem...

    I'm running version 4 and I'm afraid that upgrading some of my scripts will not work anymore...

    I've to investigate if it's true.

    Anyway if OR continues on working after the upgrade and the problem seems to be gone I'll might have really to upgrade...

    Thanks so much!

  4. #4
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    44
    Posts
    9,796

    Default Re: Site loads fast, search results very slow...

    Upgrading to MySql 5 should help a little. The problem with MySql is usually the config settings and the amount of ram memory it can use. When queries are run, the results are stored in temp tables. Ideally the temp tables would be kept in ram for fast access but if there is not enough ram, they are created on the hard drive which slows things down a lot.

    If you look at the MySql runtime info from phpmyadmin, it will show you a lot of information about how MySql is running.

  5. #5
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann the_sandking is on a distinguished road
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Site loads fast, search results very slow...

    It is also very possible to incorrectly configure one or more search criteria (especially the step value on a min/max search) so that the DB server has to work too hard to return a result. The real life equivalent would be like emptying a bathtub full of water with a spoon vs. a bucket.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  6. #6
    Join Date
    Oct 2004
    Posts
    385

    Default Re: Site loads fast, search results very slow...

    Quote Originally Posted by pbflash View Post
    If you look at the MySql runtime info from phpmyadmin, it will show you a lot of information about how MySql is running.
    I looked at mysql runtime info and these are the datas marked as red (problem):

    Slow_queries 3
    Handler_read_rnd 167 k
    Handler_read_rnd_next 1,180 k
    Created_tmp_disk_tables 2,175
    Key_reads 11 k
    elect_full_join 109
    Opened_tables 346
    Table_locks_waited 6

    I'm running my own semi-dedicated server (it's my server but I also get full customer care from my host) and I've another test site with the same slow search results while 2 other sites are running fine.

    Do you think the problem resides in the informations I posted above?
    If yes, wich one of the single datas need me to be concerned more?

    At last, what can I do in my tables to optimize them as requested by the phpmyadmin?

    I want to solve all this and maybe help anyone else having the same kind of problems related to slow search results... (if concerned to the database...)

    Thanks

  7. #7
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    44
    Posts
    9,796

    Default Re: Site loads fast, search results very slow...

    I just re-read your first post. 25 seconds to search through 18 seconds is a very long time. I've been working on a site with 20,000+ listings and a simple search will return the results in 4-6 seconds. I'm thinking there is something else causing the slow times. Can you provide a link to the site?

  8. #8
    Join Date
    Oct 2004
    Posts
    385

    Default Re: Site loads fast, search results very slow...

    Quote Originally Posted by pbflash View Post
    I just re-read your first post. 25 seconds to search through 18 seconds is a very long time. I've been working on a site with 20,000+ listings and a simple search will return the results in 4-6 seconds. I'm thinking there is something else causing the slow times. Can you provide a link to the site?
    Sure!
    I'll pm it to you

  9. #9
    Join Date
    Oct 2004
    Posts
    385

    Default Re: Site loads fast, search results very slow...

    Don't know if it might be related but here are the specs of my server:

    Processor #1 Vendor: GenuineIntel
    Processor #1 Name: Intel(R) Pentium(R) 4 CPU 3.20GHz
    Processor #1 speed: 3192.557 MHz
    Processor #1 cache size: 1024 KB

    Processor #2 Vendor: GenuineIntel
    Processor #2 Name: Intel(R) Pentium(R) 4 CPU 3.20GHz
    Processor #2 speed: 3192.557 MHz
    Processor #2 cache size: 1024 KB


    Memory Information

    Memory: 1025772k/1039552k available (2476k kernel code, 13144k reserved, 1098k data, 240k init, 122048k highmem)

    Current Memory Usage

    total used free shared buffers cached
    Mem: 1026280 973628 52652 0 128280 409508
    -/+ buffers/cache: 435840 590440
    Swap: 2096440 29424 2067016
    Total: 3122720 1003052 2119668

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts