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

  • It's simple: do not lock database. There are plenty of ways, starting from simple read-only replica… – Alexey Ten Sep 10 '14 at 9:05
  • 2
    Consider: Make the developers fix their crappy code. – TomTom Sep 10 '14 at 9:09
  • @AlexeyTen Thanks for your input. I'd like to know one more thing, It's a good solution, but wouldn't copying bigger databases (like for ex. 50gigs+, be time consuming?) TomTom taken into consideration :D – PartyPete Sep 10 '14 at 9:36
  • You only have to create the base for the replica once, the deltas are much much smaller – thanasisk Sep 10 '14 at 9:39

You should make your programmers to fix cron queries, that they do not block mysql. That is the only one right way. If a programmer needs to process a lot data it must run it in a loop in small and fast chunks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.