December 9th, 2013, 07:04 AM
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.).
We need to decrease the search speed to 2 seconds .
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?
December 9th, 2013, 07:21 AM
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.
December 9th, 2013, 07:34 AM
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.
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
December 11th, 2013, 07:28 AM
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.
December 11th, 2013, 08:30 AM
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.