AshoniA
AshoniA
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
nice
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
that was a different problem. I think I fixed that by usign collectstatic in start configurations? idk or maybe because I changed debug to false. but the 30+ sec response doesn't happen on chrome. and the load times are good for me
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
but I can't login there so I guess debug is indeed false
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
wait nvm, I thought debug mode meant that I wouldn't even be able to access /admin page
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
now this problem doesn't bother me as much now because most people use chrome anyway and this is just a portfolio website. but another problem I found is that backend django is in debug mode still even though I specified Debug= False.
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
After countless hours of researching I found out that the problem appears only on firefox. I tested edge and chrome and they are all fine. yes the response sometimes takes 1-3 seconds but it's only expected as server is so far away. and nothing compared to 30+ seconds. and btw it's not actually 30+ seconds it's just that gunicorn times out after 30 seconds and when I set timeout to 5 minutes the problematic responses took all 5minutes.
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
I tested this by printing something first and then printing products and products got printed much later
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
so querying data from db is the problem
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
from what I've tested the problematic line is this in the django:
if(query):
products = Product.objects.filter(name__icontains=query).order_by("_id")
else:
products = Product.objects.all().order_by("_id")
if(query):
products = Product.objects.filter(name__icontains=query).order_by("_id")
else:
products = Product.objects.all().order_by("_id")
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
damn, okay. in one way it's good news and means I can fix this
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
other parts too but this is most problematic
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
is the problematic part
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
from page to page
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
sure, just pagination
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
when I'm in localhost and I make connection to local postgres db the responses are very fast (under a second) so thats why I'm thinking it's not the code but where the site is hosted.
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
around 2 out of 5 times the worker times out, and thats a lot
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
sometime it's quite fast. 1-3 seconds. and sometimes it's like 30 seconds and worker times out.
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
I think I found out what the problem is lol. I just found out the Server is deplyed in US West Oregon and I'm in Georgia (country) so the ping should be very high. I wonder how the site is doing in US.
164 replies
RRailway
Created by AshoniA on 4/2/2024 in #✋|help
Server Response too slow
I'll let you know!
164 replies