#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    5
    Rep Power
    0

    How to increase the search speed


    Optimization is needed at the level of PHP, because the database was optimized to the maximum.
    Now the search is performed for 8 seconds (due to the large amount of data to be processed and a complex price calculation based on a large number of price profiles, rules, periods of time, etc.).

    Problem:
    We need to decrease the search speed to 2 seconds .

    Possible solution:
    There is an idea to use caching, but we have a problem when the price of the product is changed. We need to generate cache again but generation of the whole cache takes a lot of time because of large amount of data.

    How to increase the search speed?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,601
    Rep Power
    595
    As there are no mind readers here, without code and without understanding how the data is organized, I doubt anyone can be of much help. Finding that much speed with PHP code will be difficult at best unless you have some really poor code.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,184
    Rep Power
    492
    I agree; if you run the same query in say MySQL Workbench or on the Mysql console, do you see fast results? Are you certain that it's the PHP layers?

    If so, get some analytic software on your platform, Tracelytics or such, which will monitor and report showing you where your bottleneck(s) is/are.

    Good luck

    ps. with regards to cache, memcache, apc etc will help and re-create the caches I believe accordingly ... of course, you could just let the first person who performs the search re-create the cache? Annoying for 1 user, ok if you have 100's or more that frequent the search
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Location
    New Delhi, India
    Posts
    1
    Rep Power
    0

    Tips to improve performance of PHP WEB


    Here are some tips:
    use caching module like Memcache or template system that supports the caching. Smarty is popular one to improve web performance by caching the rendered pages and database results. Use CSS Amalgamation while PHP development. Avoid functional tests in loops. Debug with error reporting.
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Did you read the article about slow database queries in your other thread?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo