1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Production database server

Discussion in 'Databases' started by bgcadmin, Sep 10, 2014.

  1. #1
    Hello!
    Sorry if posted in the wrong section but:
    SEMrush
    I have a problem, that i'd like to address to you. We are creating an webapp that shows infos and statistics. And we have a problem about how to 'do right' our server configuration

    The thing is that our apps use crons to do few things, and crons sometimes blocks our database, and when that happens, whole application is frozen, which means no user input, no pages loading etc.

    What should we do to prevent this from happening? is there a way to mirror the database and hold two of them one for backend and one for frontend, or we should limit connections to the database, or maybe we should use some other method.

    Any help would be appreciated
     
    bgcadmin, Sep 10, 2014 IP
    SEMrush
  2. jestep

    jestep Prominent Member Premium Member

    Messages:
    3,661
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    How would cron be freezing the database?

    Just going out on a limb here, but I would suggest not using MyISAM as a storage engine and switch to Innodb which uses row level locking instead of table level locking. But just taking a wild guess at what's going on in your app.
     
    jestep, Sep 12, 2014 IP
  3. immu

    immu Greenhorn

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    I think jestep guessed it right.
    Locks and blocks are critical part of any RDBMS. use it wisely, try the hint provided by him.
     
    Last edited: Sep 14, 2014
    immu, Sep 14, 2014 IP
  4. bgcadmin

    bgcadmin Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    hello, sorry I wasn't precise enough we do use InnoDB, by blocking a database I mean, database uses all given resources and stops answering to any queries/connections, since both crons and frontend needs to connect and pull or store data in the DB
     
    bgcadmin, Sep 15, 2014 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,630
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    If a cron-job bogs down the server and uses all resources, then you're in desperate need of a re-write. What does this cron-job do, exactly?
    There are settings, both in general server config and mysql-config that restricts simultaneous users, but it should be set fairly high (unless idiotic sysadmin).
     
    PoPSiCLe, Sep 15, 2014 IP