سؤال

I had developed a site in Zend Framework 1.11(Mysql Database).It is very slow.My application works on social media posts like hootsuite. But it is very slow.How to improve it. My database is very large(In testing only).My site is not launched.Please help me to improve performance.

هل كانت مفيدة؟

المحلول 2

You can check with the following points, if it will work for you:

  1. Check for the query, you are making to fetch the data. Try to rewrite for the better performance.
  2. Check if you want to use cache functionality so that data retrieval will be faster from cached files.
  3. You can use minified css and js files instead of normal javascript and css files (there are many third party plugins available which will convert the files to minified one).
  4. You can use chunk/image sprites instead of using single images for your application.
  5. Check for any CDN provider (though it will be licensed one, and will cost you) so that files can be stored in other domain instead of your own domain, so that application will be faster.
  6. Instead of storing all the things in DB, you can try to save in file system so that retrieval will be faster and will not take so much time and will not hit DB frequently.
  7. Last but not the least, check for ajax/http request which is also responsible for slower down the application.

Hope the above points will help you :)

نصائح أخرى

Some general approaches:

  • use an opcode cache like APC
  • Tune your database (Percona offers a nice Wizard to help with this
  • Consider using memcache or apc cache to cache database results (ZF supports a variety of cache backends)

To get more specific, you're going to want to figure out where your bottlenecks are. You can just observe your server while the application is running / slow (vmstat, iostat, top, etc) and make some educated guesses, or you can try using one of the many profiling tools that actually expose what your code is spending time and resources doing.

This is a very general question, but the most important issue for performance is your database. you can use memcahched or filecache .

I agree with what has been said, I would add that you can use stored procedures, it is better that it is the database that works. :)
For example, I explained to another question.

Add this to your application.ini:

resources.db.params.profiler.enabled  = true
resources.db.params.profiler.class  = Zend_Db_Profiler_Firebug

This way you can use Firebug to see all queries done to DB and their times to see if they are fast enough.

Then you can use XDebug to profile your PHP. It can generate report which you can view later in KCachegrind and see where your PHP code spends most of it's time.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top