Skip to content

Commit

Permalink
Updated notes and comments on server configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Mar 7, 2019
1 parent c758435 commit 0ab47e5
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 36 deletions.
2 changes: 2 additions & 0 deletions config/environment.sh
@@ -1,3 +1,5 @@
# Copy this file to /etc/blot/environment.sh and fill it in

# Flags
export BLOT_PRODUCTION=true
export BLOT_CACHE=true
Expand Down
23 changes: 0 additions & 23 deletions config/guides/aws-instance-notes.txt

This file was deleted.

3 changes: 0 additions & 3 deletions config/guides/domain-change.txt

This file was deleted.

31 changes: 31 additions & 0 deletions config/guides/production-environment-setup.txt
Expand Up @@ -11,6 +11,36 @@ Then make sure you make all the contents of scripts/production executable:
chmod +x scripts/production/start_blot.sh
```

AWS
---

At the moment I have moved Blot to an I3 instance which has 16GB of RAM, a 500GB SSD hardrive for temporary data.

The 500GB harddrive is what Amazon calls an 'instance store'. It should not be depended on. When the instance reboots the data on it is lost, I believe.

I think it might be a good idea to use it as a cache. I should also move my EBS data to a cheaper (non-ssd)drive. Then I can use the SSD drive that comes with the i3 instance.

The I3 instance offers volatile storage.

---

3/3/2018 I have since set up the instance store as a cache.

I followed these steps to set up the disk to use as a cache:

https://richardstechnotes.wordpress.com/2015/12/18/setting-up-an-nvme-ssd-on-ubuntu-14-04-lts/

More instructions here:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/add-instance-store-volumes.html

I don't really care about write speed (as opposed to read speed) but here is a guide for optimizing write performance on instance stores:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disk-performance.html




Production machine configuration (Linux)
----------------------------------------

Expand All @@ -20,6 +50,7 @@ sysctl vm.overcommit_memory=1
sudo bash -c "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
dd if=/dev/zero of=/swapfile1 bs=1024 count=4194304


Upstart
-------

Expand Down
1 change: 1 addition & 0 deletions config/monit.rc
@@ -1,6 +1,7 @@
# Monit exists to restart the node.js server or
# NGINX if either become unresponsive. Upstart
# only restart these processes if they exit.

set logfile /var/www/blot/logs/monit.log

# The route which responds is in app/index.js
Expand Down
21 changes: 11 additions & 10 deletions config/readme.txt
Expand Up @@ -3,23 +3,24 @@ Config

This directory contains the scripts and configuration code to run NGINX, Redis and Monit, which combine with the node js server to produce Blot. When setting up a new production or development machine, follow the respective guides in the guides directory. There are a number of scripts for updating Blot's configuration on the server, which are stored in scripts/production:

Upstart: reloading the scripts
sudo ./scripts/production/update_upstart.sh
Upstart: reloads the scripts to start Blot, nginx, redis and monit
$ ./scripts/production/update_upstart.sh

Monit: reloading configuration
sudo ./scripts/production/reload_monit_rc.sh
Monit: reloads its configuration
$ ./scripts/production/reload_monit_rc.sh

NGINX: reloading configuration with zero downtime
sudo ./scripts/production/nginx_reload_configuration.sh
NGINX: reloads its configuration with zero downtime
$ ./scripts/production/nginx_reload_configuration.sh


Logging
-------

Check logs/sys.log for upstart related logging
Check logs/monit.log for monit related logging
Check logs/app.log for the node.js server's logs
Check logs/nginx.log for nginx's access log
Check ../logs/sys.log for upstart related logging
Check ../logs/monit.log for monit related logging
Check ../logs/app.log for the node.js server's logs
Check ../logs/nginx.log for nginx's access log


Upstart
-------
Expand Down

0 comments on commit 0ab47e5

Please sign in to comment.