-1

Good day,

I have a web-server running Apache with wsgi (Python) and Mysql database. The server is dual core, with 4GB RAM.
The time has come for a system upgrade, and the new server will be Xeon E3-1230 (Quad core) with 8GB of RAM.

I've been thinking to split the system and run DB on one of them, and the rest on the other.

What are the considerations when deciding whether the new (and stronger) server should run the DB or the Apache (With lot's of python code)?

Thank you

Vasisualiy
  • 113
  • 2
  • Product Recommendation Questions are Off-Topic on any of the [se] sites. See [Q&A is hard, lets go Shopping](http://blog.stackoverflow.com/2010/11/qa-is-hard-lets-go-shopping) and the [FAQ] for more details. See also: [How do you do Load Testing and Capacity Planning for Databases](http://serverfault.com/q/350458/50875) – Chris S Jul 31 '12 at 14:35

3 Answers3

6

There's no 'one-size-fits-all' answer to this, you need to understand the nature of your web application. What you're looking for is overall load split as a percentage of the existing box's capacity and also try to understand the threading capability of your web-app.

MySQL will happily use four cores and benefit from the increased memory bandwidth and moving the DB to the new server would be my 'blind' recommendation but if your application is swamping the existing machine and looks like it'll scale then you could look at putting the app on the new server.

Basically try to understand what both functions are doing and what they need - that'll inform your answer.

Chopper3
  • 100,240
  • 9
  • 106
  • 238
  • I would never advise this as the first optimzation, since A. chances are that he's not using his database optimally (if he was, he'd not need to ask), and B. you can achieve a lot with caching on the python/web server side. – adaptr Jul 31 '12 at 14:20
1

The answer depends on your usage pattern.

If both use the same amount of resources (CPU time, disk IO, RAM, etc etc) then it does not matter. If the DB uses a lot more disk IO (which is likely)than put it on the system with the fastest disk. Etc. etc.

So, basically:

  1. Measure which resource each application uses.
  2. Then make a choice (rather than a guess).
Hennes
  • 4,772
  • 1
  • 18
  • 29
0

It all depends.

To answer such a question, first of all you need to collect performance data from all components separately, and combined, on the current hardware.

Once you know how many HTTP requests per second you have, how long these take on avg/min/max, and how many python calls are involved, and how long THOSE take, and how much memory is required for them, and you know your overall and peak SQL disk I/O requirements, and the amount of SQL queries performed for each web request, and the total number of queries, THEN you can start calculating which component is the heaviest on your current hardware.

This would also be the right time to start improving the processing itself - use a better apache MPM, optimize your Python code and database accesses, and optimize your database structure.

adaptr
  • 16,479
  • 21
  • 33