Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General Cache #43

Open
jetbalsa opened this issue Feb 15, 2018 · 10 comments
Open

General Cache #43

jetbalsa opened this issue Feb 15, 2018 · 10 comments

Comments

@jetbalsa
Copy link

I didn't spot one, but does the platform have an internal cache for things? page loads on my end are getting a little slow under problems due to the amount of challenges I have added (up to 151)

Memcache or Redis would be suggested.

@paullj1
Copy link
Member

paullj1 commented Feb 16, 2018

We have implemented a simple cache for what I expected to be a bottle neck (calculating scores), but not for the challenges. The problem is that the current implementation makes several queries for each problem, which should be changed without a doubt. I just honestly never expect > 100 challenges.

@jetbalsa
Copy link
Author

Leave it to me to break things :) My CTF is still two months out so I'm doing all kinds of testing of the platform

paullj1 added a commit that referenced this issue Feb 16, 2018
@paullj1
Copy link
Member

paullj1 commented Feb 16, 2018

I really appreciate the feedback. It's good to have actual use cases that occur more frequently than once per year. That last commit implements the built-in rails caching for each problem page. That might start to solve your problem. I won't be able to generate a test case that large until this weekend (I'll automate it, but writing the automation won't be trivial). If you get a chance, see if that scratches your itch. The commits are in the 'dev' branch.

@paullj1
Copy link
Member

paullj1 commented Feb 16, 2018

Also, worth mentioning, the cache will only actually work in a "production" environment... so you'll have to run it inside the container or on Heroku to test.

@jetbalsa
Copy link
Author

jetbalsa commented Feb 16, 2018 via email

@jetbalsa
Copy link
Author

jetbalsa commented Feb 16, 2018 via email

@paullj1
Copy link
Member

paullj1 commented Feb 17, 2018

Awesome! Did the caching improve the performance? Yeah, it looks like ARM64 isn't "officially" supported. Does it not build, or does it just not work?

@jetbalsa
Copy link
Author

jetbalsa commented Feb 17, 2018 via email

@jetbalsa
Copy link
Author

jetbalsa commented Feb 17, 2018 via email

@paullj1
Copy link
Member

paullj1 commented Feb 17, 2018

Interesting. So getting Docker running these days on arm is pretty straight forward (I've got an old Pi running it right now). I'm just not sure if the image needs to be specified. I'm pretty sure it does, but that's easy. You'd just change the "FROM" directive to: "FROM: arm64v8/ruby:2.5" (I'm currently in the process of overhauling the Dockerfile though, so I'd hold off for a few minutes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants