Slow working search result

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Slow working search result

This topic contains 9 replies, has 2 voices, and was last updated by wildlukas wildlukas 6 years, 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #17112
    wildlukas
    wildlukas
    Participant

    Hello,
    Recently I’ve notice that searching is taking longer time than before actualy is very slow and when two user is using search at the same time it’s kill server with error too many open file in mysgl. I haven’t increased number of product which is 14 000 only updating plugin and incresed server parameters for 50% CPU and Memory.
    So reading support forum I’ve found your answear on simmilar problem so I’ve changed:
    – deleted index table and change search engine on regular
    – turned on only search in title and category product
    – turned off google analitics and search statistic
    – turned off second logic
    – Override the default WordPress search results – but don’t see different betwin post and get

    Unfortunetely searching is faster but still slow. After clicking serch icon or see more result it takes 15 seconds to show results so it’s not fast.

    and my question is What do You think about it. maybe You could chenge settings or set something which I am not able.

    All the best
    Lukas

    #17116
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Lukas,

    I have possibly found the most optimal configuration based on your description. I think this will be the fastest:
    – I have re-created the index table
    – Then I enabled the index table for the ‘Main search’
    – Then I disabled the product and post categories from results: https://i.imgur.com/AylqNPZ.png
    – I have also disabled the keyword suggestions: https://i.imgur.com/HxWHs5t.png

    There is one other thing I have noticed. You have a lot of product categories excluded from the search, that might affect the perfromance a bit, but that should be fine.

    Currently I am seeing a much better performance: https://youtu.be/cj0adl_kUEA
    The tests are around 1.5-2.5 seconds, which should be much better now.

    Best,
    Ernest Marcinko

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


    #17136
    wildlukas
    wildlukas
    Participant

    Hello,
    Thank You for your time! Works much better but…

    when some number of users are using search the server is break and have some error like:
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    7959 mysql 20 0 1752m 571m 10m S 124.5 18.6 0:00.98

    /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib64/mysql/plugin –user=mysql –log-error=/var/lib/mysql/mysql-error.log –open-files-limit=65535 –pid-file=/var/lib/mysql/da5888.serwervps.pl.pid

    as You can see CPU is much overload, so I have two questions:
    1. what do You think about that? I was checking everyting and I think it’s search plugin after latest updates.
    2. Is it possible to move only index table on different server that WordPress and plugin is instaled on server 1 and plugin is using index table from server2 – but this is only question please don’t waist time on any coding.

    All the best

    #17137
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I have logged in via FTP and done some debugging on the queries. Those were not changed in the latest releases, the plugin runs the same exact queries as before. I just confirmed that by debugging the search class, everything is same as it was before – but I may have found something else.

    1. The queries were actually running fast enough (from 0.001s to 0.05s interval per query), but I have found something that was clogging up the search performance. So I enabled debug mode, and started running very hard queries for phrases like ‘a b c d e’. This is a very hard search, as it must run 5 separate database queries, that will return a huge number of results. Then find the intersection of the result arrays, which might also be huge (5 x 10k~ items).

    What I found that merging and processing these result arrays was actually a very slow process. I have manually lowered a special limit variable (pool size), now I see huge performance improvement because of that.

    There was one more thing, but I am not sure about that one yet. Would you mind if I run further test on the plugin on your server in the next couple of days? (4-7 days) I will not change anything on the server, I just want to test out possible changes to the plugin, if that is okay with you.

    2. That is not possible in any way unfortunately.

    Also, I have checked your wp-confing.php file to see the configuration, and I have found that there was an error with the apostrophes on these lines:

    ini_set( 'upload_max_size' , '300MB' );
    ini_set( 'post_max_size', '300MB');

    I have corrected those for you. There was also a missing memory limit ini_set call, while you had the WP_MEMORY_LIMIT constant set. I added this ini_set line below it:

    ini_set('memory_limit', '1024M');

    Without this, the WP_MEMORY_LIMIT has no effect (or not always). I hope you don’t mind I added this as well.

    I hope I can continue testing the plugin on your site, it has a great amount products to try with, it would help me a lot. Thank you!

    Best,
    Ernest Marcinko

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


    #17139
    wildlukas
    wildlukas
    Participant

    Hi,
    Thank You for Your time!
    1. Cheking server performance I haven’t notice any hard proces and overload during ‘a b c d e’. Sorry for doubt in search pro plugin πŸ™‚
    Still see some proces like php-fpm: pool admin which is eating CPU – may be You know what is it or may be You could tell me the way in which I should search cose can’t find anything in google.

    2. Thanks for every corrections in code.

    YES os course You can testing plugin on mys site, I will be honored that I could have influence on science πŸ˜‰

    Everyday I have auto backup of all server and now I’ll do datebase backup so if something will go wrong just let me now I’ll restore site.

    On my site is working plugin minifier which could has some influane on code changing and WP Super Cache.
    CDN cloudflare is on – if something it’s easy to turn it off.
    The biggest traffic on my site is between 20:00 and 24:00 – most 22:00 – 23:00 – Warsaw time.

    All the best
    Lukas

    #17140
    wildlukas
    wildlukas
    Participant

    … can You tell me where You lowered (pool size) just want to know that to do if somethin will change on site like wp updates etc. is pool size has something in common with php-fpm: pool admin ?

    #17141
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Lukas,

    No, that is something completely different. The thing I adjusted is simply a PHP variable that is set within the plugin, that decreases the potential result set size.

    php-fpm is the UNIX server process that handles the script executions – usually invoked when someone visits your site (when wordpress loads), or when makes an ajax request. It usually spikes when the cache is re-built.
    It might have been a bit overloaded as I was conducting the tests. Usually, the php-fpm process will use a lot of CPU, but only for a very short amount of time. Unless you experience significant server downtimes or constant CPU overload, it should be fine πŸ™‚

    Best,
    Ernest Marcinko

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


    #17143
    wildlukas
    wildlukas
    Participant

    Thanks πŸ™‚

    #17158
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Lukas,

    I have implemented a major fix to the search plugin files on your site. You should expect much better average search perfrormance, and much lower database and server usage.

    This was pre-tested on a local environment with 9000 posts and 850 000 keywords. The pefrormance improved from 8+ seconds response to ~1 second, so this should be a huge improvement.

    I hope it works out for you πŸ™‚

    Best,
    Ernest Marcinko

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


    #17219
    wildlukas
    wildlukas
    Participant

    Thank you very much for your help!

    Site works much faster, thanks a lot!

    I wish You many coding success.

    All the best
    Lukas

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Slow working search result’ is closed to new replies.