I have to improve performance of some php script written by another programmer; it's quite big and practically impossible to completely understand everything. The good thing is that mysql queries go in one function, so I wonder if it is possible to cache mysql_query($query) resource using memcache.
Thank you in advance.
3 replies to this topic
#1
Posted 15 January 2012 - 05:08 AM
|
|
|
#2
Posted 15 January 2012 - 09:09 AM
If you don't know where the performance hits are, any optimization is as likely to hurt as help. You really need to do some profiling to localise the problem.
#3
Posted 15 January 2012 - 09:26 AM
Yes, you are completely right. Here's my idea. There are lots of queries that take some notes that will almost never change, so I want to cache them, but I want to cache mysql query results (resource). Is it possible tectonically?
#4
Posted 15 January 2012 - 02:07 PM
If these are common queries, mysql is probably already caching the results, saving you the effort. If the mysql database is on the same server as your web server, you won't be gaining anything. If they are on different servers (a good idea), it depends on the size of the data.
Have you checked the algorithmic complexity of your logic yet? Have you looked at the algorithmic complexity of your queries? Have you tried putting logging into your code to tag entrance/exit times to various functions?
Have you checked the algorithmic complexity of your logic yet? Have you looked at the algorithmic complexity of your queries? Have you tried putting logging into your code to tag entrance/exit times to various functions?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









