Search is very slow

This topic contains 17 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 9 years ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #4010
    Richi400
    Richi400
    Participant

    Could you plz have a look, why the search is that SLOW. Try to type “Riesling”, “merlot”, “muttertag”, “sekt”. Sometimes it seem to be hung up completly as it searchs and searchs and searchs…
    🙁

    • This topic was modified 9 years, 1 month ago by Richi400 Richi400.
    #4011
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Could you please provide more information on this:

    • An url where the search is visible
    • Temporary admin and ftp details if possible (you can edit your initial post for this)
    • What is the database size? How much posts/pages/custom content do you have?
    • Are you running on a Virtual Private Server or a Shared web hosting? What is the server configuration?
    • What type of content are you searching?
    • Have you tried changin anything on the search options page?
    • What is your site response speed if you test it on: http://tools.pingdom.com/fpt/

    Thank you!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4042
    Richi400
    Richi400
    Participant

    Hi there!

    Ok, seems that the search works most of the time properly. But sometimes, especially the search while typing is very slow. Also in some cases when I typed a phrase and hit enter I get an internal server error.
    You could have a try here:
    http://www.youwineworld.com/shop/ (product search)
    and here: http://www.youwineworld.com/weinmagazin/ (search products, pages and posts)

    Strange, I provided the admin and ftp-details allready in my initial post, obviously it’s gone. :/

    – The database size is 7.3MB. There are about 7 products and 21 published posts, only. (Will be over 100 posts after finishing the website construction)
    – It’s a shared web hosting
    – type of content: products, posts, pages
    – I tried to use the cache system, but it was producing a lot of bugs, so I deactivated it again, I also tried fulltext search options but it did not change anything
    – response speed test:
    Tested from New York City: 7.25s, 7.10s (86/100 perf. grade)
    Tested from Amsterdam: 2.64s, 2.18s, 3.35s (88/100)

    And one last question: How could I determine a custom search page. I don’t want to use the default one. I allready checked the box override default wordpress search-page. ans created a new page. But if I set the redirect URL to a custom page like /suche?s={phrase} I get a 404 error although the page exists.
    Do I have to copy the search.php and customize it?

    thank you!

    #4045
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Sorry about the ftp/admin details, it was my fault – I was fixing something on the server and forgot to activate that code part back.

    I’m currently testing, right now it’s all right in terms of speed – response under 2-3 seconds.

    Your database is all right, it’s small.

    The problem might have been the shared web hosting. Most of shared web hosts use process throttling, meaning if too many php processes are running at the same time it halts the server for a brief amount of time (usually 30 seconds). The limit used to be around 10-20 processes, which is enough for cached traffic usually. But if you are actively testing your site, enabling/disabling plugins, changing configurations, then this limit is passed in few seconds, and the PHP processor is halted. WordPress with some plugins and active testing on the backend uses lots of resources.

    Another possibility would be memory, but the search plugin peaks at 0.5 MB of memory, so I think we can rule that out.

    I might be wrong though, but the nature of the issue indicates process throttling.

    On the search url: It’s not actually changing the url (because it can’t unfortunately), but it gives you an option to change it if you already have a custom search url.
    To have a custom search url, you probably have to make changes to the .htaccess file. I’ve found a tutorial, that might help you out: http://wpengineer.com/2258/change-the-search-url-of-wordpress/
    After making the changes in the .htaccess file, you can go back to the search settings, and change the search url field accordingly.

    I know it’s a bit confusing, but I wish there was a better way around this.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4046
    Richi400
    Richi400
    Participant

    All right! Thanks a lot for this helpful comment. I think you’re right with your assumption of php-process throttling. The site will be hosted on a dedicated server when I finished work on it. So the problem should be gone.

    And thanks for the tutorial-link. I will figure it out.

    #4047
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    No problem at all!

    Let me know if the issue persists on the dedicated server, and I will investigate further if needed.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4053
    Richi400
    Richi400
    Participant

    I could change the URL, but it will show 404 still.
    OK, it’s obviously that it is unpossible to change the redirect from wordpress to an other page than search.php as template. Crazy! But ok…

    New problem:
    http://www.youwineworld.com/shop/

    I have some product categories like “Weißwein”, “Rosé” and “Rotwein”. When I search for Weißwein it’s allright. “Weisswein” is not working. (Maybe because the titel is written “weißwein” with the german “ß” and not “weisswein”)
    BUT: Please try to type “Rotwein”… the search will start and will never finish with a result, although the title is “Rotwein”. This is a bad bug. Have no idea why?

    thanks in advance!

    #4101
    Richi400
    Richi400
    Participant

    The described problem still exists.

    But now there is another problem. The Ajax Search jquery.ajaxsearchpro.min.js?ver=4.1.1 is in conflict with my jquery.rwdImageMaps.js?ver=4.1.1. The Link-Map calculation for responsive (resizing) images doesn’t work if Ajax Pro Search is activated. 🙁

    Any idea?

    #4102
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Let me check that for you.

    In the meantime, could you please link me to that map issue with some explanation, I will check that as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4103
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    After some experimenting I have found the cause of the problem.

    There was this image, which is a bit too big: http://www.youwineworld.com/wp-content/uploads/2015/02/schlegel.png

    The search calls the wordpress image library to try to create a smaller crop of the image, but because of the size and type (2.2 MB, png) of the image the PHP memory runs out. I’ve done some measurements, the memory peaks at around 100MB after wordpress is loaded before the search, and the image library tries to take around 40MB more. The problem is that the memory runs out at 128M. I highly suggest increasing the memory limit from 128MB to at least 512 in the php.ini file if you are planning to use bigger images.

    I’ve tried to switch to the image library that I built as an alternative to the wordpress core one, but still no luck – it uses somewhat less memory, but still not enough unfortunately.

    As an alternative, I can turn off the image cropping and caching, but as a result the full sized images will be shown as thumbnails in the results.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4106
    Richi400
    Richi400
    Participant

    GREAT! It solved the problem :-))
    Oh no I don’t want use such big images. It was just a try, if a 300KB JPG looks worse than a 2.2MB PNG. But theres no difference in the shop-view. So I replaced the PNG with the JPG and the search works now and is fast enough! Thanks! great!

      Map issue

    HTML image maps are one of the best ways to add multiple links to a single image. look here: http://www.youwineworld.com/shop/ (the banner above the “Shop”-Title has 4 different links) but it’s one image.
    It works, but for example if you reduce the size of your browser-window to see how it would work e.g. on tablets you see that the link-map is not calculated to fit the new resolution. To keep the link-map fit to every resolution I’ve built in the jQuery-rwdImageMaps.
    In my functions.php I used this code:

    add_action( 'wp_print_scripts', 'add_my_scripts', 100 );
    function add_my_scripts() {
    if ( !is_admin() ) {
     wp_deregister_script( 'jquery' );
     wp_register_script( 'jquery', ( 'http://www.youwineworld.com/wp-includes/js/jquery/jquery-1.11.2.min.js' ), false, null, true );
     wp_enqueue_script( 'jquery' );
     wp_register_script( 'jqmigrate', ( 'https://code.jquery.com/jquery-migrate-1.1.0.min.js' ), false, null, true );
     wp_enqueue_script( 'jqmigrate' );
    wp_register_script( 'rwdImageMaps', 'http://www.youwineworld.com/wp-content/themes/labomba/includes/js/jquery.rwdImageMaps.js');
    wp_enqueue_script( 'rwdImageMaps' );
    } }
    add_action('init', 'add_my_scripts');

    The HTML code for the img will look like this:

    <img src="http://www.youwineworld.com/wp-content/uploads/2015/03/Shop-Banner-Alle-Weine.jpg" alt="Weine online günstig kaufen" />&lt;map id="map1425294570307" name="map1425294570307"&gt;&lt;area shape="rect" coords="0,0,285,155" title="Rotweine online günstig kaufen" alt="Rotweine online günstig kaufen" href="http://www.youwineworld.com/produktkategorie/rotwein/" target="_self"&gt;&lt;area shape="rect" coords="0,165,284,319" title="Weingut Sandwiese Wein" alt="Weingut Sandwiese Wein" href="http://www.youwineworld.com/produktkategorie/weingut-sandwiese/" target="_self"&gt;&lt;area shape="rect" coords="292,0,492,318" title="Marienhof Perlwein Perlenmarie Perlenkönig" alt="Marienhof Perlwein Perlenmarie Perlenkönig" href="http://www.youwineworld.com/produktkategorie/weingut-marienhof/" target="_self"&gt;&lt;area shape="rect" coords="496,0,764,319" title="Wein zu Ostern" alt="Wein zu Ostern" href="http://www.youwineworld.com/shop/" target="_self"&gt;&lt;/map&gt;

    or look at the html view of http://www.youwineworld.com/shop on line 2015

    • This reply was modified 9 years, 1 month ago by Richi400 Richi400.
    • This reply was modified 9 years, 1 month ago by Richi400 Richi400.
    #4109
    Richi400
    Richi400
    Participant

    Whooooo! Strange! Problem solved. The map-resizing-calculation works now! 🙂
    I’ve no idea why, but it works now! Yes!
    Did you change the javascript source in Compatibility Options?

    #4110
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Yes, I actually did for testing. Well, I’m glad it solved that as well!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4321
    Richi400
    Richi400
    Participant

    Hi there!

    I was trying to open a new thread, but is was not possible because it says “Wrong verification code, or code already in use!” no idea why. So here is my new problem:

    I’ve got a problem with my search results.
    Try to go to http://www.youwineworld.com/weinmagazin/ and for example type “kochen mit wein” or “riesling”. The groupe “other results” always shows multiple results, means the same post is displayed 2, 3 or 4 times or more.
    What could be the reason for this?

    To access the site pls use the “ftp-credentials” I have provided.

    thanks in advance!

    #4323
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Indeed. Let me cross check the changes regarding this from v3.5 to 4.0.

    I will most likely log in to your site both admin and ftp to run some tests on the plugin code, the search might not work for couple of minutes in the next few hours.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.