透明思考


Transparent Thoughts


Mongrel的内存占用确实成问题

2 sets of configurations:

  • A. 20 mongrel instances 300MB memory limitation for each
  • B. 10 mongrel instances 512MB memory limitation for each
Findings without surprise:
  • with config A, total memory usage is about 6000+MBytes
  • with config B, total memory usage is about 4000+MBytes
  • in normal cases, the momory usage of each mongrel instance is about 400MBytes
  • for operations with light calculation, config A is generally faster than config B
Findings with surprise:
  • for operations with heavy calculation, config B is more efficient than config A when load(amount ofconcurrent users) grows
  • more importantly, config B performs more consistenly than config A
    • config A fails 2 test cases for 15 concurrent users, and the possibility of failuregrowssignificantly to 5.57% for 20 concurrent users
    • config B doesn’t fail any test case
    • the degrading curve of performance of config B is flatter than config A
Conclusion:
  • besides the memory usage,CPUusage is yet another bottle neck of performance
  • 20 mongrel instances on 1 server overloads the CPUs, and thus degrades the performance
  • reducing the amount of mongrel instances makes HAProxy works as a queue, therefore makes thesystem performslinearly
Suggestion:
  • prefer config B than A: 10 mongrel instances on each of 2 production servers can handle 20concurrent users,which (based on my experience) effectively means at least 1000 users onlineAT THE SAME TIME
  • try config C (15 mongrel instances 400MB limitation for each) and D (5 or 7 mongrel instances 512MBlimitation for each),IF NECESSARY