2

I'm looking to scale an existing phpBB installation by separating the read queries from the write queries to two separate, replicated MySQL servers. Anyone succeeded in doing this, specifically with phpBB?

The biggest concern I have so far is that it seems like the queries are scattered haphazardly throughout the code. I'd love to hear if anyone else did this, and if so, how it went / what was the process.

Steve Paulo
  • 17,954
  • 2
  • 23
  • 23
  • sorta curious why you are doing this? .. Have you done some kind of benchmark that suggests keeping doing this is a win over simply load balancing your traffic ? – Scott Evernden Mar 09 '09 at 21:52
  • It's going to be done side-by-side with basic load balancing. We're expecting a ridiculous amount of traffic concentrated in a small timeframe from all over the world, and need to retrofit an existing system. – Steve Paulo Mar 10 '09 at 00:29
  • @Scott Evernden Separating reads and writes to different physical database servers is common good practice for highly transactional systems. Table locking occurs when one thread is writing to a row, meaning all other threads cannot read from it until that write is finished. By shifting reads to replica slaves (which only get the new data sent to them after commit) it means reads never have to wait. – DeejUK Sep 02 '11 at 13:57

3 Answers3

4

You could try MySQL Proxy which would be an easy way to split the queries without changing the application.

Node
  • 21,706
  • 2
  • 31
  • 35
3

Just add more RAM. Enough RAM to hold the entire database. You'll be surprised how fast your inefficient script will fly. Memory forgives a lot of database scaling mistakes.

Seun Osewa
  • 4,965
  • 3
  • 29
  • 32
  • This logic only goes so far. We have some web applications running on a server with 128GB of RAM, 32 cores, etc. But even that isn't enough to hold the entire data warehouse. – cbmeeks Aug 23 '16 at 15:04
0

I know this was asked a long time ago, but I'd like to share what I experienced, in case it can help anyone.

If your problem are table locks, and knowing that the default storage engine of phpbb in that day was MyISAM, have you looked at moving to InnoDB storage engine?

Just find out which tables are most frequently locked, and convert those to InnoDB. The sessions table is the first candidate here, although you may want to look at other optimizations (such as storing session data only in memcache or something) if that is your main bottleneck.

Steven De Groote
  • 2,187
  • 5
  • 32
  • 52