WebFaction
Community site: login faq

I always see threads and questions about reducing memory usage, but what about increasing it? If you have the memory why not use it?

I'd like to increase the amount of processes for my we site so that it can serve more requests, but I'm not sure how to do this optimally with mod_wsgi and threading throws me off further. I'm using the default configuration from the 1-click installer from just a few weeks ago so it should be the most recent. It looks like this:

MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
ThreadsPerChild 5
WSGIDaemonProcess django processes=2 threads=12 python path=/home/XXX/webapps/django:/home/XXX/webapps/django/myproject:/home/XXX/webapps/django/lib/python2.7
WSGIProcessGroup django
WSGIRestrictEmbedded On
WSGILazyInitialization On
WSGIScriptAlias / /home/XXX/webapps/django/myproject/wsgi.py

I thought about sampling increasing the amount of processes, but I figured I'd check first since I'm not sure how ThreadsPerChild, processes, and threads relate to each other. Can I increase processes by itself or will I need to change the others as well?

I plan to do some reading but I never see this addressed so maybe this could help others too.

asked 15 Sep '13, 13:06

crobison
112
accept rate: 0%


The official mod Wsgi docs are exactly what you need to know to properly increase the numbers for the configuration. What you need to adjust them to depends on your RAM usage, and this can be checked by debugging mod_Wsgi.

permanent link

answered 15 Sep '13, 17:28

johns ♦♦
5.3k212
accept rate: 23%

If you really want to make the most of your extra memory and increase performance I recommend rolling your own Nginx with PHP-FPM or uWSGI stack. You'll get a lot more control over performance and memory usage and in my experience it is much faster in all configs against Apache/mod_wsgi

permanent link

answered 20 Sep '13, 19:13

HittingSmoke
4822030
accept rate: 8%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×905
×55
×27

question asked: 15 Sep '13, 13:06

question was seen: 2,409 times

last updated: 20 Sep '13, 19:13

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM