Skip to content
Permalink
Browse files

Updated notes and comments on server configuration

  • Loading branch information...
davidmerfield committed Mar 7, 2019
1 parent c758435 commit 0ab47e58969d1905fe1e79e775fcda9d89172cb3
@@ -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

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -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)
----------------------------------------

@@ -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
-------

@@ -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
@@ -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
-------

0 comments on commit 0ab47e5

Please sign in to comment.
You can’t perform that action at this time.