Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

closed as not constructive by Chris S Jul 31 '12 at 14:34

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

    
Product Recommendation Questions are Off-Topic on any of the Stack Exchange sites. See Q&A is hard, lets go Shopping and the FAQ for more details. See also: How do you do Load Testing and Capacity Planning for Databases –  Chris S Jul 31 '12 at 14:35

3 Answers 3

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.

share|improve this answer
    
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

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).
share|improve this answer

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.

share|improve this answer

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