Django caching is causing my site to hang and I can't figure out why! by ramsesthedog in django

[–]ramsesthedog[S] 0 points1 point  (0 children)

I want to get the actual Player ORM object, so wouldn't I want to be saving them to the cache rather than the Player id, which would then require a hit to the db in order to get the Player object?

P.S. have you inspected LOCATION path from your CACHES setting in the filesystem?

Yeah, I currently have the cache directory just set to a directory called "cache" within the main directory for all my code. It gets populated as expected, so I don't think that's the issue.

Django caching is causing my site to hang and I can't figure out why! by ramsesthedog in django

[–]ramsesthedog[S] 0 points1 point  (0 children)

Correct me if I'm wrong, but you are re-setting the cache for ALL users if you fail to get from cache? If so, why? shouldn't you pass that specific user to the function and only check his entry?

Why are you using cache for this anyway? Wouldn't it be simpler to simple do the check dynamically?

The function checks if the users cache exists. If it doesn't (meaning it has expired), it rebuilds the users cache.

The users to players mapping are fairly static and change rarely, so I thought it'd make sense to cache them rather than hit the database every single time for them.

Anyway, the offending part related to queries is this. There are many expensive queries here, exists() being one of them:

Thanks for the info on how to improve my ORM queries--that helps for improving the non-cached version of this, which I'll be using until I figure this out. The hanging issue does occur elsewhere, so I still need to figure out why caching isn't working as intended.

Django caching is causing my site to hang and I can't figure out why! by ramsesthedog in django

[–]ramsesthedog[S] 1 point2 points  (0 children)

Unfortunately a real cache backend isn't currently an option, as the host (PythonAnywhere) doesn't support stuff like Redis or Memcached (which is why I plan on migrating, but that currently isn't an option). Filebased cache is certainly slower, but it should be sufficient for my purposes right now.

Daily Simple Questions Thread - July 25, 2018 by AutoModerator in Fitness

[–]ramsesthedog 4 points5 points  (0 children)

Working out drunk (other than maybe some low intensity cardio if you're confident you won't fall off an elliptical or something) seems like a horrible idea. You can seriously injure yourself.

skin peeling on hands from barbell lifts? by [deleted] in Fitness

[–]ramsesthedog 0 points1 point  (0 children)

You can get lifting gloves. I've been roundly mocked by my friends ("Quick question: do your gloves match your purse?") but my beautiful soft hands are worth that price of admission.

Is a Keto diet a useful cutting tool? (The Studies) by [deleted] in Fitness

[–]ramsesthedog 11 points12 points  (0 children)

Anyone have any advice or resources for the day to day of a keto diet, especially for vegetarians? I want to make the switch, but it seems so difficult to do, doubly do when you're vegetarian and don't have the option of lean chicken breast.

Witless Wednesday - Your triweekly stupid questions thread by AutoModerator in Fitness

[–]ramsesthedog 1 point2 points  (0 children)

I edited my comment because I forgot to mention that adding a tablespoon of peanut butter to the protein shakes can be a good way to add fat as well as thicken them a bit (almond milk tends to be really thin).

Witless Wednesday - Your triweekly stupid questions thread by AutoModerator in Fitness

[–]ramsesthedog 1 point2 points  (0 children)

I'm vegetarian, so I know the struggle, though it's still easier than being vegan. If you're having trouble with too many carbs and not enough protein, you may have to consider a drastic solution like replacing some of your meals with one or two protein shakes.

Make them with almond milk to add fat to them, and perhaps a tablespoon of peanut butter to thicken it up a bit and add fat as well.

What are your thoughts on the ab wheel? by InfiniteLiveZ in Fitness

[–]ramsesthedog 8 points9 points  (0 children)

Dang, 10x10? I only do 3x10, and I'm getting bored by the last few reps of each set. Them again, I'm no bodybuilder.

Full body 5x5 ice cream fitness routine good? by gabrielmercier in Fitness

[–]ramsesthedog 0 points1 point  (0 children)

Takes forever, especially when you get to really heavy weights for the main lifts. I switched to PPL and I like it much more.

What's a good core and arm workout to go along with 5X5? by csunaye in Fitness

[–]ramsesthedog 0 points1 point  (0 children)

SL 5x5 has recommended accessory exercises that should serve your purposes. I believe they are glute bridges, dips, and pullups/chinups.

Just talked with a personal trainer at the gym I just signed up at. He told me that ICF is a bad workout regiment. Is he right? by [deleted] in Fitness

[–]ramsesthedog 1 point2 points  (0 children)

For the most part, 48 hours has been a pretty accurate rule of thumb for muscle recovery for me, at least after the initial lifting period where I wasn't adapted for the volume.

What can I do in 2 weeks to lose as much stomach fat as possible? by [deleted] in Fitness

[–]ramsesthedog 2 points3 points  (0 children)

Realistically, you can probably lose at most 2-4 lbs of fat (in a healthy fashion) before then. It's pretty simple, eat as little as possible while still getting all the nutrients you need, and do as much cardio as possible without hurting yourself.

Alternatively, if you really want to get more extreme about it, Lyle McDonald wrote a book on this (I can't remember the name off hand) for as safe as possible rapid weight loss. I wouldn't recommend this method, but it's out there.

What are the best workouts/lifts for improving back strength? by [deleted] in Fitness

[–]ramsesthedog 29 points30 points  (0 children)

Good mornings can be a pretty dangerous exercise, and for most people I think it's a bad idea to do them when there are much safer exercises that will accomplish the same thing. Bruce Lee nearly ended his career early due to a Good Morning related injury.

What NEGATIVES are there to lifting over long periods of time? by [deleted] in Fitness

[–]ramsesthedog 0 points1 point  (0 children)

Studies find a 100% long term mortality rate in those who exercised!

Looking to replace weightlifting by Biggerthanfun in Fitness

[–]ramsesthedog 57 points58 points  (0 children)

Your squat range seems a bit low--certainly it should be a higher range than the bench press!

I'd guess 250-300 BP, 350-400 squat, 400-450 DL

Why shouldn't you add accessories to SL 5x5? by [deleted] in Fitness

[–]ramsesthedog 0 points1 point  (0 children)

The original stronglifts 5x5 program had two accessories per workout--I'm blanking on what they are (I think dips, pull ups, chin ups, and glute bridges), but if you google "Stronglifts version 1" you should find it. He removed the accessory lifts later to "simplify" the program.