Re: How to Speed up Loading the First Page of Django Project?

2017-11-22 Thread Jason
Regardless, your solution is not a good one, because you shifted from a 
password hashing algorithm that enables protection against brute-force 
attacks to a different algorithm with no similar protection.

I would highly suggest you read 
https://docs.djangoproject.com/en/1.11/topics/auth/passwords/ 

-- 
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/e99884be-e3da-4090-90f0-7592dfc7df5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-21 Thread flora . xiaoyun . huang
But that's all I revised of the code. The configuration file of server 
engine and all the other things keep the same.

On Tuesday, November 21, 2017 at 2:09:08 PM UTC-5, Jason wrote:
>
> That is not a good solution.  There's a reason why the default password 
> hashing algorithm is complex.
>
> And I find it hard to believe that a password hash is the culprit here.  
> Maybe a quarter second or so added to a response, but 10 seconds?  that's 
> definitely not the cause.
>

-- 
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/94d70393-b9a4-43d3-857c-acc9ba9134a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-21 Thread Jason
That is not a good solution.  There's a reason why the default password 
hashing algorithm is complex.

And I find it hard to believe that a password hash is the culprit here.  
Maybe a quarter second or so added to a response, but 10 seconds?  that's 
definitely not the cause.

-- 
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/8ccac83b-ff61-4a25-b567-11147f03dfc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-21 Thread flora . xiaoyun . huang
Hi Jason,

Thanks for your help! I just solved the bug. 

The reason of the bug is that in the first step after I verify the worker's 
identification, I should put them in the database. And in django default 
setting, PASSWORD_HASHERS is set to PBKDF2 to hash the password for each 
worker. It is a complex algorithm, slowing down the speed to put users in 
the database. So I change PASSWORD_HASHERS to SHA1P. In this way, the user 
is put in the database faster, thus the first page is loaded faster.

On Tuesday, November 21, 2017 at 9:15:54 AM UTC-5, Jason wrote:
>
> Does that worker call execute slowly each time you call it?  Or is it just 
> the once?
>
> I'd copy that URL and try calling it several times with an REST API client 
> like Postman.  Does the request execute that slowly each time you call it, 
> or is it just the initial call that is slow?
>

-- 
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/34e36052-9c46-4c07-8386-2e21c9633422%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-21 Thread Jason
Does that worker call execute slowly each time you call it?  Or is it just 
the once?

I'd copy that URL and try calling it several times with an REST API client 
like Postman.  Does the request execute that slowly each time you call it, 
or is it just the initial call that is slow?

-- 
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/4e72065e-9006-4c9f-a7e1-882ba6c8b647%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-19 Thread flora . xiaoyun . huang
Hi,

The worker id and hit id are passed via GET. (It's a website for amazon 
mechanical turker to finish tasks.) And views.py checked their worker id 
and hit id to see whether they are valid. If they're valid, then the turker 
will be directed to the following pages.

On Sunday, November 19, 2017 at 5:40:21 AM UTC-5, Antonis Christofides 
wrote:
>
> Hello,
>
> How does the verification work?
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2017-11-19 02:38, flora.xia...@gmail.com  wrote:
>
> Thank you for your reply. The first page always loads slowly while the 
> rest of the pages loads at a normal speed. Whether I restart the apache or 
> not doesn't affect the speed of loading the first page - always slow. 
>
> Below is the configuration file in the sites-available folder under 
> apache. My apache is 2.4.
> 
> ServerAdmin webmaster@localhost
>
> DocumentRoot /var/www/html
> 
> Options FollowSymLinks
> AllowOverride None
> 
> 
> Options Indexes FollowSymLinks MultiViews
> AllowOverride None
> Require all granted
> 
>
> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> 
> AllowOverride None
> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
> Require all granted
> 
> ErrorLog /var/log/apache2/error.log
>
> # Possible values include: debug, info, notice, warn, error, crit,
> # alert, emerg.
> LogLevel warn
>
> CustomLog /var/log/apache2/access.log combined
>
> Alias /doc/ "/usr/share/doc/"
> 
> Options Indexes MultiViews FollowSymLinks
> AllowOverride None
> Require all granted
> Allow from 127.0.0.0/255.0.0.0 ::1/128
> 
>
> Alias /static path/to/my/project/static
> 
> Require all granted
> 
>
>   
> 
> Require all granted
> 
> 
>
>
>   WSGIDaemonProcess myproject 
> python-path=path/to/my/project:path/to/my/project/lib/python2.7/site-packages
>   WSGIProcessGroup myproject
>   WSGIScriptAlias / path/to/my/project/myproject/wsgi.py
> 
>
> Thank you!
>
> 在 2017年11月17日星期五 UTC-5上午8:27:24,Jason写道: 
>>
>> I would suggest you post the configuration file here as well as the 
>> server specifications and average CPU/memory usage.  Because what you're 
>> describing is definitely not normal and is most likely related to how 
>> Apache is configured.
>>
>> A point of clarification: does the first page always load slowly, or is 
>> it just the first page after you restart the server?
>>
>> -- 
> 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...@googlegroups.com .
> To post to this group, send email to django...@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/4cb4d8a9-6709-4f89-923f-bf5cc311e05a%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/10f58d4b-fd3f-461f-81a3-f0f8d2a6554e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-19 Thread Antonis Christofides
Hello,

How does the verification work?

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com

On 2017-11-19 02:38, flora.xiaoyun.hu...@gmail.com wrote:
> Thank you for your reply. The first page always loads slowly while the rest of
> the pages loads at a normal speed. Whether I restart the apache or not doesn't
> affect the speed of loading the first page - always slow.
>
> Below is the configuration file in the sites-available folder under apache. My
> apache is 2.4.
> 
>         ServerAdmin webmaster@localhost
>
>         DocumentRoot /var/www/html
>         
>                 Options FollowSymLinks
>                 AllowOverride None
>         
>         
>                 Options Indexes FollowSymLinks MultiViews
>                 AllowOverride None
>                 Require all granted
>         
>
>         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>         
>                 AllowOverride None
>                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>                 Require all granted
>         
> ErrorLog /var/log/apache2/error.log
>
>         # Possible values include: debug, info, notice, warn, error, crit,
>         # alert, emerg.
>         LogLevel warn
>
>         CustomLog /var/log/apache2/access.log combined
>
>     Alias /doc/ "/usr/share/doc/"
>     
>         Options Indexes MultiViews FollowSymLinks
>         AllowOverride None
>         Require all granted
>         Allow from 127.0.0.0/255.0.0.0 ::1/128
>     
>
> Alias /static path/to/my/project/static
>         
>                 Require all granted
>         
>
>   
>         
>                 Require all granted
>         
>         
>
>
>   WSGIDaemonProcess myproject
> python-path=path/to/my/project:path/to/my/project/lib/python2.7/site-packages
>   WSGIProcessGroup myproject
>   WSGIScriptAlias / path/to/my/project/myproject/wsgi.py
> 
>
> Thank you!
>
> 在 2017年11月17日星期五 UTC-5上午8:27:24,Jason写道:
>
> I would suggest you post the configuration file here as well as the server
> specifications and average CPU/memory usage.  Because what you're
> describing is definitely not normal and is most likely related to how
> Apache is configured.
>
> A point of clarification: does the first page always load slowly, or is it
> just the first page after you restart the server?
>
> -- 
> 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/4cb4d8a9-6709-4f89-923f-bf5cc311e05a%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/a9e4105e-fcbd-dc36-235c-97182ed730c4%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-18 Thread flora . xiaoyun . huang
And this is the first few lines of requests in the network section in 
developer tools. You can see that the first step to verify the user's 
identification takes so long.




When multiple users pop in, the memory usage of the server will be very 
high.

在 2017年11月17日星期五 UTC-5上午8:27:24,Jason写道:
>
> I would suggest you post the configuration file here as well as the server 
> specifications and average CPU/memory usage.  Because what you're 
> describing is definitely not normal and is most likely related to how 
> Apache is configured.
>
> A point of clarification: does the first page always load slowly, or is it 
> just the first page after you restart the server?
>
>

-- 
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/eb812b22-e7c9-4317-8db2-4a7ecc2f6d1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-18 Thread flora . xiaoyun . huang
Thank you for your reply. The first page always loads slowly while the rest 
of the pages loads at a normal speed. Whether I restart the apache or not 
doesn't affect the speed of loading the first page - always slow.

Below is the configuration file in the sites-available folder under apache. 
My apache is 2.4.

ServerAdmin webmaster@localhost

DocumentRoot /var/www/html

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Require all granted
Allow from 127.0.0.0/255.0.0.0 ::1/128


Alias /static path/to/my/project/static

Require all granted


  

Require all granted




  WSGIDaemonProcess myproject 
python-path=path/to/my/project:path/to/my/project/lib/python2.7/site-packages
  WSGIProcessGroup myproject
  WSGIScriptAlias / path/to/my/project/myproject/wsgi.py


Thank you!

在 2017年11月17日星期五 UTC-5上午8:27:24,Jason写道:
>
> I would suggest you post the configuration file here as well as the server 
> specifications and average CPU/memory usage.  Because what you're 
> describing is definitely not normal and is most likely related to how 
> Apache is configured.
>
> A point of clarification: does the first page always load slowly, or is it 
> just the first page after you restart the server?
>
>

-- 
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/4cb4d8a9-6709-4f89-923f-bf5cc311e05a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-17 Thread Jason
I would suggest you post the configuration file here as well as the server 
specifications and average CPU/memory usage.  Because what you're 
describing is definitely not normal and is most likely related to how 
Apache is configured.

A point of clarification: does the first page always load slowly, or is it 
just the first page after you restart the server?

-- 
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/b048d3d8-04b8-42cc-adbd-26ed6e61d938%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.