开发者

Live site slowed down too much [closed]

开发者 https://www.devze.com 2023-02-17 09:54 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this q开发者_JAVA百科uestion so that it can be reopened, visit the help center. Closed 11 years ago.

We have a vehicle tracking system. We are using MySQL as database server. One TCP communicator fetches data from GPS device and inserts it into the database. Right now, we have 50 - 60 GPS devices communicating with the server. We have 4 GB RAM on the server. But still, the web-application which shows the data on maps, slowed down too much. How should we optimize the performance of our application?

Thanks, Saurabh


You need to profile your application to understand where the bottleneck is. Here are some generic tips.

  1. Roughly the total time for your page to load is a combination of 3 things: Time Spent on Server + Time spend on moving the data on the wire + Time taken by the browser to render. Measure how long each takes (use server side code to measure server time and you could use Chrome developer tools for the other 2)
  2. Your server side bottleneck could be the amount of time it takes to read from your mysql database. If so, you could optimize your reads or use an in-memory cache which pulls data from your db at periodic intervals.
  3. If moving data on the wire is taking time, you could try using cofiguring gzip compression on your webserver and reducing the size of your page
  4. If your page render is taking time, take a look at your javascript. If using google maps, try reducing the number of points your are trying to plot in one shot

Unless you profile your app and identify where the main bottleneck is, it is difficult to give specific answers but hope this gets you started in the right direction


There could be loads of things, to name a view:

  • Table-locking queries. Are you using InnoDB or MyISAM?
  • Also, check the amount of connections you have and that are allowed
  • Check if there is a difference between test and live: could it be the amount of data in your database
  • Check the "slow queries" log.
  • In general: check if it is the database, or check if it is the code that's slow.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号