View Full Version : [ubuntu] Reduce waiting time
November 26th, 2012, 07:46 PM
I am trying to reduce waiting time for server. I tried to use both nginx and apache, but waiting is till the same. Please take a look at the picture:
Please tell me how to reduce it. I am thinking problem is also related to MySQL.
November 26th, 2012, 09:02 PM
If changing the web server made little or no difference, I'd be looking elsewhere, either in your PHP code, or in the MySQL database design or query structure. I've never seen a server take 4 seconds to respond, even with highly complex databases and queries with multiple joins, so I'd look for error messages involving both PHP and MySQL first.
Sorry I can't be of more help.
November 28th, 2012, 03:17 PM
Have you tested the performance of the queries you are using in PHP? Usually performance problems in SQL lies in poorly-indexed databases. Have you indexed every field in the database on which searches might be conducted? If you have SELECTs that employ multiple criteria, have you constructed the appropriate indexes using all the criteria?
Use the command-line mysql client and run every query in the application against the database manually. Do some of them take a long time to execute? Check the indexing on those queries.
November 28th, 2012, 05:14 PM
You could look into your queries with MySQL EXPLAIN to ensure you have properly indexed fields, and the scope of your queries aren't grabbing a bunch of unnecessary items. Also, depending your your program, you may be doing individual queries for each dynamic object rather than rolling them into one single SELECT.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.