fidals / shopelectro

shopelectro.ru site's code
4 stars 5 forks source link

Long serv response #603

Closed duker33 closed 5 years ago

duker33 commented 6 years ago

Every page responses with timeout of ~3s. Sometimes category and product pages return 502 error.

Checked this pages: Main, Category, Product

duker33 commented 6 years ago

on local machine with fixtures category page eat responses with ~1.6 sec. DB queries part takes only 100 ms.

So, we have ~1.5 sec inside app

duker33 commented 6 years ago

seems it's about templates. View logic with disabled templates stuff responses in 300-400 ms.

And version 1.5.0 renders category page with 1.5 sec too.

Maybe we had caching enabled, but it disabled now

duker33 commented 6 years ago

seems it's problems with cache. Checked with debug toolbar on prod: we have 0 cache hits now. So, i'll see on our caching mech

duker33 commented 6 years ago

blocked by #606

duker33 commented 5 years ago

now release cache mech enabling and test if this issue is resolved

duker33 commented 5 years ago

released it. Problem is still there

duker33 commented 5 years ago

i'll fully reproduce prods SE structure on local and start debugging

duker33 commented 5 years ago

reproduced it on local. Gunicorn worker fails with timeout. I'm debugging it

duker33 commented 5 years ago

found thin place in code. It's here: https://github.com/fidals/refarm-site/blob/master/images/models.py#L36

This two nested cycle eat ~6 sec of cpu time for every request on my local machine (core i7)

duker33 commented 5 years ago

appended lru_cache for this problem place. Now releasing it

0pdd commented 5 years ago

@duker33 the puzzle #617 is still not solved.

0pdd commented 5 years ago

@duker33 3 puzzles #617, #624, #625 are still not solved.

0pdd commented 5 years ago

@duker33 the puzzle #625 is still not solved; solved: #617, #624.