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

Prepare for high traffic #43

Closed
palcu opened this Issue Apr 29, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@palcu
Member

palcu commented Apr 29, 2016

We will have a huuge spike in traffic next week due to some new datasets that will appear on the website. Things to do on D-Day production instance:

  • disable PDF preview
  • configure nginx params

https://serversforhackers.com/nginx-caching/
https://www.nginx.com/resources/admin-guide/serving-static-content/
https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/

Test caching of resources from Apache by adding the cache hit/miss tag.

  • install redis
source activate
pip install redis
sudo add-apt-repository ppa:chris-lea/redis-server
apt-get install redis-server
  • configure it with raw hardcoded stuff
  • upload the resources to data.gov
  • upload the resources to my S3

In config/middleware:

  • line 315 put True
  • line 273 put self.redis.StrictRedis(host='localhost', port=6379, db=0)

Now, in case shit hits the fan and the load grows a lot:

  • disable debug log
  • set ckan.page_cache_enabled = True and reload Apache

In the end we can:

  • set in vim /etc/nginx/sites-enabled/ckan
    location /dataset/f21d9aed-420c-4b0d-a502-e33490b28ecd/resource/ee07fb9a-c431-40ea-bbb6-445413247542/download/mari.csv {
        rewrite ^/.* http://static.datagovro.palcu.ro/mari.csv permanent;
    }
@palcu

This comment has been minimized.

Show comment
Hide comment
@palcu

palcu Jul 6, 2016

Member

Done.

Member

palcu commented Jul 6, 2016

Done.

@palcu palcu closed this Jul 6, 2016

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