Best way to optimize MySQL database

Discussion in 'MySQL' started by Brad77, Oct 30, 2013.

  1. #1
    I need a good solution on how to get more users. JM load test says will not work with 500 concurrent users.

    Are their specific things to check with the DB? And things to improve the concurrent users?


    Are there companies out there who could look at the DB and say

    You would improve performance by doing:

    This
    This
    This

    etc.

    Thats what I am looking for
     
    Last edited: Oct 30, 2013
    Brad77, Oct 30, 2013 IP
  2. HackTactics

    HackTactics Member

    Messages:
    16
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    38
    #2
    It's really limited by the hardware that the database runs on and whether the machine is dedicated to hosting databases or is a general web server serving pages by running Apache or something of the sort. Your best option will probably be implementing some form of caching so as to limit the volume of queries performed with each user, for instance; instead of querying to get a user's credential X on every page load, you could cache the credential and invalidate the cache when the credential is changed or periodically. Also check out http://dev.mysql.com/doc/refman/5.1/en/query-cache.html for more technical information on MySQL caching.
     
    HackTactics, Nov 1, 2013 IP
    bartolay13 likes this.
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,806
    Likes Received:
    4,534
    Best Answers:
    123
    Trophy Points:
    665
    #3
    Remember, too, that 500 users means 500 page requests at the same time - you could have several thousand users online but because they are reading the content they aren't all requesting pages at the same time.
     
    sarahk, Nov 1, 2013 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    agree with @HackTactics you need a cache layer that would just limit request in the database if the content is inside cache.
     
    bartolay13, Nov 3, 2013 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    One option is to use a singleton database class. There are arguments for and against this method, which you can research yourself, but can greatly decrease concurrent connections if that's an issue.

    If you have a decent budget someone like Percona can really help.

    Otherwise it's hard to give any reasonable advice without knowing a lot about how the database is setup, the hardware it's on, and the application that's going to be accessing it.
     
    jestep, Nov 14, 2013 IP