Two other options, depending on how much control you have over the server:

1) Use nginx instead of Apache (smaller memory footprint, leaving more
for Python)

2) Use swap memory
(http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/) ... not an
option for shared hosting and certain types of VPS, but if you can do it
and you're willing to put up with lower performance, this can be a good
way to get your application to run without paying for more memory. I run
development and low-traffic applications on micro AWS instances all the
time by creating 1GB of swap.

_Nik

On 9/20/2013 3:18 PM, Mike Dewhirst wrote:
> On 21/09/2013 3:34am, Carlos Villavicencio wrote:
>> Hello,
>>
>> I have a django project running on digitalocean (in a 512M server) and
>> suddenly it appears Error 500 on the Apache.
>>
>> I'm running wsgi and only 2 users (because we are starting)
>>
>> Looking on the logs, the errors were the following:
>>
>> 1. ImproperlyConfigured: Error importing middleware
>> django.middleware.transaction: "cannot import name transaction"
>
> If it only occurs occasionally it "feels like" a platform problem
>
>> 2. OSError: [Errno 12] Cannot allocate memory
>
> Sounds like insufficient memory. From my reading (some time ago)
> Django/Python likes substantial quantities of memory - and of course
> it depends on what your software is doing.
>
> Try hiring more memory and see if the errors go away. I've got a
> production server running 1Gb quite successfully but it is lightly
> used. I'm planning to throw more at it later.
>
>>
>> The first error occurs more than the second one.
>>
>> Does the 512M server is fine for a django production project?
>> The middleware transaction is correctly configured in settings.py, why I
>> get "randomly" this error? Maybe a concurrency issue?
>>
>> Thanks,
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to