Re: Slow first request django

2016-10-18 Thread 'Tom Evans' via Django users
On Fri, Oct 14, 2016 at 5:15 AM, Avraham Serour  wrote:
> I will take a wild guess here and say that this is a modwsgi problem, it
> seems it will only load the django app after the first request.

Indeed, see this SO post for how to tell it to load your app
immediately on start up:

http://stackoverflow.com/questions/1702562/speeding-up-the-first-page-load-in-django

(EasyReader: Add "WSGIImportScript" directive)

>
> Honestly I suggest you to use nginx with uwsgi, the killer feature is that
> it is not apache, I ran with so many bumps with apache that I turned to
> nginx and never looked back.
>
> Also the config files are sane and will not drive you crazy.

Apache is an excellent webserver, particularly Apache 2.4. It has the
largest installed base and ecosystem of third party support and
packages, and can be configured to serve both the smallest and the
largest sites without any bothers. If you are already using apache and
happy with it (bar this issue), you will only waste time (and perhaps
get different issues) by switching to a different webserver.

To not get into a vim/emacs style situation, nginx/uwsgi is also
excellent; the choice of what webserver used is largely irrelevant to
how real django based sites (that actually do things) will perform.

Cheers

Tom

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1JHudsGkBsx0f0z17S_Br3GKF_rFPAmgm_1%3DW0i-gjCmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slow first request django

2016-10-13 Thread Avraham Serour
I will take a wild guess here and say that this is a modwsgi problem, it
seems it will only load the django app after the first request.

Honestly I suggest you to use nginx with uwsgi, the killer feature is that
it is not apache, I ran with so many bumps with apache that I turned to
nginx and never looked back.

Also the config files are sane and will not drive you crazy.

good luck
Avraham




On Fri, Oct 14, 2016 at 2:01 AM, Ricardo Prado  wrote:

> Hi Guys
>
> Someone can explain me the right way do create a virtualhost with threads
> and proccess? my first request is very slow between 5 to 10 seconds.
>
> I'm using ubuntu 14.04 with apache 2.4
>
> Thanks
>
> ServerName 127.0.0.2
> ServerAlias ahora.local
>
> WSGIDaemonProcess framework processes=5 threads=1
> python-path=/mnt/g/Python/osvaldo/framework/:/mnt/g/
> Python/osvaldo/framework/lib/python2.7/site-packages
> WSGIProcessGroup framework
> WSGIScriptAlias / /mnt/g/Python/osvaldo/framework/framework/wsgi.py
>
>
> #DocumentRoot /mnt/g/Python
> #ErrorLog /mnt/g/Python/logs/error.log
> #CustomLog /mnt/g/Python/logs/access.log combined
>
> Alias /static /mnt/g/Python/osvaldo/framework/static
> Alias /media /mnt/g/Python/osvaldo/framework/media
>
> 
>
> 
> Require all granted
> 
> 
>
>
> 
> Require all granted
> 
>
> 
> Require all granted
> 
>
> 
>
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/745f9cc4-da3c-48ce-910b-5a7ebcc7eeed%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6t%2B7ZNWjJrAZFOxKj4fJ1OCcA63QBEpb5-TUtYc7swf5_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.